org.camunda.bpm.engine.impl.cmmn.execution.CmmnActivityExecution Maven / Gradle / Ivy
/*
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
* under one or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information regarding copyright
* ownership. Camunda licenses this file to you under the Apache License,
* Version 2.0; you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.camunda.bpm.engine.impl.cmmn.execution;
import java.util.List;
import org.camunda.bpm.engine.ProcessEngineException;
import org.camunda.bpm.engine.delegate.DelegateCaseExecution;
import org.camunda.bpm.engine.exception.cmmn.CaseIllegalStateTransitionException;
import org.camunda.bpm.engine.impl.cmmn.model.CmmnActivity;
import org.camunda.bpm.engine.impl.cmmn.model.CmmnCaseDefinition;
import org.camunda.bpm.engine.impl.pvm.PvmProcessDefinition;
import org.camunda.bpm.engine.impl.pvm.PvmProcessInstance;
import org.camunda.bpm.engine.impl.task.TaskDecorator;
import org.camunda.bpm.engine.runtime.CaseInstance;
import org.camunda.bpm.engine.runtime.ProcessInstance;
import org.camunda.bpm.model.cmmn.instance.CaseTask;
import org.camunda.bpm.model.cmmn.instance.EventListener;
import org.camunda.bpm.model.cmmn.instance.HumanTask;
import org.camunda.bpm.model.cmmn.instance.IfPart;
import org.camunda.bpm.model.cmmn.instance.Milestone;
import org.camunda.bpm.model.cmmn.instance.PlanItemOnPart;
import org.camunda.bpm.model.cmmn.instance.ProcessTask;
import org.camunda.bpm.model.cmmn.instance.Sentry;
import org.camunda.bpm.model.cmmn.instance.Stage;
import org.camunda.bpm.model.cmmn.instance.Task;
import org.camunda.bpm.model.cmmn.instance.UserEventListener;
/**
* @author Roman Smirnov
*
*/
public interface CmmnActivityExecution extends DelegateCaseExecution {
/**
* Returns the parent of this
case execution, or null
* if there is no parent.
* @return a {@link CmmnActivityExecution parent} or null.
*/
CmmnActivityExecution getParent();
/**
* Returns true
if this
case execution
* is a case instance. If this
case execution is not a
* case instance then false
will be returned.
*
* @return whether this
case execution is a case instance or not.
*/
boolean isCaseInstanceExecution();
/**
* Returns the {@link CaseExecutionState current state} of this
* case execution.
*
* @return the {@link CaseExecutionState current state}
*/
CaseExecutionState getCurrentState();
/**
* Sets the given {@link CaseExecutionState state} as the
* current state of this
case execution.
*
* @param currentState the current state to set
*/
void setCurrentState(CaseExecutionState currentState);
/**
* Returns the {@link CaseExecutionState previous state} of this
* case execution.
*
* @return the {@link CaseExecutionState previous state}
*/
CaseExecutionState getPreviousState();
/**
* Returns true
iff:
* {@link #getCurrentState()} == {@link CaseExecutionState#NEW}
*
*
* @return whether this
case execution has as current state {@link CaseExecutionState#NEW}
*/
boolean isNew();
/**
* Returns true
iff:
* {@link #getCurrentState()} == {@link CaseExecutionState#TERMINATING_ON_TERMINATION}
* || {@link #getCurrentState()} == {@link CaseExecutionState#TERMINATING_ON_PARENT_TERMINATION}
* || {@link #getCurrentState()} == {@link CaseExecutionState#TERMINATING_ON_EXIT}
*
*
* @return whether this
case execution has as current state {@link CaseExecutionState#TERMINATING_ON_TERMINATION},
* {@link CaseExecutionState#TERMINATING_ON_PARENT_TERMINATION} or {@link CaseExecutionState#TERMINATING_ON_EXIT}
*/
boolean isTerminating();
/**
* Returns true
iff:
* {@link #getCurrentState()} == {@link CaseExecutionState#SUSPENDING_ON_SUSPENSION}
* || {@link #getCurrentState()} == {@link CaseExecutionState#SUSPENDING_ON_PARENT_SUSPENSION}
*
*
* @return whether this
case execution has as current state
* {@link CaseExecutionState#SUSPENDING_ON_SUSPENSION} or {@link CaseExecutionState#SUSPENDING_ON_PARENT_SUSPENSION}
*/
boolean isSuspending();
/**
* Returns the {@link CmmnActivity activity} which is associated with
* this
case execution.
*
* @return the associated {@link CmmnActivity activity}
*/
CmmnActivity getActivity();
/**
*
Creates new child case executions for each given {@link CmmnActivity}.
*
* Afterwards the method {@link #triggerChildExecutionsLifecycle(List)} must be called
* to execute each created case executions (ie. the create listener will be
* notified etc.).
*
* According to the CMMN 1.0 specification:
* This method can be called when this
case execution (which
* represents a {@link Stage}) transitions to ACTIVE
state.
* The passed collection of {@link CmmnActivity activities} are the planned
* items that should be executed in this {@link Stage}. So that for each
* given {@link CmmnActivity} a new case execution will be instantiated.
* Furthermore for each created child execution there happens a transition
* to the initial state AVAILABLE
.
*
*
* @param activities a collection of {@link CmmnActivity activities} of planned items
* to execute inside this
case execution
*/
List createChildExecutions(List activities);
/**
* This method triggers for each given case execution the lifecycle.
*
* This method must be called after {@link #createChildExecutions(List)}.
*
* @param children a collection of {@link CmmnExecution case execution} to
* trigger for each given case execution the lifecycle
*/
void triggerChildExecutionsLifecycle(List children);
/**
* Transition to {@link CaseExecutionState#ENABLED} state.
*
* This
case execution must be in {@link CaseExecutionState#AVAILABLE}
* state to be able to do this transition.
*
* It is only possible to enable a case execution which is associated with a
* {@link Stage} or {@link Task}.
*
* @throws CaseIllegalStateTransitionException will be thrown, if this
case execution
* is not {@link CaseExecutionState#AVAILABLE}.
* @throws ProcessEngineException when an internal exception happens during the execution
* of the command.
*/
void enable();
/**
* Transition to state.
*
* This
case execution must be in {@link CaseExecutionState#ENABLED}
* state to be able to do this transition.
*
* It is only possible to disable a case execution which is associated with a
* {@link Stage} or {@link Task}.
*
* If this
case execution has a parent case execution, that parent
* case execution will be notified that this
case execution has been
* disabled. This can lead to a completion of the parent case execution, for more
* details when the parent case execution can be completed see {@link #complete()}.
*
* @throws CaseIllegalStateTransitionException will be thrown, if this
case execution
* is not {@link CaseExecutionState#ENABLED}.
* @throws ProcessEngineException when an internal exception happens during the execution
* of the command.
*/
void disable();
/**
* Transition to {@link CaseExecutionState#ENABLED} state.
*
* This
case execution must be in {@link CaseExecutionState#DISABLED}
* state to be able to do this transition.
*
* It is only possible to re-enable a case execution which is associated with a
* {@link Stage} or {@link Task}.
*
* @throws CaseIllegalStateTransitionException will be thrown, if this
case execution
* is not {@link CaseExecutionState#DISABLED}.
* @throws ProcessEngineException when an internal exception happens during the execution
* of the command.
*/
void reenable();
/**
* Transition to {@link CaseExecutionState#ACTIVE} state.
*
* This
case execution must be in {@link CaseExecutionState#ENABLED}
* state to be able to do this transition.
*
* It is only possible to start a case execution manually which is associated with a
* {@link Stage} or {@link Task}.
*
* @throws CaseIllegalStateTransitionException will be thrown, if this
case execution
* is not {@link CaseExecutionState#ENABLED}.
* @throws ProcessEngineException when an internal exception happens during the execution
* of the command.
*/
void manualStart();
/**
* Transition to {@link CaseExecutionState#ACTIVE} state.
*
* This
case execution must be in {@link CaseExecutionState#AVAILABLE}
* state to be able to do this transition.
*
* It is only possible to start a case execution which is associated with a
* {@link Stage} or {@link Task}.
*
* @throws CaseIllegalStateTransitionException will be thrown, if this
case execution
* is not {@link CaseExecutionState#AVAILABLE}.
* @throws ProcessEngineException when an internal exception happens during the execution
* of the command.
*/
void start();
/**
* Transition to {@link CaseExecutionState#COMPLETED} state.
*
* This
case execution must be in {@link CaseExecutionState#ACTIVE}
* state to be able to do this transition.
*
* It is only possible to complete a case execution which is associated with a
* {@link Stage} or {@link Task}.
*
* If this
case execution has a parent case execution, that parent
* case execution will be notified that this
case execution has been
* completed. This can lead to a completion of the parent case execution, for more
* details when the parent case execution can be completed see {@link #complete()}.
*
* In case of a {@link Stage} the completion can only be performed when the following
* criteria are fulfilled:
*
* - there are no children in the state {@link CaseExecutionState#ACTIVE} or {@link CaseExecutionState#NEW}
* - if the property
autoComplete
of the associated {@link Stage} is set to true
:
*
* - all required (
requiredRule
evaluates to true
) children are in state
*
* - {@link CaseExecutionState#DISABLED}
* - {@link CaseExecutionState#COMPLETED}
* - {@link CaseExecutionState#TERMINATED}
* - {@link CaseExecutionState#FAILED}
*
*
*
*
* - if the property
autoComplete
of the associated {@link Stage} is set to false
:
*
* - all children are in
*
* - {@link CaseExecutionState#DISABLED}
* - {@link CaseExecutionState#COMPLETED}
* - {@link CaseExecutionState#TERMINATED}
* - {@link CaseExecutionState#FAILED}
*
*
*
*
*
*
*
* For a {@link Task} instance, this means its purpose has been accomplished:
*
* - {@link HumanTask} have been completed by human.
* - {@link CaseTask} have launched a new {@link CaseInstance} and if output parameters
* are required and/or the property
isBlocking
is set to true
,
* then the launched {@link CaseInstance} has completed and returned the
* output parameters.
* - {@link ProcessTask} have launched a new {@link ProcessInstance} and if output parameters
* are required and/or the property
isBlocking
is set to true
,
* then the launched {@link ProcessInstance} has completed and returned the
* output parameters.
*
*
*
* @throws CaseIllegalStateTransitionException will be thrown, if this
case execution
* is not {@link CaseExecutionState#ACTIVE} or when the case execution cannot be
* completed.
* @throws ProcessEngineException when an internal exception happens during the execution
* of the command.
*/
void complete();
/**
* Transition to {@link CaseExecutionState#COMPLETED} state.
*
* This
case execution must be in {@link CaseExecutionState#ACTIVE}
* state to be able to do this transition.
*
* It is only possible to complete a case execution manually which is associated with a
* {@link Stage} or {@link Task}.
*
* If this
case execution has a parent case execution, that parent
* case execution will be notified that this
case execution has been
* completed. This can lead to a completion of the parent case execution, for more
* details when the parent case execution can be completed see {@link #complete()}.
*
* In case of a {@link Stage} the completion can only be performed when the following
* criteria are fulfilled:
*
* - there are no children in the state {@link CaseExecutionState#ACTIVE} or {@link CaseExecutionState#NEW}
* - all required (
requiredRule
evaluates to true
) children are in state
*
* - {@link CaseExecutionState#DISABLED}
* - {@link CaseExecutionState#COMPLETED}
* - {@link CaseExecutionState#TERMINATED}
* - {@link CaseExecutionState#FAILED}
*
*
*
*
*
* For a {@link Task} instance, this means its purpose has been accomplished:
*
* - {@link HumanTask} have been completed by human.
*
*
*
* @throws CaseIllegalStateTransitionException will be thrown, if this
case execution
* is not {@link CaseExecutionState#ACTIVE} or when the case execution cannot be
* completed.
* @throws ProcessEngineException when an internal exception happens during the execution
* of the command.
*/
void manualComplete();
/**
* Transition to {@link CaseExecutionState#COMPLETED} state.
*
* This
case execution must be in {@link CaseExecutionState#AVAILABLE}
* state to be able to do this transition.
*
* For {@link EventListener event listener} transitions when the event being listened by the
* {@link EventListener event listener} instance does occur. For a {@link UserEventListener user event
* listener} instance this transition happens when a human decides to raise the event.
*
* For {@link Milestone} instance transitions when one of the achieving {@link Sentry sentries}
* (entry criteria) is satisfied.
*
* If this
case execution has a parent case execution, that parent
* case execution will be notified that this
case execution has been
* completed (ie.the event or milestone occured). This can lead to a completion of
* the parent case execution, for more details when the parent case execution can
* be completed see {@link #complete()}.
*
* @throws CaseIllegalStateTransitionException will be thrown, if this
case execution
* is not {@link CaseExecutionState#AVAILABLE}.
* @throws ProcessEngineException when an internal exception happens during the execution
* of the command.
*/
void occur();
/**
* Transition to {@link CaseExecutionState#TERMINATING_ON_TERMINATION} state.
*
* If this
case execution is associated with a {@link Stage} or
* {@link Task}, then this
case execution must be in {@link CaseExecutionState#ACTIVE}
* state to be able to do this transition.
* And if this
case execution is association with {@link EventListener EventListener}
* or a {@link Milestone}, then this
case execution must be in
* {@link CaseExecutionState#AVAILABLE} state to be able to do this transition.
*
* For a {@link Stage} instance the termination of this
case execution
* will be propagated down to all its contained {@link EventListener EventListener}, {@link Milestone},
* {@link Stage}, and {@link Task} instances.
*
* In case of a {@link Stage} this corresponding case execution stays in this state until
* all children notified this case execution, that they terminated successfully. Afterwards the
* method {@link #performTerminate()} must be called to complete the transition into the state
* {@link CaseExecutionState#TERMINATED}.
*
* @throws CaseIllegalStateTransitionException will be thrown, if this
case execution
* is not in the expected state.
* @throws ProcessEngineException when an internal exception happens during the execution
* of the command.
*/
void terminate();
/**
* Transition to {@link CaseExecutionState#TERMINATED} state.
*
* If this
case execution has a parent case execution, that parent
* case execution will be notified that this
case execution has been
* terminated. This can lead to a completion of the parent case execution, for more
* details when the parent case execution can be completed see {@link #complete()}.
*
* @throws CaseIllegalStateTransitionException will be thrown, if this
case execution
* is not in the expected state.
* @throws ProcessEngineException when an internal exception happens during the execution
* of the command.
*/
void performTerminate();
/**
* Transition to {@link CaseExecutionState#TERMINATING_ON_PARENT_TERMINATION} state.
*
* This
case execution must be in {@link CaseExecutionState#AVAILABLE}
* or {@link CaseExecutionState#SUSPENDED} state to be able to do this transition.
*
* It is only possible to execute a parent termination on a case execution which is
* associated with a {@link EventListener} or {@link Milestone}.
*
* Afterwards the method {@link #performParentTerminate()} must be called to complete
* the transition into the state {@link CaseExecutionState#TERMINATED}.
*
* @throws CaseIllegalStateTransitionException will be thrown, if this
case execution
* is not in the expected state.
* @throws ProcessEngineException when an internal exception happens during the execution
* of the command.
*/
void parentTerminate();
/**
* Transition to {@link CaseExecutionState#TERMINATED} state.
*
* This
case execution must be in {@link CaseExecutionState#AVAILABLE}
* or {@link CaseExecutionState#SUSPENDED} state to be able to do this transition.
*
* It is only possible to execute a parent termination on a case execution which is
* associated with a {@link EventListener} or {@link Milestone}.
*
* @throws CaseIllegalStateTransitionException will be thrown, if this
case execution
* is not in the expected state.
* @throws ProcessEngineException when an internal exception happens during the execution
* of the command.
*/
void performParentTerminate();
/**
* Transition to {@link CaseExecutionState#TERMINATING_ON_EXIT} state.
*
* This
case execution must be in one of the following state to
* be able to do this transition:
*
* - {@link CaseExecutionState#AVAILABLE},
* - {@link CaseExecutionState#ENABLED},
* - {@link CaseExecutionState#DISABLED},
* - {@link CaseExecutionState#ACTIVE},
* - {@link CaseExecutionState#SUSPENDED} or
* - {@link CaseExecutionState#FAILED}
*
*
* It is only possible to execute an exit on a case execution which is
* associated with a {@link Stage} or {@link Task}.
*
* Afterwards the method {@link #performExit()} must be called to complete
* the transition into the state {@link CaseExecutionState#TERMINATED}.
*
* If this transition is triggered by a fulfilled exit criteria and if
* this
case execution has a parent case execution, that parent
* case execution will be notified that this
case execution has been
* terminated. This can lead to a completion of the parent case execution, for more
* details when the parent case execution can be completed see {@link #complete()}.
*
* @throws CaseIllegalStateTransitionException will be thrown, if this
case execution
* is not in the expected state.
* @throws ProcessEngineException when an internal exception happens during the execution
* of the command.
*/
void exit();
/**
* Transition to {@link CaseExecutionState#TERMINATED} state.
*
* @throws ProcessEngineException when an internal exception happens during the execution
* of the command.
*/
void parentComplete();
/**
* Transition to {@link CaseExecutionState#TERMINATED} state.
*
* This can lead to a completion of the parent case execution, for more
* details when the parent case execution can be completed see {@link #complete()}.
*
* @throws CaseIllegalStateTransitionException will be thrown, if this
case execution
* is not in the expected state.
* @throws ProcessEngineException when an internal exception happens during the execution
* of the command.
*/
void performExit();
/**
* Transition to {@link CaseExecutionState#SUSPENDING_ON_SUSPENSION} state.
*
* If this
case execution is associated with a {@link Stage} or
* {@link Task}, then this
case execution must be in {@link CaseExecutionState#ACTIVE}
* state to be able to do this transition.
* And if this
case execution is association with {@link EventListener EventListener}
* or a {@link Milestone}, then this
case execution must be in
* {@link CaseExecutionState#AVAILABLE} state to be able to do this transition.
*
* For a {@link Stage} instance the suspension of this
case execution
* will be propagated down to all its contained {@link EventListener EventListener}, {@link Milestone},
* {@link Stage}, and {@link Task} instances.
*
* Afterwards the method {@link #performSuspension()} must be called to complete
* the transition into the state {@link CaseExecutionState#SUSPENDED}.
*
* @throws CaseIllegalStateTransitionException will be thrown, if this
case execution
* is not in the expected state.
* @throws ProcessEngineException when an internal exception happens during the execution
* of the command.
*/
void suspend();
/**
* Transition to {@link CaseExecutionState#SUSPENDED} state.
*
* @throws CaseIllegalStateTransitionException will be thrown, if this
case execution
* is not in the expected state.
* @throws ProcessEngineException when an internal exception happens during the execution
* of the command.
*/
void performSuspension();
/**
* Transition to {@link CaseExecutionState#SUSPENDING_ON_PARENT_SUSPENSION} state.
*
* This
case execution must be in one of the following state to
* be able to do this transition:
*
* - {@link CaseExecutionState#AVAILABLE},
* - {@link CaseExecutionState#ENABLED},
* - {@link CaseExecutionState#DISABLED} or
* - {@link CaseExecutionState#ACTIVE}
*
*
* It is only possible to execute a parent suspension on a case execution which is
* associated with a {@link Stage} or {@link Task}.
*
* Afterwards the method {@link #performParentSuspension()} must be called to complete
* the transition into the state {@link CaseExecutionState#SUSPENDED}.
*
* @throws CaseIllegalStateTransitionException will be thrown, if this
case execution
* is not in the expected state.
* @throws ProcessEngineException when an internal exception happens during the execution
* of the command.
*/
void parentSuspend();
/**
* Transition to {@link CaseExecutionState#SUSPENDED} state.
*
* @throws CaseIllegalStateTransitionException will be thrown, if this
case execution
* is not in the expected state.
* @throws ProcessEngineException when an internal exception happens during the execution
* of the command.
*/
void performParentSuspension();
/**
* Transition to either to {@link CaseExecutionState#ACTIVE} state, if this
* case execution is associated with a {@link Stage} or {@link Task}, or to {@link CaseExecutionState#AVAILABE},
* if this
case execution is associated with a {@link EventListener} or {@link Milestone}.
*
* This
case execution must be in {@link CaseExecutionState#SUSPENDED}
* state to be able to do this transition.
*
* For a {@link Stage} instance the resume of this
case execution
* will be propagated down to all its contained {@link EventListener EventListener}, {@link Milestone},
* {@link Stage}, and {@link Task} instances.
*
* @throws CaseIllegalStateTransitionException will be thrown, if this
case execution
* is not in the expected state.
* @throws ProcessEngineException when an internal exception happens during the execution
* of the command.
*/
void resume();
/**
* Transition to the previous state ({@link CaseExecutionState#AVAILABLE},
* {@link CaseExecutionState#ENABLED}, {@link CaseExecutionState#DISABLED} or
* {@link CaseExecutionState#ACTIVE}) when the parent {@link Stage} transitions
* out of {@link CaseExecutionState#SUSPENDED}.
*
* This
case execution must be in {@link CaseExecutionState#SUSPENDED}
* state to be able to do this transition.
*
* It is only possible to execute a parent resume on a case execution which is
* associated with a {@link Stage} or {@link Task}.
*
* @throws CaseIllegalStateTransitionException will be thrown, if this
case execution
* is not in the expected state.
* @throws ProcessEngineException when an internal exception happens during the execution
* of the command.
*/
void parentResume();
/**
* Transition to {@link CaseExecutionState#ACTIVE} state.
*
* If this
case execution is associated with a {@link Stage} or
* {@link Task} and is not a case instance, then this
case execution
* must be in {@link CaseExecutionState#FAILED} state to be able to do this transition.
* And if this
case execution is a case instance, then this
* case instance must be in one of the following state to perform this transition:
*
* - {@link CaseExecutionState#COMPLETED},
* - {@link CaseExecutionState#SUSPENDED},
* - {@link CaseExecutionState#TERMINATED} or
* - {@link CaseExecutionState#FAILED}
*
*
*
* In case of a case instance the transition out of {@link CaseExecutionState#SUSPENDED} state
* the resume will be propagated down to all its contained {@link EventListener EventListener},
* {@link Milestone}, {@link Stage}, and {@link Task} instances, see {@link #resume()} and
* {@link #parentResume()}.
*
* @throws CaseIllegalStateTransitionException will be thrown, if this
case execution
* is not in the expected state.
* @throws ProcessEngineException when an internal exception happens during the execution
* of the command.
*/
void reactivate();
/**
* Transition to {@link CaseExecutionState#CLOSED} state when no further
* work or modifications should be allowed for this case instance.
*
* It is only possible to close a case instance which is in one of the following
* states:
*
* - {@link CaseExecutionState#COMPLETED},
* - {@link CaseExecutionState#SUSPENDED},
* - {@link CaseExecutionState#TERMINATED} or
* - {@link CaseExecutionState#FAILED}
*
*
*
* @throws CaseIllegalStateTransitionException will be thrown, if this
case execution
* is not in the expected state.
* @throws ProcessEngineException when an internal exception happens during the execution
* of the command.
*/
void close();
/**
* Returns true, if this
case execution is required.
*
* @return true if this
case execution is required.
*/
boolean isRequired();
/**
* Sets this
case execution as required or not required.
*
* @param required a boolean value whether this
case execution
* is required or not required.
*/
void setRequired(boolean required);
/**
* Removes this
case execution from the parent case execution.
*/
void remove();
/**
* Returns a {@link List} of child case executions. If this
case
* execution has no child case executions an empty {@link List} will be returned.
*
* @return a {@link List} of child case executions.
*/
List getCaseExecutions();
/**
* Creates a new task.
*
* This
case execution will be the case execution of the
* created task.
*
* @param taskDecorator the task decorator used to create task
*/
org.camunda.bpm.engine.task.Task createTask(TaskDecorator taskDecorator);
/**
* Creates a new sub process instance.
*
* This
case execution will be the super case execution of the
* created sub process instance.
*
* @param processDefinition The {@link PvmProcessDefinition} of the subprocess.
*/
PvmProcessInstance createSubProcessInstance(PvmProcessDefinition processDefinition);
/**
* Creates a new sub process instance.
*
* This
case execution will be the super case execution of the
* created sub process instance.
*
* @param processDefinition The {@link PvmProcessDefinition} of the subprocess.
* @param businessKey The businessKey to be set on sub process instance.
*/
PvmProcessInstance createSubProcessInstance(PvmProcessDefinition processDefinition, String businessKey);
/**
* Creates a new sub process instance.
*
* This
case execution will be the super case execution of the
* created sub process instance.
*
* @param processDefinition The {@link PvmProcessDefinition} of the subprocess.
* @param businessKey The businessKey to be set on sub process instance.
* @param caseInstanceId The caseInstanceId to be set on sub process instance.
*/
PvmProcessInstance createSubProcessInstance(PvmProcessDefinition processDefinition, String businessKey, String caseInstanceId);
/**
* Creates a new sub case instance.
*
* This
case execution will be the super case execution of the
* created sub case instance.
*
* @param caseDefinition The {@link CmmnCaseDefinition} of the sub case instance.
*/
CmmnCaseInstance createSubCaseInstance(CmmnCaseDefinition caseDefinition);
/**
* Creates a new sub case instance.
*
* This
case execution will be the super case execution of the
* created sub case instance.
*
* @param caseDefinition The {@link CmmnCaseDefinition} of the sub case instance.
* @param businessKey The businessKey to be set on sub case instance.
*/
CmmnCaseInstance createSubCaseInstance(CmmnCaseDefinition caseDefinition, String businessKey);
/**
* Creates for each defined {@link PlanItemOnPart} and {@link IfPart} inside
* the specified {@link Sentry Sentries} a {@link CmmnSentryPart}.
*/
void createSentryParts();
/**
* Returns true
, if each {@link CmmnSentryPart} of the given
* sentryId
is satisfied.
*
* @param sentryId the id of the sentry to check
*
* @return true
if the sentry is satisfied.
*/
boolean isSentrySatisfied(String sentryId);
/**
* The flag entryCriterionSatisfied
will only be set to
* true
, when this
{@link CmmnActivityExecution}
* stays in state {@link CaseExecutionState#NEW}.
*
* For example:
*
* There exists:
*
* - a {@link Stage},
* - the {@link Stage} contains two tasks (A and B) and
* - task B has an entry criterion which is satisfied,
* when task A performs the transition
create
*
*
* When the {@link Stage} instance becomes active, two child case executions
* will be created for task A and task B. Both tasks are in the state {@link CaseExecutionState#NEW}.
* Now task A performs the create
transition and so that the given sentry is triggered,
* that this is satisfied. Afterwards the sentry will be reseted, that the sentry is not satisfied anymore.
* But task B is still in the state {@link CaseExecutionState#NEW} and will not be
* notified, that its' entry criterion has been satisfied. That's why the the flag entryCriterionSatisfied
* will be set to true
on the case execution of task B in such a situation. When
* task B performs the transition into the state {@link CaseExecutionState#AVAILABLE} it can perform
* the next transition because the entry criterion has been already satisfied.
*/
boolean isEntryCriterionSatisfied();
/**
* Fire sentries that consist only out of ifPart, are not satisfied yet, but do satisfy condition.
*/
void fireIfOnlySentryParts();
}