org.camunda.bpm.engine.impl.cmmn.execution
Interface CmmnActivityExecution

All Superinterfaces:
BaseDelegateExecution, CmmnModelExecutionContext, DelegateCaseExecution, ProcessEngineServicesAware, VariableScope
All Known Subinterfaces:
CmmnCaseInstance
All Known Implementing Classes:
CaseExecutionEntity, CaseExecutionImpl, CmmnExecution

public interface CmmnActivityExecution
extends DelegateCaseExecution

Author:
Roman Smirnov

Method Summary
 void close()
          Transition to CaseExecutionState.CLOSED state when no further work or modifications should be allowed for this case instance.
 void complete()
          Transition to CaseExecutionState.COMPLETED state.
 void createChildExecutions(List<CmmnActivity> activities)
          Creates new child case executions for each given CmmnActivity.
 CmmnCaseInstance createSubCaseInstance(CmmnCaseDefinition caseDefinition)
          Creates a new sub case instance.
 PvmProcessInstance createSubProcessInstance(PvmProcessDefinition processDefinition)
          Creates a new sub process instance.
 void disable()
          Transition to state.
 void enable()
          Transition to CaseExecutionState.ENABLED state.
 void exit()
          Transition to CaseExecutionState.TERMINATED state when the parent Stage transition to CaseExecutionState.TERMINATED state or when the exit criteria of the associated Stage or Task becomes true.
 CmmnActivity getActivity()
          Returns the activity which is associated with this case execution.
 List<? extends CmmnExecution> getCaseExecutions()
          Returns a List of child case executions.
 CaseExecutionState getCurrentState()
          Returns the current state of this case execution.
 CmmnActivityExecution getParent()
          Returns the parent of this case execution, or null if there is no parent.
 CaseExecutionState getPreviousState()
          Returns the previous state of this case execution.
 boolean isCaseInstanceExecution()
          Returns true if this case execution is a case instance.
 boolean isNew()
          Returns true iff:
getCurrentState() == CaseExecutionState.NEW
 boolean isRequired()
          Returns to true, if this case execution is required.
 void manualComplete()
          Transition to CaseExecutionState.COMPLETED state.
 void manualStart()
          Transition to CaseExecutionState.ACTIVE state.
 void occur()
          Transition to CaseExecutionState.COMPLETED state.
 void parentResume()
          Transition to the previous state (CaseExecutionState.AVAILABLE, CaseExecutionState.ENABLED, CaseExecutionState.DISABLED or CaseExecutionState.ACTIVE) when the parent Stage transitions out of CaseExecutionState.SUSPENDED.
 void parentSuspend()
          Transition to CaseExecutionState.SUSPENDED state when the parent Stage transition to CaseExecutionState.SUSPENDED state.
 void parentTerminate()
          Transition to CaseExecutionState.TERMINATED state when the parent Stage transition to CaseExecutionState.TERMINATED state.
 void reactivate()
          Transition to CaseExecutionState.ACTIVE state.
 void reenable()
          Transition to CaseExecutionState.ENABLED state.
 void remove()
          Removes this case execution from the parent case execution.
 void resume()
          Transition to either to CaseExecutionState.ACTIVE state, if this case execution is associated with a Stage or Task, or to CaseExecutionState#AVAILABE, if this case execution is associated with a EventListener or Milestone.
 void setCurrentState(CaseExecutionState currentState)
          Sets the given state as the current state of this case execution.
 void setRequired(boolean required)
          Sets this case execution as required or not required.
 void start()
          Transition to CaseExecutionState.ACTIVE state.
 void suspend()
          Transition to CaseExecutionState.SUSPENDED state.
 void terminate()
          Transition to CaseExecutionState.TERMINATED state.
 
Methods inherited from interface org.camunda.bpm.engine.delegate.DelegateCaseExecution
getActivityId, getActivityName, getCaseBusinessKey, getCaseDefinitionId, getCaseInstanceId, getEventName, getId, getParentId, isActive, isAvailable, isClosed, isCompleted, isDisabled, isEnabled, isFailed, isSuspended, isTerminated
 
Methods inherited from interface org.camunda.bpm.engine.delegate.BaseDelegateExecution
getBusinessKey
 
Methods inherited from interface org.camunda.bpm.engine.delegate.VariableScope
getVariable, getVariableLocal, getVariableNames, getVariableNamesLocal, getVariables, getVariablesLocal, hasVariable, hasVariableLocal, hasVariables, hasVariablesLocal, removeVariable, removeVariableLocal, removeVariables, removeVariables, removeVariablesLocal, removeVariablesLocal, setVariable, setVariableLocal, setVariables, setVariablesLocal
 
