public class LegacyBehavior extends Object
Since 7.3 the behavior of certain bpmn elements has changed slightly.
1. Some elements which did not used to be scopes are now scopes:
Constructor and Description |
---|
LegacyBehavior() |
Modifier and Type | Method and Description |
---|---|
protected static boolean |
areEqualEventSubscriptions(EventSubscriptionEntity subscription1,
EventSubscriptionEntity subscription2)
Checks if the parameters are the same apart from the execution id
|
static void |
cancelConcurrentScope(PvmExecutionImpl execution,
PvmActivity cancelledScopeActivity)
Cancels an execution which is both concurrent and scope.
|
static Map<ScopeImpl,PvmExecutionImpl> |
createActivityExecutionMapping(List<PvmExecutionImpl> scopeExecutions,
List<ScopeImpl> scopes)
Creates an activity execution mapping, when the scope hierarchy and the execution hierarchy are out of sync.
|
static void |
destroyConcurrentScope(PvmExecutionImpl execution)
Destroys a concurrent scope Execution.
|
static boolean |
destroySecondNonScope(PvmExecutionImpl execution)
Destroy an execution for an activity that was previously not a scope and now is
(e.g.
|
static PvmExecutionImpl |
determinePropagatingExecutionOnEnd(PvmExecutionImpl propagatingExecution,
Map<ScopeImpl,PvmExecutionImpl> activityExecutionMapping)
Tolerates the broken execution trees fixed with CAM-3727 where there may be more
ancestor scope executions than ancestor flow scopes;
In that case, the argument execution is removed, the parent execution of the argument
is returned such that one level of mismatch is corrected.
|
protected static void |
ensureConcurrent(PvmExecutionImpl execution) |
protected static void |
ensureConcurrentScope(PvmExecutionImpl execution) |
protected static void |
ensureScope(PvmExecutionImpl execution) |
static boolean |
eventSubprocessComplete(ActivityExecution scopeExecution) |
static boolean |
eventSubprocessConcurrentChildExecutionEnded(ActivityExecution scopeExecution,
ActivityExecution endedExecution) |
protected static PvmExecutionImpl |
findCompensationThrowingAncestorExecution(PvmExecutionImpl execution) |
static PvmExecutionImpl |
getScopeExecution(ScopeImpl scope,
Map<ScopeImpl,PvmExecutionImpl> activityExecutionMapping)
In case the process instance was migrated from a previous version, activities which are now parsed as scopes
do not have scope executions.
|
protected static ScopeImpl |
getTopMostScope(List<ScopeImpl> scopes) |
static boolean |
hasInvalidIntermediaryActivityId(PvmExecutionImpl execution)
In general, only leaf executions have activity ids.
|
protected static boolean |
isActivityWrappedInMultiInstanceBody(ActivityImpl activity) |
protected static boolean |
isAsync(ActivityImpl activity) |
protected static boolean |
isAsyncJobDefinition(JobDefinitionEntity jobDefinition) |
static boolean |
isCompensationThrowing(PvmExecutionImpl execution) |
static boolean |
isCompensationThrowing(PvmExecutionImpl execution,
Map<ScopeImpl,PvmExecutionImpl> activityExecutionMapping)
Returns true if the given execution is in a compensation-throwing activity but there is no dedicated scope execution
in the given mapping.
|
static boolean |
isConcurrentScope(PvmExecutionImpl propagatingExecution)
Concurrent + scope executions are legacy and could occur in processes with non-interrupting
boundary events or event subprocesses
|
protected static boolean |
isLegacyAsyncAtMultiInstance(PvmExecutionImpl execution)
This returns true only if the provided execution has reached its wait state in a legacy engine version, because
only in that case, it can be async and waiting at the inner activity wrapped by the miBody.
|
protected static boolean |
isLegacyBehaviorRequired(ActivityExecution scopeExecution)
This method
|
protected static boolean |
isMultiInstanceInCompensation(ActivityImpl activity,
PvmExecutionImpl scopeExecutionCandidate) |
static void |
migrateMultiInstanceJobDefinitions(ProcessDefinitionEntity processDefinition,
List<JobDefinitionEntity> jobDefinitions)
When deploying an async job definition for an activity wrapped in an miBody, set the activity id to the
miBody except the wrapped activity is marked as async.
|
static void |
parseCancelBoundaryEvent(ActivityImpl activity) |
static void |
pruneConcurrentScope(PvmExecutionImpl execution)
Prunes a concurrent scope.
|
static void |
removeLegacyNonScopesFromMapping(Map<ScopeImpl,PvmExecutionImpl> mapping)
Remove all entries for legacy non-scopes given that the assigned scope execution is also responsible for another scope
|
static void |
removeLegacySubscriptionOnParent(ExecutionEntity execution,
EventSubscriptionEntity eventSubscription)
Required for migrating active sequential MI receive tasks.
|
static void |
repairMultiInstanceAsyncJob(ExecutionEntity execution)
When executing an async job for an activity wrapped in an miBody, set the execution to the
miBody except the wrapped activity is marked as async.
|
static void |
repairParentRelationships(Collection<ActivityInstanceImpl> values,
String processInstanceId)
This is relevant for
GetActivityInstanceCmd where in case of legacy multi-instance execution trees, the default
algorithm omits multi-instance activity instances. |
static boolean |
signalCancelBoundaryEvent(String signalName)
With prior versions, the boundary event was already executed when compensation was performed; Thus, after
compensation completes, the execution is signalled waiting at the boundary event.
|
protected static <T> boolean |
valuesEqual(T value1,
T value2) |
protected static boolean |
wasNoScope(ActivityImpl activity,
PvmExecutionImpl scopeExecutionCandidate)
Determines whether the given scope was a scope in previous versions
|
protected static boolean |
wasNoScope72(ActivityImpl activity) |
protected static boolean |
wasNoScope73(ActivityImpl activity,
PvmExecutionImpl scopeExecutionCandidate) |
public static void pruneConcurrentScope(PvmExecutionImpl execution)
#createConcurrentScope(PvmExecutionImpl)
.
See: javadoc of this class for note about concurrent scopes.execution
- public static void cancelConcurrentScope(PvmExecutionImpl execution, PvmActivity cancelledScopeActivity)
execution
- the concurrent scope execution to destroycancelledScopeActivity
- the activity that cancels the execution; it must hold that
cancellingActivity's event scope is the scope the execution is responsible forpublic static void destroyConcurrentScope(PvmExecutionImpl execution)
execution
- the execution to destroypublic static boolean eventSubprocessComplete(ActivityExecution scopeExecution)
public static boolean eventSubprocessConcurrentChildExecutionEnded(ActivityExecution scopeExecution, ActivityExecution endedExecution)
public static boolean destroySecondNonScope(PvmExecutionImpl execution)
protected static boolean isLegacyBehaviorRequired(ActivityExecution scopeExecution)
scopeExecution
- public static PvmExecutionImpl getScopeExecution(ScopeImpl scope, Map<ScopeImpl,PvmExecutionImpl> activityExecutionMapping)
scope
- activityExecutionMapping
- protected static void ensureConcurrentScope(PvmExecutionImpl execution)
protected static void ensureConcurrent(PvmExecutionImpl execution)
protected static void ensureScope(PvmExecutionImpl execution)
public static Map<ScopeImpl,PvmExecutionImpl> createActivityExecutionMapping(List<PvmExecutionImpl> scopeExecutions, List<ScopeImpl> scopes)
scopeExecutions
- scopes
- protected static boolean wasNoScope(ActivityImpl activity, PvmExecutionImpl scopeExecutionCandidate)
protected static boolean wasNoScope72(ActivityImpl activity)
protected static boolean wasNoScope73(ActivityImpl activity, PvmExecutionImpl scopeExecutionCandidate)
protected static boolean isMultiInstanceInCompensation(ActivityImpl activity, PvmExecutionImpl scopeExecutionCandidate)
protected static boolean isLegacyAsyncAtMultiInstance(PvmExecutionImpl execution)
public static PvmExecutionImpl determinePropagatingExecutionOnEnd(PvmExecutionImpl propagatingExecution, Map<ScopeImpl,PvmExecutionImpl> activityExecutionMapping)
public static boolean isConcurrentScope(PvmExecutionImpl propagatingExecution)
public static void removeLegacySubscriptionOnParent(ExecutionEntity execution, EventSubscriptionEntity eventSubscription)
Required for migrating active sequential MI receive tasks. These activities were formerly not scope, but are now. This has the following implications:
Before migration:
After migration:
Thus, this method removes the subscription on the miBody scope
protected static boolean areEqualEventSubscriptions(EventSubscriptionEntity subscription1, EventSubscriptionEntity subscription2)
protected static <T> boolean valuesEqual(T value1, T value2)
public static void removeLegacyNonScopesFromMapping(Map<ScopeImpl,PvmExecutionImpl> mapping)
public static void repairParentRelationships(Collection<ActivityInstanceImpl> values, String processInstanceId)
GetActivityInstanceCmd
where in case of legacy multi-instance execution trees, the default
algorithm omits multi-instance activity instances.public static void migrateMultiInstanceJobDefinitions(ProcessDefinitionEntity processDefinition, List<JobDefinitionEntity> jobDefinitions)
protected static boolean isAsync(ActivityImpl activity)
protected static boolean isAsyncJobDefinition(JobDefinitionEntity jobDefinition)
protected static boolean isActivityWrappedInMultiInstanceBody(ActivityImpl activity)
public static void repairMultiInstanceAsyncJob(ExecutionEntity execution)
public static boolean signalCancelBoundaryEvent(String signalName)
public static void parseCancelBoundaryEvent(ActivityImpl activity)
signalCancelBoundaryEvent(String)
public static boolean hasInvalidIntermediaryActivityId(PvmExecutionImpl execution)
In general, only leaf executions have activity ids.
Exception to that rule: compensation throwing executions.
Legacy exception (<= 7.2) to that rule: miBody executions and parallel gateway executions
public static boolean isCompensationThrowing(PvmExecutionImpl execution, Map<ScopeImpl,PvmExecutionImpl> activityExecutionMapping)
public static boolean isCompensationThrowing(PvmExecutionImpl execution)
protected static PvmExecutionImpl findCompensationThrowingAncestorExecution(PvmExecutionImpl execution)
Copyright © 2022. All rights reserved.