@Component public class WorkflowInstanceService extends Object
| Constructor and Description |
|---|
WorkflowInstanceService(WorkflowInstanceDao workflowInstanceDao,
WorkflowDefinitionService workflowDefinitionService,
WorkflowInstancePreProcessor workflowInstancePreProcessor) |
| Modifier and Type | Method and Description |
|---|---|
Optional<Integer> |
getSignal(long workflowInstanceId)
Return current signal value for given workflow instance.
|
WorkflowInstance |
getWorkflowInstance(long id,
Set<WorkflowInstanceInclude> includes,
Long maxActions)
Return the workflow instance matching the given id.
|
long |
insertWorkflowInstance(WorkflowInstance instance)
Insert the workflow instance to the database and return the id of the
instance.
|
Collection<WorkflowInstance> |
listWorkflowInstances(QueryWorkflowInstances query)
Return workflow instances matching the given query.
|
Stream<WorkflowInstance> |
listWorkflowInstancesAsStream(QueryWorkflowInstances query)
Return workflow instances matching the given query.
|
boolean |
setSignal(long workflowInstanceId,
Optional<Integer> signal,
String reason,
WorkflowInstanceAction.WorkflowActionType actionType)
Set signal value for given workflow instance.
|
boolean |
updateWorkflowInstance(WorkflowInstance instance,
WorkflowInstanceAction action)
Update the workflow instance in the database if it is currently not running, and insert the workflow instance action.
|
boolean |
wakeupWorkflowInstance(long id,
List<String> expectedStates)
Wake up the workflow instance matching the given id if it is in one of the expected states.
|
@Inject public WorkflowInstanceService(WorkflowInstanceDao workflowInstanceDao, WorkflowDefinitionService workflowDefinitionService, WorkflowInstancePreProcessor workflowInstancePreProcessor)
public WorkflowInstance getWorkflowInstance(long id, Set<WorkflowInstanceInclude> includes, Long maxActions)
id - Workflow instance id.includes - Set of properties to be loaded.maxActions - Maximum number of actions to be loaded.EmptyResultDataAccessException - If workflow instance is not found.public long insertWorkflowInstance(WorkflowInstance instance)
instance - The workflow instance to be inserted.@Transactional public boolean updateWorkflowInstance(WorkflowInstance instance, WorkflowInstanceAction action)
instance - The instance to be updated.action - The action to be inserted.@Transactional public boolean wakeupWorkflowInstance(long id, List<String> expectedStates)
id - Workflow instance id.expectedStates - The expected states, empty for any.public Collection<WorkflowInstance> listWorkflowInstances(QueryWorkflowInstances query)
query - The query parameters.public Stream<WorkflowInstance> listWorkflowInstancesAsStream(QueryWorkflowInstances query)
query - The query parameters.public Optional<Integer> getSignal(long workflowInstanceId)
workflowInstanceId - Workflow instance id.public boolean setSignal(long workflowInstanceId,
Optional<Integer> signal,
String reason,
WorkflowInstanceAction.WorkflowActionType actionType)
workflowInstanceId - Workflow instance id.signal - New value for the signal.reason - The reason for setting the signal.actionType - The type of workflow action that is stored to instance actions.Copyright © 2014–2020 Nitor Creations. All rights reserved.