Class AbstractMovePlanItemInstanceToTerminalStateOperation
java.lang.Object
org.flowable.cmmn.engine.impl.agenda.operation.CmmnOperation
org.flowable.cmmn.engine.impl.agenda.operation.AbstractPlanItemInstanceOperation
org.flowable.cmmn.engine.impl.agenda.operation.AbstractChangePlanItemInstanceStateOperation
org.flowable.cmmn.engine.impl.agenda.operation.AbstractMovePlanItemInstanceToTerminalStateOperation
- All Implemented Interfaces:
Runnable
- Direct Known Subclasses:
CompletePlanItemInstanceOperation,ExitPlanItemInstanceOperation,OccurPlanItemInstanceOperation,TerminatePlanItemInstanceOperation
public abstract class AbstractMovePlanItemInstanceToTerminalStateOperation
extends AbstractChangePlanItemInstanceStateOperation
Operation that moves a given
PlanItemInstance to a terminal state (completed, terminated or failed).- Author:
- Joram Barrez, Filip Hrisafov, Micha Kiener
-
Field Summary
Fields inherited from class org.flowable.cmmn.engine.impl.agenda.operation.AbstractPlanItemInstanceOperation
planItemInstanceEntityFields inherited from class org.flowable.cmmn.engine.impl.agenda.operation.CmmnOperation
commandContext, isNoop -
Constructor Summary
ConstructorsConstructorDescriptionAbstractMovePlanItemInstanceToTerminalStateOperation(CommandContext commandContext, PlanItemInstanceEntity planItemInstanceEntity) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaggregateVariablesForAllInstances(PlanItemInstanceEntity planItemInstanceEntity, VariableAggregationDefinitions aggregations) protected voidaggregateVariablesForSingleInstance(PlanItemInstanceEntity planItemInstanceEntity, VariableAggregationDefinitions aggregations) protected voidexitChildPlanItemInstances(String parentTransition, String exitCriterionId, String exitEventType) Exits (terminates) all child plan items of the current one (e.g.protected VariableAggregationDefinitionsbooleanhasMaxInstanceCount(PlanItem planItem) booleanhasRepetitionOnCollection(PlanItem planItem) booleanhasRepetitionRule(PlanItem planItem) booleanhasRepetitionRuleAndNoEntryCriteria(PlanItem planItem) Returns true, if the given plan item has a repetition rule, but no entry criteria to be satisfied and no collection based repetition.booleanhasRepetitionRuleEntryCriteria(PlanItem planItem) protected abstract voidImplementing classes should be aware that unlike extending from AbstractChangePlanItemInstanceStateOperation, this method will be executed just before the deleting the entityprotected booleanisAsyncLeave(PlanItemInstanceEntity planItemInstanceEntity, PlanItemDefinition planItemDefinition) abstract booleanbooleanisRepeatingOnDelete(String originalState, String newState) booleanisWaitingForRepetitionPlanItemInstanceExists(PlanItemInstanceEntity planItemInstanceEntity) booleanisWithoutStageOrParentIsNotTerminated(PlanItemInstanceEntity planItemInstanceEntity) protected StringresolveEventDefinitionKey(String eventType, PlanItemInstanceEntity planItemInstanceEntity, CmmnEngineConfiguration cmmnEngineConfiguration) voidrun()protected abstract booleanWhether multi aggregation needs to be done.protected abstract booleanWhether variable aggregation should be done when a single instance completes.Methods inherited from class org.flowable.cmmn.engine.impl.agenda.operation.AbstractChangePlanItemInstanceStateOperation
abortOperationIfNewStateEqualsOldState, createPlanItemLifeCycleEvent, getLifeCycleTransition, getNewState, getOperationName, isStateNotChanged, onPlanned, toStringMethods inherited from class org.flowable.cmmn.engine.impl.agenda.operation.AbstractPlanItemInstanceOperation
getCaseInstanceId, getCurrentTime, getPlanItemInstanceEntity, removeSentryRelatedData, setPlanItemInstanceEntityMethods inherited from class org.flowable.cmmn.engine.impl.agenda.operation.CmmnOperation
childPlanItemInstanceForPlanItemExists, createPlanItemInstanceIfNeeded, createPlanItemInstancesForNewOrReactivatedStage, evaluateReactivationCondition, evaluateReactivationRule, getCaseInstance, getPlanItemCreationOrReactivationType, getPlanModel, getStage, isEventListenerWithAvailableCondition, isNoop, isStage, markAsNoop, setRepetitionCounter
-
Constructor Details
-
AbstractMovePlanItemInstanceToTerminalStateOperation
public AbstractMovePlanItemInstanceToTerminalStateOperation(CommandContext commandContext, PlanItemInstanceEntity planItemInstanceEntity)
-
-
Method Details
-
run
public void run()- Specified by:
runin interfaceRunnable- Overrides:
runin classAbstractChangePlanItemInstanceStateOperation
-
isAsyncLeave
protected boolean isAsyncLeave(PlanItemInstanceEntity planItemInstanceEntity, PlanItemDefinition planItemDefinition) -
getVariableAggregations
-
resolveEventDefinitionKey
protected String resolveEventDefinitionKey(String eventType, PlanItemInstanceEntity planItemInstanceEntity, CmmnEngineConfiguration cmmnEngineConfiguration) -
internalExecute
protected abstract void internalExecute()Implementing classes should be aware that unlike extending from AbstractChangePlanItemInstanceStateOperation, this method will be executed just before the deleting the entity- Specified by:
internalExecutein classAbstractChangePlanItemInstanceStateOperation
-
isRepeatingOnDelete
-
isWithoutStageOrParentIsNotTerminated
-
hasRepetitionRuleAndNoEntryCriteria
Returns true, if the given plan item has a repetition rule, but no entry criteria to be satisfied and no collection based repetition. A collection based repetition is similar to entry criteria as it needs to be available in order to repeat the plan item.- Parameters:
planItem- the plan item to test- Returns:
- true, if the plan item has a repetition rule without any conditions like entry criteria or a collection to be based on for repetition
-
hasRepetitionOnCollection
-
hasMaxInstanceCount
-
hasRepetitionRuleEntryCriteria
-
hasRepetitionRule
-
isWaitingForRepetitionPlanItemInstanceExists
public boolean isWaitingForRepetitionPlanItemInstanceExists(PlanItemInstanceEntity planItemInstanceEntity) -
exitChildPlanItemInstances
protected void exitChildPlanItemInstances(String parentTransition, String exitCriterionId, String exitEventType) Exits (terminates) all child plan items of the current one (e.g. if the current one is a stage or plan model) on a terminate or complete transition of the parent as in this case, child plan items not being in an ending state must also be terminated. Depending on the plan item behavior, it might be delegated to the behavior or the default one is to simply exit the child plan item as well.- Parameters:
parentTransition- the transition of the parent plan item to an ending state as it might have an impact on how to end the child plan itemexitCriterionId- the optional exit criterion being triggered on the parent to end it, might be nullexitEventType- the optional exit event type, if an exit sentry was triggered, as it might have an impact on the child ending as well
-
aggregateVariablesForSingleInstance
protected void aggregateVariablesForSingleInstance(PlanItemInstanceEntity planItemInstanceEntity, VariableAggregationDefinitions aggregations) -
aggregateVariablesForAllInstances
protected void aggregateVariablesForAllInstances(PlanItemInstanceEntity planItemInstanceEntity, VariableAggregationDefinitions aggregations) -
shouldAggregateForSingleInstance
protected abstract boolean shouldAggregateForSingleInstance()Whether variable aggregation should be done when a single instance completes. This does not need to check whether the plan item instance has variable aggregations, that is the same for all instances. e.g. When an instance completes normally we should aggregate the data, but if it terminates we shouldn't -
shouldAggregateForMultipleInstances
protected abstract boolean shouldAggregateForMultipleInstances()Whether multi aggregation needs to be done. This does not need to check whether the plan item instance has variable aggregations, that is the same for all instances. e.g. Multi aggregation needs to be done when we do a normal completion, but not when the plan items are terminated -
isEvaluateRepetitionRule
public abstract boolean isEvaluateRepetitionRule() -
getAsyncLeaveTransitionMetadata
-