public abstract class CmmnOperation extends Object implements Runnable
| Modifier and Type | Field and Description |
|---|---|
protected CommandContext |
commandContext |
protected boolean |
isNoop |
| Constructor and Description |
|---|
CmmnOperation() |
CmmnOperation(CommandContext commandContext) |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
childPlanItemInstanceForPlanItemExists(PlanItemInstanceContainer planItemInstanceContainer,
PlanItem planItem) |
protected void |
createPlanItemInstanceIfNeeded(CommandContext commandContext,
PlanItem planItem,
Case caseModel,
CaseInstanceEntity caseInstanceEntity,
PlanItemInstanceEntity stagePlanItemInstanceEntity,
String tenantId,
List<PlanItemInstanceEntity> newPlanItemInstances)
Checks whether the provided plan item needs an instance to be created and optionally activated directly (e.g.
|
protected List<PlanItemInstanceEntity> |
createPlanItemInstancesForNewOrReactivatedStage(CommandContext commandContext,
Case caseModel,
List<PlanItem> planItems,
List<PlanItem> directlyReactivatedPlanItems,
CaseInstanceEntity caseInstanceEntity,
PlanItemInstanceEntity stagePlanItemInstanceEntity,
String tenantId)
Creates child plan items for the provided stage, might also be the root plan model.
|
protected Boolean |
evaluateReactivationCondition(String condition,
CaseInstanceEntity caseInstanceEntity,
VariableContainer parentPlanItemInstance)
Evaluates the provided reactivation condition, which might also be null or a constant like "true".
|
protected PlanItemCreationType |
evaluateReactivationRule(ReactivationRule reactivationRule,
CaseInstanceEntity caseInstanceEntity,
VariableContainer parentPlanItemInstance)
Evaluates the provided reactivation rule for a matching rule and returns its creation type, if at least one was matching.
|
abstract String |
getCaseInstanceId() |
protected PlanItemCreationType |
getPlanItemCreationOrReactivationType(CaseInstanceEntity caseInstanceEntity,
Case caseModel,
PlanItem planItem,
VariableContainer parentPlanItemInstance)
Evaluates the reactivation rule for the provided plan item, if the case is a reactivated one, otherwise the creation type will always be default.
|
Stage |
getPlanModel(CaseInstanceEntity caseInstanceEntity) |
protected Stage |
getStage(PlanItemInstanceEntity planItemInstanceEntity) |
boolean |
isEventListenerWithAvailableCondition(PlanItem planItem) |
boolean |
isNoop() |
boolean |
isStage(PlanItemInstanceEntity planItemInstanceEntity) |
void |
markAsNoop() |
protected void |
setRepetitionCounter(PlanItemInstanceEntity repeatingPlanItemInstanceEntity,
int counterValue) |
protected CommandContext commandContext
protected boolean isNoop
public CmmnOperation()
public CmmnOperation(CommandContext commandContext)
public abstract String getCaseInstanceId()
protected Stage getStage(PlanItemInstanceEntity planItemInstanceEntity)
public boolean isStage(PlanItemInstanceEntity planItemInstanceEntity)
public Stage getPlanModel(CaseInstanceEntity caseInstanceEntity)
protected List<PlanItemInstanceEntity> createPlanItemInstancesForNewOrReactivatedStage(CommandContext commandContext, Case caseModel, List<PlanItem> planItems, List<PlanItem> directlyReactivatedPlanItems, CaseInstanceEntity caseInstanceEntity, PlanItemInstanceEntity stagePlanItemInstanceEntity, String tenantId)
commandContext - the command context to run this method withcaseModel - the case model the given stage or plan model is contained withinplanItems - the plan items of the stage to be checked for creationdirectlyReactivatedPlanItems - an optional list of plan items already having been reactivated as part of phase 1 of a case reactivation, might be
null or empty, specially for a regular casecaseInstanceEntity - the case instance entity, must be provided as it is used to check for a first time running case or a reactivated onestagePlanItemInstanceEntity - the optional stage plan item instance, if already available, might be null in very specific use cases (e.g. cross-stage activities, etc)tenantId - the id of the tenant to run withinprotected void createPlanItemInstanceIfNeeded(CommandContext commandContext, PlanItem planItem, Case caseModel, CaseInstanceEntity caseInstanceEntity, PlanItemInstanceEntity stagePlanItemInstanceEntity, String tenantId, List<PlanItemInstanceEntity> newPlanItemInstances)
commandContext - the command context in which this method runsplanItem - the plan item to check for an item creationcaseModel - the case model used to get the creation modecaseInstanceEntity - the case entity used to check, if it is a reactivated onestagePlanItemInstanceEntity - the stage the plan item belongs totenantId - the id of the tenant the case belongs tonewPlanItemInstances - the array where the new plan item instance will be added, if it was createdprotected boolean childPlanItemInstanceForPlanItemExists(PlanItemInstanceContainer planItemInstanceContainer, PlanItem planItem)
public boolean isEventListenerWithAvailableCondition(PlanItem planItem)
protected void setRepetitionCounter(PlanItemInstanceEntity repeatingPlanItemInstanceEntity, int counterValue)
protected PlanItemCreationType getPlanItemCreationOrReactivationType(CaseInstanceEntity caseInstanceEntity, Case caseModel, PlanItem planItem, VariableContainer parentPlanItemInstance)
caseInstanceEntity - the case instance to check for a reactivated casecaseModel - the case model to obtain the reactivation listenerplanItem - the plan item to be evaluated for creation typeparentPlanItemInstance - the parent plan item (e.g. stage or plan model) of the plan itemprotected PlanItemCreationType evaluateReactivationRule(ReactivationRule reactivationRule, CaseInstanceEntity caseInstanceEntity, VariableContainer parentPlanItemInstance)
reactivationRule - the reactivation rule to evaluate against the given context of either the parent plan item instance or the case instance itselfcaseInstanceEntity - the case instance which must not be nullparentPlanItemInstance - the optional parent plan item instance (e.g. stage or plan model), if already existing, might be nullprotected Boolean evaluateReactivationCondition(String condition, CaseInstanceEntity caseInstanceEntity, VariableContainer parentPlanItemInstance)
condition - the condition to be evaluated, might be null or a constant like "true"caseInstanceEntity - the case instance to be used as the expression context, if the parent plan item is not yet available (null)parentPlanItemInstance - the optional parent plan item to be used as the expression evaluation contextpublic void markAsNoop()
public boolean isNoop()
Copyright © 2023 Flowable. All rights reserved.