Methods inherited from interface org.camunda.bpm.engine.delegate.ProcessEngineServicesAware
getProcessEngineServices
 
Methods inherited from interface org.camunda.bpm.engine.delegate.CmmnModelExecutionContext
getCmmnModelElementInstance, getCmmnModelInstance
 

Method Detail

getParent

CmmnActivityExecution getParent()

Returns the parent of this case execution, or null if there is no parent.

Returns:
a parent or null.

isCaseInstanceExecution

boolean isCaseInstanceExecution()

Returns true if this case execution is a case instance. If this case execution is not a case instance then false will be returned.

Returns:
whether this case execution is a case instance or not.

getCurrentState

CaseExecutionState getCurrentState()

Returns the current state of this case execution.

Returns:
the current state

setCurrentState

void setCurrentState(CaseExecutionState currentState)

Sets the given state as the current state of this case execution.

Parameters:
currentState - the current state to set

getPreviousState

CaseExecutionState getPreviousState()

Returns the previous state of this case execution.

Returns:
the previous state

isNew

boolean isNew()

Returns true iff:
getCurrentState() == CaseExecutionState.NEW

Returns:
whether this case execution has as current state CaseExecutionState.NEW

getActivity

CmmnActivity getActivity()

Returns the activity which is associated with this case execution.

Returns:
the associated activity

createChildExecutions

void createChildExecutions(List<CmmnActivity> activities)

Creates new child case executions for each given CmmnActivity.

Afterwards each created case executions will be executed (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 Stage) transitions to ACTIVE state. The passed collection of activities are the planned items that should be executed in this Stage. So that for each given CmmnActivity a new case execution will be instantiated. Furthermore for each created child execution there happens a transition to the initial state AVAILABLE.

Parameters:
activities - a collection of activities of planned items to execute inside this case execution
Throws:
ProcessEngineException - will be thrown, if this case execution is not ACTIVE.

enable

void enable()

Transition to CaseExecutionState.ENABLED state.

This case execution must be in CaseExecutionState.AVAILABLE state to be able to do this transition.

It is only possible to enable a case execution which is associated with a Stage or Task.

Throws:
ProcessEngineException - will be thrown, if this case execution is not CaseExecutionState.AVAILABLE.

disable

void disable()

Transition to state.

This case execution must be in CaseExecutionState.ENABLED state to be able to do this transition.

It is only possible to disable a case execution which is associated with a Stage or 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 complete().

Throws:
ProcessEngineException - will be thrown, if this case execution is not CaseExecutionState.ENABLED.

reenable

void reenable()

Transition to CaseExecutionState.ENABLED state.

This case execution must be in 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 Stage or Task.

Throws:
ProcessEngineException - will be thrown, if this case execution is not CaseExecutionState.DISABLED.

manualStart

void manualStart()

Transition to CaseExecutionState.ACTIVE state.

This case execution must be in 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 Stage or Task.

Throws:
ProcessEngineException - will be thrown, if this case execution is not CaseExecutionState.ENABLED.

start

void start()

Transition to CaseExecutionState.ACTIVE state.

This case execution must be in CaseExecutionState.AVAILABLE state to be able to do this transition.

It is only possible to start a case execution which is associated with a Stage or Task.

Throws:
ProcessEngineException - will be thrown, if this case execution is not CaseExecutionState.AVAILABLE.

complete

void complete()

Transition to CaseExecutionState.COMPLETED state.

This case execution must be in CaseExecutionState.ACTIVE state to be able to do this transition.

It is only possible to complete a case execution which is associated with a Stage or 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 complete().

In case of a Stage the completion can only be performed when the following criteria are fulfilled:

For a Task instance, this means its purpose has been accomplished:

Throws:
ProcessEngineException - will be thrown, if this case execution is not CaseExecutionState.ACTIVE or when the case execution cannot be completed.

manualComplete

void manualComplete()

Transition to CaseExecutionState.COMPLETED state.

This case execution must be in 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 Stage or 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 complete().

In case of a Stage the completion can only be performed when the following criteria are fulfilled:

For a Task instance, this means its purpose has been accomplished:

Throws:
ProcessEngineException - will be thrown, if this case execution is not CaseExecutionState.ACTIVE or when the case execution cannot be completed.

occur

void occur()

Transition to CaseExecutionState.COMPLETED state.

This case execution must be in CaseExecutionState.AVAILABLE state to be able to do this transition.

For event listener transitions when the event being listened by the event listener instance does occur. For a user event listener instance this transition happens when a human decides to raise the event.

For Milestone instance transitions when one of the achieving 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 complete().

