Class CaseInstanceHelperImpl

    • Constructor Detail

    • Method Detail

      • copyHistoricCaseInstanceToRuntime

        public CaseInstanceEntity copyHistoricCaseInstanceToRuntime​(HistoricCaseInstance caseInstance)
        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 interface CaseInstanceHelper
        Parameters:
        caseInstance - the historic case instance to copy back to the runtime
        Returns:
        the copied case instance entity added back to the runtime
      • 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 within
        caseDefinition - the case definition to get the case model from
        caseInstance - the historic case instance to copy back to the runtime
        Returns:
        the copied runtime case instance entity for further processing
      • getCmmnModel

        protected org.flowable.cmmn.model.CmmnModel getCmmnModel​(CommandContext commandContext,
                                                                 CaseDefinition caseDefinition)
      • getCaseModel

        protected org.flowable.cmmn.model.Case getCaseModel​(CaseDefinition caseDefinition,
                                                            org.flowable.cmmn.model.CmmnModel cmmnModel)
      • isFormFieldValidationEnabled

        protected boolean isFormFieldValidationEnabled​(CmmnEngineConfiguration cmmnEngineConfiguration,
                                                       org.flowable.cmmn.model.Stage stage)
      • 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 within
        historicCaseInstance - 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 from
        newCaseInstance - 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