Package org.kie.kogito.process
Interface ProcessInstance<T>
public interface ProcessInstance<T>
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final int -
Method Summary
Modifier and TypeMethodDescriptionvoidabort()Aborts this process instancevoidabortWorkItem(String id, Policy... policies) Aborts work item belonging to this process instanceReturns the process adHocFragmentsReturns optional business key associated with this process instancevoidcancelNodeInstance(String nodeInstanceId) default ProcessInstance<T>voidCompletes work item belonging to this process instance with given variablesOptional<? extends Correlation<?>>Returns optional description of this process instanceerror()Returns process error in case process instance is in error state.Set<EventDescription<?>>events()findNodes(Predicate<KogitoNodeInstance> filter) Return nodes that fulfills a particular filterid()Returns identifier of this process instanceReturns the process milestonesprocess()Returns process definition associated with this process instancevoidretriggerNodeInstance(String nodeInstanceId) <S> voidSends given signal into this process instancevoidstart()Starts process instancevoidStarts process instance with triggervoidStarts process instance with triggervoidStarts process instance with trigger and headersReturns startDate of this process instancevoidStarts process instance from given nodevoidStarts process instance from given nodevoidStarts process instance from given nodevoidStarts process instance from given node and headersintstatus()Returns current status of this process instancevoidtransitionWorkItem(String id, WorkItemTransition transition) Transition work item belonging to this process instance not another life cycle phasevoidtriggerNode(String nodeId) updateVariables(T updates) Updates process variables of this process instanceupdateVariablesPartially(T updates) Partially updates process variables of this process instance Partial means that null values are ignored.<R> RupdateWorkItem(String id, Function<KogitoWorkItem, R> updater, Policy... policies) Updates work item according to provided consumerReturns process variables of this process instancelongversion()Returns work item identified by given id if foundworkItems(Predicate<KogitoNodeInstance> p, Policy... policies) Returns list of filtered work itemsReturns list of currently active work items.
-
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:
-
-
Method Details
-
process
Returns process definition associated with this process instance- Returns:
- process definition of this process instance
-
start
void start()Starts process instance -
start
Starts process instance with trigger- Parameters:
trigger- name of the trigger that will indicate what start node to triggerreferenceId- optional reference id that points to a another component triggering this instance
-
start
Starts process instance with trigger- Parameters:
trigger- name of the trigger that will indicate what start node to triggerreferenceId- optional reference id that points to a another component triggering this instanceheaders- process headers
-
start
Starts process instance with trigger and headers- Parameters:
trigger- name of the trigger that will indicate what start node to triggerheaders- list of headers
-
startFrom
Starts process instance from given node- Parameters:
nodeId- node id that should be used as the first node
-
startFrom
Starts process instance from given node and headers- Parameters:
nodeId- node id that should be used as the first nodeheaders- list of headers
-
startFrom
Starts process instance from given node- Parameters:
nodeId- node id that should be used as the first nodereferenceId- optional reference id that points to a another component triggering this instance
-
startFrom
Starts process instance from given node- Parameters:
nodeId- node id that should be used as the first nodereferenceId- optional reference id that points to a another component triggering this instanceheaders- process headers
-
send
Sends given signal into this process instance- Parameters:
signal- signal to be processed
-
abort
void abort()Aborts this process instance -
variables
T variables()Returns process variables of this process instance- Returns:
- variables of the process instance
-
updateVariables
Updates process variables of this process instance -
updateVariablesPartially
Partially updates process variables of this process instance Partial means that null values are ignored. -
status
int status()Returns current status of this process instance- Returns:
- the current status
-
completeWorkItem
Completes work item belonging to this process instance with given variables- Parameters:
id- id of the work item to completevariables- optional variablespolicies- optional list of policies to be enforced
-
updateWorkItem
Updates work item according to provided consumer- Parameters:
id- the id of the work item that has been completedupdater- consumer implementation that contains the logic to update workitempolicies- optional security information- Returns:
- result of the operation performed by the updater
-
abortWorkItem
Aborts work item belonging to this process instance- Parameters:
id- id of the work item to completepolicies- optional list of policies to be enforced
-
transitionWorkItem
Transition work item belonging to this process instance not another life cycle phase- Parameters:
id- id of the work item to completetransition- target transition including phase, identity and data
-
workItem
Returns work item identified by given id if found- Parameters:
workItemId- id of the work itempolicies- optional list of policies to be enforced- Returns:
- work item with its parameters if found
-
findNodes
Return nodes that fulfills a particular filter- Returns:
- collections of nodes that match the filter
-
workItems
Returns list of currently active work items.- Parameters:
policies- optional list of policies to be enforced- Returns:
- list of work items
-
workItems
Returns list of filtered work items- Parameters:
p- the predicate to be applied to the node holding the work item- Returns:
- list of work items
-
id
String id()Returns identifier of this process instance- Returns:
- id of the process instance
-
businessKey
String businessKey()Returns optional business key associated with this process instance- Returns:
- business key if available otherwise null
-
description
String description()Returns optional description of this process instance- Returns:
- description of the process instance
-
startDate
Date startDate()Returns startDate of this process instance- Returns:
-
error
Optional<ProcessError> error()Returns process error in case process instance is in error state.- Returns:
- returns process error
-
checkError
-
triggerNode
-
cancelNodeInstance
-
retriggerNodeInstance
-
events
Set<EventDescription<?>> events() -
milestones
Collection<Milestone> milestones()Returns the process milestones- Returns:
- All the process milestones with their current status
-
adHocFragments
Collection<AdHocFragment> adHocFragments()Returns the process adHocFragments- Returns:
- All the
AdHocFragmentin the process
-
version
long version() -
correlation
Optional<? extends Correlation<?>> correlation()
-