Throws:
ProcessEngineException - will be thrown, if this case execution is not CaseExecutionState.AVAILABLE.

terminate

void terminate()

Transition to CaseExecutionState.TERMINATED state.

If this case execution is associated with a Stage or Task, then this case execution must be in CaseExecutionState.ACTIVE state to be able to do this transition.
And if this case execution is association with EventListener or a Milestone, then this case execution must be in CaseExecutionState.AVAILABLE state to be able to do this transition.

For a Stage instance the termination of this case execution will be propagated down to all its contained EventListener, Milestone, Stage, and Task instances.

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 complete().

Throws:
ProcessEngineException - will be thrown, if this case execution is not in the expected state.

parentTerminate

void parentTerminate()

Transition to CaseExecutionState.TERMINATED state when the parent Stage transition to CaseExecutionState.TERMINATED state.

This case execution must be in CaseExecutionState.AVAILABLE or 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 EventListener or Milestone.

Throws:
ProcessEngineException - will be thrown, if this case execution is not in the expected state.

exit

void exit()

Transition to CaseExecutionState.TERMINATED state when the parent Stage transition to CaseExecutionState.TERMINATED state or when the exit criteria of the associated Stage or Task becomes true.

This case execution must be in one of the following state to be able to do this transition:

It is only possible to execute an exit on a case execution which is associated with a Stage or Task.

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 complete().

Throws:
ProcessEngineException - will be thrown, if this case execution is not in the expected state.

suspend

void suspend()

Transition to CaseExecutionState.SUSPENDED state.

If this case execution is associated with a Stage or Task, then this case execution must be in CaseExecutionState.ACTIVE state to be able to do this transition.
And if this case execution is association with EventListener or a Milestone, then this case execution must be in CaseExecutionState.AVAILABLE state to be able to do this transition.

For a Stage instance the suspension of this case execution will be propagated down to all its contained EventListener, Milestone, Stage, and Task instances.

Throws:
ProcessEngineException - will be thrown, if this case execution is not in the expected state.

parentSuspend

void parentSuspend()

Transition to CaseExecutionState.SUSPENDED state when the parent Stage transition to CaseExecutionState.SUSPENDED state.

This case execution must be in one of the following state to be able to do this transition:

It is only possible to execute a parent suspension on a case execution which is associated with a Stage or Task.

Throws:
ProcessEngineException - will be thrown, if this case execution is not in the expected state.

resume

void resume()

Transition to either to CaseExecutionState.ACTIVE state, if this case execution is associated with a Stage or Task, or to CaseExecutionState#AVAILABE, if this case execution is associated with a EventListener or Milestone.

This case execution must be in CaseExecutionState.SUSPENDED state to be able to do this transition.

For a Stage instance the resume of this case execution will be propagated down to all its contained EventListener, Milestone, Stage, and Task instances.

Throws:
ProcessEngineException - will be thrown, if this case execution is not in the expected state.

parentResume

void parentResume()

Transition to the previous state (CaseExecutionState.AVAILABLE, CaseExecutionState.ENABLED, CaseExecutionState.DISABLED or CaseExecutionState.ACTIVE) when the parent Stage transitions out of CaseExecutionState.SUSPENDED.

This case execution must be in 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 Stage or Task.

Throws:
ProcessEngineException - will be thrown, if this case execution is not in the expected state.

reactivate

void reactivate()

Transition to CaseExecutionState.ACTIVE state.

If this case execution is associated with a Stage or Task and is not a case instance, then this case execution must be in 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:

In case of a case instance the transition out of CaseExecutionState.SUSPENDED state the resume will be propagated down to all its contained EventListener, Milestone, Stage, and Task instances, see resume() and parentResume().

Throws:
ProcessEngineException - will be thrown, if this case execution is not in the expected state.

close

void close()

Transition to 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:

Throws:
ProcessEngineException - will be thrown, if this case execution is not in the expected state.

isRequired

boolean isRequired()

Returns to true, if this case execution is required.

Returns:
true if this case execution is required.

setRequired

void setRequired(boolean required)

Sets this case execution as required or not required.

Parameters:
required - a boolean value whether this case execution is required or not required.

remove

void remove()

Removes this case execution from the parent case execution.


getCaseExecutions

List<? extends CmmnExecution> getCaseExecutions()

Returns a List of child case executions. If this case execution has no child case executions an empty List will be returned.

Returns:
a List of child case executions.

createSubProcessInstance

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.

Parameters:
processDefinition - The PvmProcessDefinition of the subprocess.

createSubCaseInstance

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.

Parameters:
caseDefinition - The CmmnCaseDefinition of the subprocess.


Copyright © 2014 camunda services GmbH. All Rights Reserved.