Module io.automatiko.engine.api
Interface ProcessInstance
- All Superinterfaces:
EventListener
- All Known Subinterfaces:
WorkflowProcessInstance
A process instance represents one specific instance of a process that is
currently executing. Whenever a process is started, a process instance is
created that represents that specific instance that was started. It contains
all runtime information related to that instance. Multiple process instances
of the same process can be executed simultaneously.
For example, consider a process definition that describes how to process a
purchase order. Whenever a new purchase order comes in, a new process
instance will be created for that purchase order. Multiple process instances
(one for each purchase order) can coexist.
A process instance is uniquely identified by an id.
This class can be extended to represent one specific type of process, e.g.
WorkflowProcessInstance when using a
WorkflowProcess where the process logic is expressed as a flow
chart.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final int -
Method Summary
Modifier and TypeMethodDescriptionReturns optional correlation key (aka business key)getId()The unique id of this process instance.Returns parent process instance id if this process instance has a parentThe id of the process definition that is related to this process instance.The name of the process definition that is related to this process instance.Returns current snapshot of process instance variables that are publicly accessibleReturns optional reference id this process instance was triggered byThe id of the root process definition that is related to this process instance.Returns root process instance id if this process instance has a root process instanceintgetState()The state of the process instance.getVariable(String name) Returns current snapshot of process instance variable identified by nameReturns current snapshot of process instance variablesvoidsetVariable(String name, Object value) Sets value for given variable overriding previous value if it was presentMethods inherited from interface io.automatiko.engine.api.runtime.process.EventListener
getEventDescriptions, getEventTypes, signalEvent
-
Field Details
-
STATE_PENDING
static final int STATE_PENDING- See Also:
-
STATE_ACTIVE
static final int STATE_ACTIVE- See Also:
-
STATE_COMPLETED
static final int STATE_COMPLETED- See Also:
-
STATE_ABORTED
static final int STATE_ABORTED- See Also:
-
STATE_SUSPENDED
static final int STATE_SUSPENDED- See Also:
-
STATE_ERROR
static final int STATE_ERROR- See Also:
-
SLA_NA
static final int SLA_NA- See Also:
-
SLA_PENDING
static final int SLA_PENDING- See Also:
-
SLA_MET
static final int SLA_MET- See Also:
-
SLA_VIOLATED
static final int SLA_VIOLATED- See Also:
-
SLA_ABORTED
static final int SLA_ABORTED- See Also:
-
-
Method Details
-
getProcessId
String getProcessId()The id of the process definition that is related to this process instance.- Returns:
- the id of the process definition that is related to this process instance
-
getProcess
Process getProcess() -
getId
String getId()The unique id of this process instance.- Returns:
- the unique id of this process instance
-
getProcessName
String getProcessName()The name of the process definition that is related to this process instance.- Returns:
- the name of the process definition that is related to this process instance
-
getState
int getState()The state of the process instance.- Returns:
- the state of the process instance
-
getParentProcessInstanceId
String getParentProcessInstanceId()Returns parent process instance id if this process instance has a parent- Returns:
- the unique id of parent process instance, null if this process instance doesn't have a parent
-
getRootProcessInstanceId
String getRootProcessInstanceId()Returns root process instance id if this process instance has a root process instance- Returns:
- the unique id of root process instance, null if this process instance doesn't have a root or is a root itself
-
getRootProcessId
String getRootProcessId()The id of the root process definition that is related to this process instance.- Returns:
- the id of the root process definition that is related to this process instance
-
getVariables
Returns current snapshot of process instance variables- Returns:
- non empty map of process instance variables
-
getPublicVariables
Returns current snapshot of process instance variables that are publicly accessible- Returns:
- non empty map of process instance variables
-
getVariable
Returns current snapshot of process instance variable identified by name- Returns:
- current value of given process variable or null if not found
-
setVariable
Sets value for given variable overriding previous value if it was present- Parameters:
name- name of the variablevalue- value of the variable
-
getReferenceId
String getReferenceId()Returns optional reference id this process instance was triggered by- Returns:
- reference id or null if not set
-
getCorrelationKey
String getCorrelationKey()Returns optional correlation key (aka business key)- Returns:
- correlation key if exists otherwise null
-