Interface HvlBpmnRuntimeService
- All Known Implementing Classes:
HvlBpmnRuntimeServiceImpl
-
Method Summary
Modifier and TypeMethodDescriptionvoid
activateProcessInstanceById
(@NotBlank String processInstanceId) Activates the process instance with the given id.void
addEventListener
(@NotNull org.flowable.common.engine.api.delegate.event.FlowableEventListener listenerToAdd) Adds an event-listener which will be notified of ALL events by the dispatcher.void
addEventListener
(@NotNull org.flowable.common.engine.api.delegate.event.FlowableEventListener listenerToAdd, org.flowable.common.engine.api.delegate.event.FlowableEngineEventType... types) Adds an event-listener which will only be notified when an event occurs, which type is in the given types.void
addEventRegistryConsumer
(@NotNull org.flowable.eventregistry.api.EventRegistryEventConsumer eventConsumer) Add event registry consumer.void
addGroupIdentityLink
(@NotBlank String processInstanceId, @NotBlank String groupId, @NotBlank String identityLinkType) Involves a group with a process instance.org.flowable.engine.runtime.Execution
addMultiInstanceExecution
(@NotBlank String activityId, @NotBlank String parentExecutionId, Map<String, Object> executionVariables) Adds a new execution to a running multi-instance parent executionvoid
addParticipantGroup
(@NotBlank String processInstanceId, @NotBlank String groupId) Convenience shorthand foraddGroupIdentityLink(String, String, String)
; with typeIdentityLinkType.PARTICIPANT
void
addParticipantUser
(@NotBlank String processInstanceId, @NotBlank String userId) Convenience shorthand foraddUserIdentityLink(String, String, String)
; with typeIdentityLinkType.PARTICIPANT
void
addUserIdentityLink
(@NotBlank String processInstanceId, @NotBlank String userId, @NotBlank String identityLinkType) Involves a user with a process instance.void
completeAdhocSubProcess
(@NotBlank String executionId) Completes the ad-hoc sub processorg.flowable.engine.runtime.ActivityInstanceQuery
Creates a newActivityInstanceQuery
instance, that can be used to query activities in the currently running process instances.org.flowable.engine.runtime.ChangeActivityStateBuilder
Create aChangeActivityStateBuilder
, that allows to set various options for changing the state of a process instance.org.flowable.eventsubscription.api.EventSubscriptionQuery
Creates a newEventSubscriptionQuery
instance, that can be used to query the event subscriptions.org.flowable.engine.runtime.ExecutionQuery
Creates a newExecutionQuery
instance, that can be used to query the executions and process instances.org.flowable.engine.runtime.NativeActivityInstanceQuery
creates a newNativeActivityInstanceQuery
to queryActivityInstance
s which are included in the cuby SQL directly.org.flowable.engine.runtime.NativeExecutionQuery
creates a newNativeExecutionQuery
to queryExecution
s by SQL directlyorg.flowable.engine.runtime.NativeProcessInstanceQuery
creates a newNativeProcessInstanceQuery
to queryProcessInstance
s by SQL directlyorg.flowable.engine.runtime.ProcessInstanceBuilder
Create aProcessInstanceBuilder
, that allows to set various options for starting a process instance, as an alternative to the various startProcessInstanceByXX methods.org.flowable.engine.runtime.ProcessInstanceQuery
Creates a newProcessInstanceQuery
instance, that can be used to query process instances.void
deleteGroupIdentityLink
(@NotBlank String processInstanceId, @NotBlank String groupId, @NotBlank String identityLinkType) Removes the association between a group and a process instance for the given identityLinkType.void
deleteMultiInstanceExecution
(@NotBlank String executionId, boolean executionIsCompleted) Deletes a multi-instance executionvoid
deleteParticipantGroup
(@NotBlank String processInstanceId, @NotBlank String groupId) Convenience shorthand fordeleteGroupIdentityLink(String, String, String)
; with typeIdentityLinkType.PARTICIPANT
void
deleteParticipantUser
(@NotBlank String processInstanceId, @NotBlank String userId) Convenience shorthand fordeleteUserIdentityLink(String, String, String)
; with typeIdentityLinkType.PARTICIPANT
void
deleteProcessInstance
(@NotBlank String processInstanceId, String deleteReason) Delete an existing runtime process instance.void
deleteUserIdentityLink
(@NotBlank String processInstanceId, @NotBlank String userId, @NotBlank String identityLinkType) Removes the association between a user and a process instance for the given identityLinkType.void
dispatchEvent
(@NotNull org.flowable.common.engine.api.delegate.event.FlowableEvent event) Dispatches the given event to any listeners that are registered.void
evaluateConditionalEvents
(@NotBlank String processInstanceId) Evaluate waiting conditional events (boundary, intermediate catch and event sub process start events) and trigger them if a condition evaluates to true.void
evaluateConditionalEvents
(@NotBlank String processInstanceId, Map<String, Object> processVariables) Evaluate waiting conditional events (boundary, intermediate catch and event sub process start events) and trigger them if a condition evaluates to true.org.flowable.engine.runtime.Execution
executeActivityInAdhocSubProcess
(@NotBlank String executionId, @NotBlank String activityId) Executes an activity in a ad-hoc sub processgetActiveActivityIds
(@NotBlank String processInstanceId) Finds the activity ids for all executions that are waiting in activities.List<org.flowable.engine.runtime.Execution>
getAdhocSubProcessExecutions
(@NotBlank String processInstanceId) Gets executions with an adhoc sub process as current flow elementorg.flowable.engine.runtime.DataObject
getDataObject
(@NotNull HvlBpmnExecutionDataObjectQueryModel executionDataObjectQueryModel) The DataObject.getDataObjects
(@NotNull HvlBpmnExecutionDataObjectQueryModel executionDataObjectQueryModel) All DataObjects visible from the given execution scope (including parent scopes).List<org.flowable.bpmn.model.FlowNode>
getEnabledActivitiesFromAdhocSubProcess
(@NotBlank String executionId) Gets enabled activities from ad-hoc sub processList<org.flowable.identitylink.api.IdentityLink>
getIdentityLinksForProcessInstance
(@NotBlank String instanceId) Retrieves theIdentityLink
s associated with the given process instance.List<org.flowable.engine.task.Event>
getProcessInstanceEvents
(@NotBlank String processInstanceId) The all events related to the given Process Instance.getVariable
(@NotNull HvlBpmnExecutionVariableQueryModel executionVariableQueryModel) The variable value.<T> T
getVariable
(@NotNull HvlBpmnExecutionVariableQueryModel executionVariableQueryModel, @NotNull Class<T> variableClass) The variable value.org.flowable.variable.api.persistence.entity.VariableInstance
getVariableInstance
(@NotNull HvlBpmnExecutionVariableQueryModel executionVariableQueryModel) The variable.List<org.flowable.variable.api.persistence.entity.VariableInstance>
getVariableInstancesByExecutionIds
(@NotEmpty Set<String> executionIds) All variables visible from the given execution scope (including parent scopes).boolean
hasVariable
(@NotNull HvlBpmnExecutionVariableQueryModel executionVariableQueryModel) Check whether or not this execution has variable set with the given name, Searching for the variable is done in all scopes that are visible to the given execution (including parent scopes).void
messageEventReceived
(@NotNull HvlBpmnMessageEventModel messageEventModel) Notifies the process engine that a message event with name 'messageName' has been received and has been correlated to an execution with id 'executionId'.tr.com.havelsan.javarch.data.commons.pageable.HvlPage<HvlBpmnProcessInstanceModel>
queryPage
(@NotNull HvlBpmnProcessInstanceQueryModel processInstanceQueryModel) Query as page.queryVariableInstances
(@NotNull HvlBpmnExecutionVariableQueryModel executionVariableQueryModel) Query variable instances map.queryVariables
(@NotNull HvlBpmnExecutionVariableQueryModel executionVariableQueryModel) Query variables map.void
removeEventListener
(@NotNull org.flowable.common.engine.api.delegate.event.FlowableEventListener listenerToRemove) Removes the given listener from this dispatcher.void
removeEventRegistryConsumer
(@NotNull org.flowable.eventregistry.api.EventRegistryEventConsumer eventConsumer) Remove event registry consumer.void
removeVariable
(@NotNull HvlBpmnExecutionVariableQueryModel executionVariableQueryModel) Removes a variable for an execution.void
setProcessInstanceName
(@NotBlank String processInstanceId, String name) Sets the name for the process instance with the given id.void
setVariable
(@NotBlank String executionId, @NotBlank String variableName, Object value, boolean isLocal) Update or create a variable for an execution.void
setVariables
(@NotBlank String executionId, @NotEmpty Map<String, ? extends Object> variables, boolean isLocal) Update or create given variables for an execution (including parent scopes).void
signalEventReceived
(@NotNull HvlBpmnSignalEventModel signalEventModel) Notifies the process engine that a signal event of name 'signalName' has been received.startProcessInstanceById
(@NotBlank String processDefinitionId, HvlBpmnStartProcessInstanceModel startProcessInstanceModel) Starts a new process instance in the latest version of the process definition with the given process definition query model.startProcessInstanceByKey
(@NotBlank String processDefinitionKey, HvlBpmnStartProcessInstanceModel startProcessInstanceModel) Start process instance by key process instance.startProcessInstanceByMessage
(@NotBlank String messageName, HvlBpmnStartProcessInstanceModel startProcessInstanceModel) Signals the process engine that a message is received and starts a newProcessInstance
.void
suspendProcessInstanceById
(@NotBlank String processInstanceId) Suspends the process instance with the given id.void
trigger
(@NotNull HvlBpmnTriggerModel flowableTriggerModel) Sends an external trigger to an activity instance that is waiting inside the given execution.void
updateBusinessKey
(@NotBlank String processInstanceId, String businessKey) Updates the business key for the provided process instancevoid
updateBusinessStatus
(@NotBlank String processInstanceId, String businessStatus) Updates the business status for the provided process instance
-
Method Details
-
createProcessInstanceBuilder
org.flowable.engine.runtime.ProcessInstanceBuilder createProcessInstanceBuilder()Create aProcessInstanceBuilder
, that allows to set various options for starting a process instance, as an alternative to the various startProcessInstanceByXX methods.- Returns:
- the process instance builder
-
startProcessInstanceById
HvlBpmnProcessInstanceModel startProcessInstanceById(@NotBlank @NotBlank String processDefinitionId, HvlBpmnStartProcessInstanceModel startProcessInstanceModel) Starts a new process instance in the latest version of the process definition with the given process definition query model.- Parameters:
processDefinitionId
- the process definition idstartProcessInstanceModel
- the start process instance model- Returns:
- the process instance
- Throws:
org.flowable.common.engine.api.FlowableObjectNotFoundException
- when no process definition is deployed with the given key.
-
startProcessInstanceByKey
HvlBpmnProcessInstanceModel startProcessInstanceByKey(@NotBlank @NotBlank String processDefinitionKey, HvlBpmnStartProcessInstanceModel startProcessInstanceModel) Start process instance by key process instance.- Parameters:
processDefinitionKey
- the process definition keystartProcessInstanceModel
- the start process instance model- Returns:
- the process instance
-
startProcessInstanceByMessage
HvlBpmnProcessInstanceModel startProcessInstanceByMessage(@NotBlank @NotBlank String messageName, HvlBpmnStartProcessInstanceModel startProcessInstanceModel) Signals the process engine that a message is received and starts a new
ProcessInstance
.Calling this method can have two different outcomes:
- If the message name is associated with a message start event, a new process instance is started.
- If no subscription to a message with the given name exists,
FlowableException
is thrown
- Parameters:
messageName
- the 'name' of the message as specified as an attribute on the bpmn20<message name="messageName" />
element.startProcessInstanceModel
- the start process instance model- Returns:
- the
ProcessInstance
object representing the started process instance - Throws:
org.flowable.common.engine.api.FlowableException
- if no subscription to a message with the given name exists- Since:
- 5.9
-
deleteProcessInstance
Delete an existing runtime process instance.- Parameters:
processInstanceId
- id of process instance to delete, cannot be null.deleteReason
- reason for deleting, can be null.- Throws:
org.flowable.common.engine.api.FlowableObjectNotFoundException
- when no process instance is found with the given id.
-
getActiveActivityIds
Finds the activity ids for all executions that are waiting in activities. This is a list because a single activity can be active multiple times.- Parameters:
processInstanceId
- id of the process instance, cannot be null.- Returns:
- the active activity ids
- Throws:
org.flowable.common.engine.api.FlowableObjectNotFoundException
- when no execution exists with the given processInstanceId.
-
trigger
Sends an external trigger to an activity instance that is waiting inside the given execution.- Parameters:
flowableTriggerModel
- the flowable trigger model- Throws:
org.flowable.common.engine.api.FlowableObjectNotFoundException
- when no execution is found for the given executionId.
-
evaluateConditionalEvents
Evaluate waiting conditional events (boundary, intermediate catch and event sub process start events) and trigger them if a condition evaluates to true.- Parameters:
processInstanceId
- id of process instance, cannot be null.- Throws:
org.flowable.common.engine.api.FlowableObjectNotFoundException
- when no execution is found for the given processInstanceId.
-
evaluateConditionalEvents
void evaluateConditionalEvents(@NotBlank @NotBlank String processInstanceId, Map<String, Object> processVariables) Evaluate waiting conditional events (boundary, intermediate catch and event sub process start events) and trigger them if a condition evaluates to true.- Parameters:
processInstanceId
- id of process instance, cannot be null.processVariables
- a map of process variables to be set before evaluation- Throws:
org.flowable.common.engine.api.FlowableObjectNotFoundException
- when no execution is found for the given processInstanceId.
-
updateBusinessKey
Updates the business key for the provided process instance- Parameters:
processInstanceId
- id of the process instance to set the business key, cannot be nullbusinessKey
- new businessKey value
-
updateBusinessStatus
Updates the business status for the provided process instance- Parameters:
processInstanceId
- id of the process instance to set the business status, cannot be nullbusinessStatus
- new business status value
-
addUserIdentityLink
void addUserIdentityLink(@NotBlank @NotBlank String processInstanceId, @NotBlank @NotBlank String userId, @NotBlank @NotBlank String identityLinkType) Involves a user with a process instance. The type of identity link is defined by the given identityLinkType.- Parameters:
processInstanceId
- id of the process instance, cannot be null.userId
- id of the user involve, cannot be null.identityLinkType
- type of identityLink, cannot be null (@seeIdentityLinkType
).- Throws:
org.flowable.common.engine.api.FlowableObjectNotFoundException
- when the process instance doesn't exist.
-
addGroupIdentityLink
void addGroupIdentityLink(@NotBlank @NotBlank String processInstanceId, @NotBlank @NotBlank String groupId, @NotBlank @NotBlank String identityLinkType) Involves a group with a process instance. The type of identityLink is defined by the given identityLink.- Parameters:
processInstanceId
- id of the process instance, cannot be null.groupId
- id of the group to involve, cannot be null.identityLinkType
- type of identity, cannot be null (@seeIdentityLinkType
).- Throws:
org.flowable.common.engine.api.FlowableObjectNotFoundException
- when the process instance or group doesn't exist.
-
addParticipantUser
void addParticipantUser(@NotBlank @NotBlank String processInstanceId, @NotBlank @NotBlank String userId) Convenience shorthand foraddUserIdentityLink(String, String, String)
; with typeIdentityLinkType.PARTICIPANT
- Parameters:
processInstanceId
- id of the process instance, cannot be null.userId
- id of the user to use as candidate, cannot be null.- Throws:
org.flowable.common.engine.api.FlowableObjectNotFoundException
- when the task or user doesn't exist.
-
addParticipantGroup
void addParticipantGroup(@NotBlank @NotBlank String processInstanceId, @NotBlank @NotBlank String groupId) Convenience shorthand foraddGroupIdentityLink(String, String, String)
; with typeIdentityLinkType.PARTICIPANT
- Parameters:
processInstanceId
- id of the process instance, cannot be null.groupId
- id of the group to use as candidate, cannot be null.- Throws:
org.flowable.common.engine.api.FlowableObjectNotFoundException
- when the task or group doesn't exist.
-
deleteParticipantUser
void deleteParticipantUser(@NotBlank @NotBlank String processInstanceId, @NotBlank @NotBlank String userId) Convenience shorthand fordeleteUserIdentityLink(String, String, String)
; with typeIdentityLinkType.PARTICIPANT
- Parameters:
processInstanceId
- id of the process instance, cannot be null.userId
- id of the user to use as candidate, cannot be null.- Throws:
org.flowable.common.engine.api.FlowableObjectNotFoundException
- when the task or user doesn't exist.
-
deleteParticipantGroup
void deleteParticipantGroup(@NotBlank @NotBlank String processInstanceId, @NotBlank @NotBlank String groupId) Convenience shorthand fordeleteGroupIdentityLink(String, String, String)
; with typeIdentityLinkType.PARTICIPANT
- Parameters:
processInstanceId
- id of the process instance, cannot be null.groupId
- id of the group to use as candidate, cannot be null.- Throws:
org.flowable.common.engine.api.FlowableObjectNotFoundException
- when the task or group doesn't exist.
-
deleteUserIdentityLink
void deleteUserIdentityLink(@NotBlank @NotBlank String processInstanceId, @NotBlank @NotBlank String userId, @NotBlank @NotBlank String identityLinkType) Removes the association between a user and a process instance for the given identityLinkType.- Parameters:
processInstanceId
- id of the process instance, cannot be null.userId
- id of the user involve, cannot be null.identityLinkType
- type of identityLink, cannot be null (@seeIdentityLinkType
).- Throws:
org.flowable.common.engine.api.FlowableObjectNotFoundException
- when the task or user doesn't exist.
-
deleteGroupIdentityLink
void deleteGroupIdentityLink(@NotBlank @NotBlank String processInstanceId, @NotBlank @NotBlank String groupId, @NotBlank @NotBlank String identityLinkType) Removes the association between a group and a process instance for the given identityLinkType.- Parameters:
processInstanceId
- id of the process instance, cannot be null.groupId
- id of the group to involve, cannot be null.identityLinkType
- type of identity, cannot be null (@seeIdentityLinkType
).- Throws:
org.flowable.common.engine.api.FlowableObjectNotFoundException
- when the task or group doesn't exist.
-
getIdentityLinksForProcessInstance
List<org.flowable.identitylink.api.IdentityLink> getIdentityLinksForProcessInstance(@NotBlank @NotBlank String instanceId) Retrieves theIdentityLink
s associated with the given process instance. Such anIdentityLink
informs how a certain user is involved with a process instance.- Parameters:
instanceId
- the instance id- Returns:
- the identity links for process instance
-
queryVariables
Map<String,Object> queryVariables(@NotNull @NotNull HvlBpmnExecutionVariableQueryModel executionVariableQueryModel) Query variables map.- Parameters:
executionVariableQueryModel
- the execution variable query model- Returns:
- the map
-
queryVariableInstances
Map<String,org.flowable.variable.api.persistence.entity.VariableInstance> queryVariableInstances(@NotNull @NotNull HvlBpmnExecutionVariableQueryModel executionVariableQueryModel) Query variable instances map.- Parameters:
executionVariableQueryModel
- the execution variable query model- Returns:
- the map
-
getVariableInstancesByExecutionIds
List<org.flowable.variable.api.persistence.entity.VariableInstance> getVariableInstancesByExecutionIds(@NotEmpty @NotEmpty Set<String> executionIds) All variables visible from the given execution scope (including parent scopes).- Parameters:
executionIds
- ids of execution, cannot be null.- Returns:
- the variables.
-
getVariable
Object getVariable(@NotNull @NotNull HvlBpmnExecutionVariableQueryModel executionVariableQueryModel) The variable value. Searching for the variable is done in all scopes that are visible to the given execution (including parent scopes). Returns null when no variable value is found with the given name or when the value is set to null.- Parameters:
executionVariableQueryModel
- the execution variable query model- Returns:
- the variable value or null if the variable is undefined or the value of the variable is null.
- Throws:
org.flowable.common.engine.api.FlowableObjectNotFoundException
- when no execution is found for the given executionId.
-
getVariableInstance
org.flowable.variable.api.persistence.entity.VariableInstance getVariableInstance(@NotNull @NotNull HvlBpmnExecutionVariableQueryModel executionVariableQueryModel) The variable. Searching for the variable is done in all scopes that are visible to the given execution (including parent scopes). Returns null when no variable value is found with the given name or when the value is set to null.- Parameters:
executionVariableQueryModel
- the execution variable query model- Returns:
- the variable or null if the variable is undefined.
- Throws:
org.flowable.common.engine.api.FlowableObjectNotFoundException
- when no execution is found for the given executionId.
-
getVariable
<T> T getVariable(@NotNull @NotNull HvlBpmnExecutionVariableQueryModel executionVariableQueryModel, @NotNull @NotNull Class<T> variableClass) The variable value. Searching for the variable is done in all scopes that are visible to the given execution (including parent scopes). Returns null when no variable value is found with the given name or when the value is set to null. Throws ClassCastException when cannot cast variable to given class- Type Parameters:
T
- the type parameter- Parameters:
executionVariableQueryModel
- the execution variable query modelvariableClass
- name of variable, cannot be null.- Returns:
- the variable value or null if the variable is undefined or the value of the variable is null.
- Throws:
org.flowable.common.engine.api.FlowableObjectNotFoundException
- when no execution is found for the given executionId.
-
hasVariable
boolean hasVariable(@NotNull @NotNull HvlBpmnExecutionVariableQueryModel executionVariableQueryModel) Check whether or not this execution has variable set with the given name, Searching for the variable is done in all scopes that are visible to the given execution (including parent scopes).- Parameters:
executionVariableQueryModel
- the execution variable query model- Returns:
- the boolean
-
setVariable
void setVariable(@NotBlank @NotBlank String executionId, @NotBlank @NotBlank String variableName, Object value, boolean isLocal) Update or create a variable for an execution.The variable is set according to the algorithm as documented for
VariableScope.setVariable(String, Object)
.- Parameters:
executionId
- id of execution to set variable in, cannot be null.variableName
- name of variable to set, cannot be null.value
- value to set. When null is passed, the variable is not removed, only it's value will be set to null.isLocal
- the is local- Throws:
org.flowable.common.engine.api.FlowableObjectNotFoundException
- when no execution is found for the given executionId.- See Also:
-
VariableScope#setVariable(String, Object)VariableScope#setVariable(String, Object)
-
setVariables
void setVariables(@NotBlank @NotBlank String executionId, @NotEmpty @NotEmpty Map<String, ? extends Object> variables, boolean isLocal) Update or create given variables for an execution (including parent scopes).Variables are set according to the algorithm as documented for
VariableScope.setVariables(Map)
, applied separately to each variable.- Parameters:
executionId
- id of the execution, cannot be null.variables
- map containing name (key) and value of variables, can be null.isLocal
- the is local- Throws:
org.flowable.common.engine.api.FlowableObjectNotFoundException
- when no execution is found for the given executionId.- See Also:
-
VariableScope#setVariables(Map)VariableScope#setVariables(Map)
-
removeVariable
void removeVariable(@NotNull @NotNull HvlBpmnExecutionVariableQueryModel executionVariableQueryModel) Removes a variable for an execution.- Parameters:
executionVariableQueryModel
- the execution variable query model
-
getDataObjects
Map<String,org.flowable.engine.runtime.DataObject> getDataObjects(@NotNull @NotNull HvlBpmnExecutionDataObjectQueryModel executionDataObjectQueryModel) All DataObjects visible from the given execution scope (including parent scopes).- Parameters:
executionDataObjectQueryModel
- data object query model- Returns:
- the DataObjects or an empty map if no such variables are found.
- Throws:
org.flowable.common.engine.api.FlowableObjectNotFoundException
- when no execution is found for the given executionId.
-
getDataObject
org.flowable.engine.runtime.DataObject getDataObject(@NotNull @NotNull HvlBpmnExecutionDataObjectQueryModel executionDataObjectQueryModel) The DataObject. Searching for the DataObject is done in all scopes that are visible to the given execution (including parent scopes). Returns null when no DataObject value is found with the given name or when the value is set to null.- Parameters:
executionDataObjectQueryModel
- data object query model- Returns:
- the DataObject or null if the variable is undefined.
- Throws:
org.flowable.common.engine.api.FlowableObjectNotFoundException
- when no execution is found for the given executionId.
-
createExecutionQuery
org.flowable.engine.runtime.ExecutionQuery createExecutionQuery()Creates a newExecutionQuery
instance, that can be used to query the executions and process instances.- Returns:
- the execution query
-
createNativeExecutionQuery
org.flowable.engine.runtime.NativeExecutionQuery createNativeExecutionQuery()creates a newNativeExecutionQuery
to queryExecution
s by SQL directly- Returns:
- the native execution query
-
createProcessInstanceQuery
org.flowable.engine.runtime.ProcessInstanceQuery createProcessInstanceQuery()Creates a newProcessInstanceQuery
instance, that can be used to query process instances.- Returns:
- the process instance query
-
createNativeProcessInstanceQuery
org.flowable.engine.runtime.NativeProcessInstanceQuery createNativeProcessInstanceQuery()creates a newNativeProcessInstanceQuery
to queryProcessInstance
s by SQL directly- Returns:
- the native process instance query
-
createActivityInstanceQuery
org.flowable.engine.runtime.ActivityInstanceQuery createActivityInstanceQuery()Creates a newActivityInstanceQuery
instance, that can be used to query activities in the currently running process instances.- Returns:
- the activity instance query
-
createNativeActivityInstanceQuery
org.flowable.engine.runtime.NativeActivityInstanceQuery createNativeActivityInstanceQuery()creates a newNativeActivityInstanceQuery
to queryActivityInstance
s which are included in the cuby SQL directly.- Returns:
- the native activity instance query
-
createEventSubscriptionQuery
org.flowable.eventsubscription.api.EventSubscriptionQuery createEventSubscriptionQuery()Creates a newEventSubscriptionQuery
instance, that can be used to query the event subscriptions.- Returns:
- the event subscription query
-
suspendProcessInstanceById
Suspends the process instance with the given id.If a process instance is in state suspended, flowable will not execute jobs (timers, messages) associated with this instance.
If you have a process instance hierarchy, suspending one process instance form the hierarchy will not suspend other process instances form that hierarchy.
- Parameters:
processInstanceId
- the process instance id- Throws:
org.flowable.common.engine.api.FlowableObjectNotFoundException
- if no such processInstance can be found.org.flowable.common.engine.api.FlowableException
- the process instance is already in state suspended.
-
activateProcessInstanceById
Activates the process instance with the given id.If you have a process instance hierarchy, suspending one process instance form the hierarchy will not suspend other process instances form that hierarchy.
- Parameters:
processInstanceId
- the process instance id- Throws:
org.flowable.common.engine.api.FlowableObjectNotFoundException
- if no such processInstance can be found.org.flowable.common.engine.api.FlowableException
- if the process instance is already in state active.
-
signalEventReceived
Notifies the process engine that a signal event of name 'signalName' has been received. This method delivers the signal to all executions waiting on the signal.
NOTE: The waiting executions are notified synchronously.- Parameters:
signalEventModel
- signal event model
-
messageEventReceived
Notifies the process engine that a message event with name 'messageName' has been received and has been correlated to an execution with id 'executionId'.The waiting execution is notified synchronously.
- Parameters:
messageEventModel
- message event query model- Throws:
org.flowable.common.engine.api.FlowableObjectNotFoundException
- if no such execution exists.org.flowable.common.engine.api.FlowableException
- if the execution has not subscribed to the signal
-
addEventListener
void addEventListener(@NotNull @NotNull org.flowable.common.engine.api.delegate.event.FlowableEventListener listenerToAdd) Adds an event-listener which will be notified of ALL events by the dispatcher.- Parameters:
listenerToAdd
- the listener to add
-
addEventListener
void addEventListener(@NotNull @NotNull org.flowable.common.engine.api.delegate.event.FlowableEventListener listenerToAdd, org.flowable.common.engine.api.delegate.event.FlowableEngineEventType... types) Adds an event-listener which will only be notified when an event occurs, which type is in the given types.- Parameters:
listenerToAdd
- the listener to addtypes
- types of events the listener should be notified for
-
removeEventListener
void removeEventListener(@NotNull @NotNull org.flowable.common.engine.api.delegate.event.FlowableEventListener listenerToRemove) Removes the given listener from this dispatcher. The listener will no longer be notified, regardless of the type(s) it was registered for in the first place.- Parameters:
listenerToRemove
- listener to remove
-
dispatchEvent
void dispatchEvent(@NotNull @NotNull org.flowable.common.engine.api.delegate.event.FlowableEvent event) Dispatches the given event to any listeners that are registered.- Parameters:
event
- event to dispatch.- Throws:
org.flowable.common.engine.api.FlowableException
- if an exception occurs when dispatching the event or when theFlowableEventDispatcher
is disabled.org.flowable.common.engine.api.FlowableIllegalArgumentException
- when the given event is not suitable for dispatching.
-
addEventRegistryConsumer
void addEventRegistryConsumer(@NotNull @NotNull org.flowable.eventregistry.api.EventRegistryEventConsumer eventConsumer) Add event registry consumer.- Parameters:
eventConsumer
- the event consumer
-
removeEventRegistryConsumer
void removeEventRegistryConsumer(@NotNull @NotNull org.flowable.eventregistry.api.EventRegistryEventConsumer eventConsumer) Remove event registry consumer.- Parameters:
eventConsumer
- the event consumer
-
setProcessInstanceName
Sets the name for the process instance with the given id.- Parameters:
processInstanceId
- id of the process instance to updatename
- new name for the process instance- Throws:
org.flowable.common.engine.api.FlowableObjectNotFoundException
- when the given process instance does not exist.
-
getAdhocSubProcessExecutions
List<org.flowable.engine.runtime.Execution> getAdhocSubProcessExecutions(@NotBlank @NotBlank String processInstanceId) Gets executions with an adhoc sub process as current flow element- Parameters:
processInstanceId
- id of the process instance that is used to search for child executions- Returns:
- a list of executions
-
getEnabledActivitiesFromAdhocSubProcess
List<org.flowable.bpmn.model.FlowNode> getEnabledActivitiesFromAdhocSubProcess(@NotBlank @NotBlank String executionId) Gets enabled activities from ad-hoc sub process- Parameters:
executionId
- id of the execution that has an ad-hoc sub process as current flow element- Returns:
- a list of enabled activities
-
executeActivityInAdhocSubProcess
org.flowable.engine.runtime.Execution executeActivityInAdhocSubProcess(@NotBlank @NotBlank String executionId, @NotBlank @NotBlank String activityId) Executes an activity in a ad-hoc sub process- Parameters:
executionId
- id of the execution that has an ad-hoc sub process as current flow elementactivityId
- id of the activity id to enable- Returns:
- the newly created execution of the enabled activity
-
completeAdhocSubProcess
Completes the ad-hoc sub process- Parameters:
executionId
- id of the execution that has an ad-hoc sub process as current flow element
-
createChangeActivityStateBuilder
org.flowable.engine.runtime.ChangeActivityStateBuilder createChangeActivityStateBuilder()Create aChangeActivityStateBuilder
, that allows to set various options for changing the state of a process instance.- Returns:
- the change activity state builder
-
addMultiInstanceExecution
org.flowable.engine.runtime.Execution addMultiInstanceExecution(@NotBlank @NotBlank String activityId, @NotBlank @NotBlank String parentExecutionId, Map<String, Object> executionVariables) Adds a new execution to a running multi-instance parent execution- Parameters:
activityId
- id of the multi-instance activity (id attribute in the BPMN XML)parentExecutionId
- can be the process instance id, in case there's one multi-instance execution for the provided activity id. In case of multiple multi-instance executions with the same activity id this can be a specific parent execution id.executionVariables
- variables to be set on as local variable on the newly created multi-instance execution- Returns:
- the newly created multi-instance execution
-
deleteMultiInstanceExecution
void deleteMultiInstanceExecution(@NotBlank @NotBlank String executionId, boolean executionIsCompleted) Deletes a multi-instance execution- Parameters:
executionId
- id of the multi-instance execution to be deletedexecutionIsCompleted
- defines if the deleted execution should be marked as completed on the parent multi-instance execution
-
getProcessInstanceEvents
List<org.flowable.engine.task.Event> getProcessInstanceEvents(@NotBlank @NotBlank String processInstanceId) The all events related to the given Process Instance.- Parameters:
processInstanceId
- the process instance id- Returns:
- the process instance events
-
queryPage
tr.com.havelsan.javarch.data.commons.pageable.HvlPage<HvlBpmnProcessInstanceModel> queryPage(@NotNull @RequestBody @NotNull HvlBpmnProcessInstanceQueryModel processInstanceQueryModel) Query as page.- Parameters:
processInstanceQueryModel
- the process instance query model- Returns:
- the hvl page
-