Class CaseInstanceHelperImpl
java.lang.Object
org.flowable.cmmn.engine.impl.runtime.CaseInstanceHelperImpl
- All Implemented Interfaces:
CaseInstanceHelper
- Author:
- Joram Barrez, Micha Kiener
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
applyCaseInstanceBuilder
(CmmnEngineConfiguration cmmnEngineConfiguration, CaseInstanceBuilder caseInstanceBuilder, Case caseModel, CaseInstanceEntity caseInstanceEntity, CaseDefinition caseDefinition, StartCaseInstanceBeforeContext instanceBeforeContext, CommandContext commandContext) void
callCaseInstanceStateChangeCallbacks
(CallbackData callbackData) copyHistoricCaseInstanceToRuntime
(HistoricCaseInstance caseInstance) Creates a new case instance within the runtime based on the given historic and ended case instance to be reactivated later on.protected CaseInstanceEntity
copyHistoricCaseInstanceToRuntime
(CommandContext commandContext, CaseDefinition caseDefinition, HistoricCaseInstance caseInstance) This is the first part of reactivating a case instance from the history.protected void
createAsyncInitJob
(CaseInstanceEntity caseInstance, CaseDefinition caseDefinition, Case caseModel, JobService jobService, CommandContext commandContext) protected CaseInstanceEntity
createCaseInstanceEntityFromDefinition
(CommandContext commandContext, CaseDefinition caseDefinition, StartCaseInstanceBeforeContext instanceBeforeContext) protected CaseInstanceEntity
createCaseInstanceEntityFromHistoricCaseInstance
(CommandContext commandContext, HistoricCaseInstance historicCaseInstance) Creates a new runtime case instance based on the given historic one by copying all of its data, but setting its state to active again.protected List<PlanItemInstanceEntity>
createCasePlanItemsFromHistoricCaseInstance
(HistoricCaseInstance historicCaseInstance, CaseInstanceEntity newCaseInstance) Creates new plan item instances for the runtime according the historic ones, even though they are all completed, ended or terminated.protected Map<String,
VariableInstanceEntity> createCaseVariablesFromHistoricCaseInstance
(HistoricCaseInstance historicCaseInstance) Creates new variables in the runtime according the history of the provided case instance.protected CaseDefinition
getCaseDefinition
(CaseInstanceBuilder caseInstanceBuilder, CommandContext commandContext) protected Case
getCaseModel
(CaseDefinition caseDefinition, CmmnModel cmmnModel) protected CmmnModel
getCmmnModel
(CommandContext commandContext, CaseDefinition caseDefinition) protected CaseInstanceEntity
initializeCaseInstanceEntity
(CommandContext commandContext, CaseDefinition caseDefinition, CmmnModel cmmnModel, Case caseModel, CaseInstanceBuilder caseInstanceBuilder) protected boolean
isFormFieldValidationEnabled
(CmmnEngineConfiguration cmmnEngineConfiguration, Stage stage) protected FormInfo
resolveFormInfo
(Stage planModel, CaseDefinition caseDefinition, String tenantId, FormRepositoryService formRepositoryService, CmmnEngineConfiguration cmmnEngineConfiguration) startCaseInstance
(CaseInstanceBuilder caseInstanceBuilder) protected CaseInstanceEntity
startCaseInstance
(CommandContext commandContext, CaseDefinition caseDefinition, CaseInstanceBuilder caseInstanceBuilder) startCaseInstanceAsync
(CaseInstanceBuilder caseInstanceBuilder) protected CaseInstanceEntity
startCaseInstanceAsync
(CommandContext commandContext, CaseDefinition caseDefinition, CaseInstanceBuilder caseInstanceBuilder)
-
Field Details
-
cmmnEngineConfiguration
-
-
Constructor Details
-
CaseInstanceHelperImpl
-
-
Method Details
-
startCaseInstance
- Specified by:
startCaseInstance
in interfaceCaseInstanceHelper
-
startCaseInstanceAsync
- Specified by:
startCaseInstanceAsync
in interfaceCaseInstanceHelper
-
copyHistoricCaseInstanceToRuntime
Description copied from interface:CaseInstanceHelper
Creates a new case instance within the runtime based on the given historic and ended case instance to be reactivated later on. This method only copies all relevant data like the case instance, its plan items and variables to the runtime, but does not further reactivate plan items or trigger the reactivation listener. But it also sets the state of the runtime case instance to active and keeps the historic one in sync.- Specified by:
copyHistoricCaseInstanceToRuntime
in interfaceCaseInstanceHelper
- Parameters:
caseInstance
- the historic case instance to copy back to the runtime- Returns:
- the copied case instance entity added back to the runtime
-
getCaseDefinition
protected CaseDefinition getCaseDefinition(CaseInstanceBuilder caseInstanceBuilder, CommandContext commandContext) -
startCaseInstance
protected CaseInstanceEntity startCaseInstance(CommandContext commandContext, CaseDefinition caseDefinition, CaseInstanceBuilder caseInstanceBuilder) -
startCaseInstanceAsync
protected CaseInstanceEntity startCaseInstanceAsync(CommandContext commandContext, CaseDefinition caseDefinition, CaseInstanceBuilder caseInstanceBuilder) -
copyHistoricCaseInstanceToRuntime
protected CaseInstanceEntity copyHistoricCaseInstanceToRuntime(CommandContext commandContext, CaseDefinition caseDefinition, HistoricCaseInstance caseInstance) This is the first part of reactivating a case instance from the history. It copies the historic data back to the runtime which is the case instance, its plan items and the variables. This method does not trigger the reactivation listener, just checks, if it is there, but there is no reactivation of plan items, etc. Just the copy of the historic data back to the runtime.- Parameters:
commandContext
- the command context to execute withincaseDefinition
- the case definition to get the case model fromcaseInstance
- the historic case instance to copy back to the runtime- Returns:
- the copied runtime case instance entity for further processing
-
createAsyncInitJob
protected void createAsyncInitJob(CaseInstanceEntity caseInstance, CaseDefinition caseDefinition, Case caseModel, JobService jobService, CommandContext commandContext) -
getCmmnModel
-
getCaseModel
-
initializeCaseInstanceEntity
protected CaseInstanceEntity initializeCaseInstanceEntity(CommandContext commandContext, CaseDefinition caseDefinition, CmmnModel cmmnModel, Case caseModel, CaseInstanceBuilder caseInstanceBuilder) -
applyCaseInstanceBuilder
protected void applyCaseInstanceBuilder(CmmnEngineConfiguration cmmnEngineConfiguration, CaseInstanceBuilder caseInstanceBuilder, Case caseModel, CaseInstanceEntity caseInstanceEntity, CaseDefinition caseDefinition, StartCaseInstanceBeforeContext instanceBeforeContext, CommandContext commandContext) -
resolveFormInfo
protected FormInfo resolveFormInfo(Stage planModel, CaseDefinition caseDefinition, String tenantId, FormRepositoryService formRepositoryService, CmmnEngineConfiguration cmmnEngineConfiguration) -
isFormFieldValidationEnabled
protected boolean isFormFieldValidationEnabled(CmmnEngineConfiguration cmmnEngineConfiguration, Stage stage) -
createCaseInstanceEntityFromDefinition
protected CaseInstanceEntity createCaseInstanceEntityFromDefinition(CommandContext commandContext, CaseDefinition caseDefinition, StartCaseInstanceBeforeContext instanceBeforeContext) -
createCaseInstanceEntityFromHistoricCaseInstance
protected CaseInstanceEntity createCaseInstanceEntityFromHistoricCaseInstance(CommandContext commandContext, HistoricCaseInstance historicCaseInstance) Creates a new runtime case instance based on the given historic one by copying all of its data, but setting its state to active again. Plan items as well as variables are copied to the runtime as well. The historic instance is reflecting the same state as well as it is no longer terminated.- Parameters:
commandContext
- the command context to execute withinhistoricCaseInstance
- the historic case instance to be copied back to the runtime- Returns:
- the newly created runtime case instance, initialized from the historic one
-
createCasePlanItemsFromHistoricCaseInstance
protected List<PlanItemInstanceEntity> createCasePlanItemsFromHistoricCaseInstance(HistoricCaseInstance historicCaseInstance, CaseInstanceEntity newCaseInstance) Creates new plan item instances for the runtime according the historic ones, even though they are all completed, ended or terminated. Later on, they might be reactivated according the case model, but this is not part of this method.- Parameters:
historicCaseInstance
- the historic case instance to copy the plan items fromnewCaseInstance
- the newly created runtime copy of the historic case instance where the new plan items are attached to- Returns:
- the list of newly copied plan item instances in the runtime
-
createCaseVariablesFromHistoricCaseInstance
protected Map<String,VariableInstanceEntity> createCaseVariablesFromHistoricCaseInstance(HistoricCaseInstance historicCaseInstance) Creates new variables in the runtime according the history of the provided case instance.- Parameters:
historicCaseInstance
- the historic case instance to copy its variables back to the runtime- Returns:
- the map of the created variables
-
callCaseInstanceStateChangeCallbacks
- Specified by:
callCaseInstanceStateChangeCallbacks
in interfaceCaseInstanceHelper
-