public interface StateExecution
Modifier and Type | Method and Description |
---|---|
void |
addChildWorkflows(WorkflowInstance... childWorkflows)
Add new child workflows.
|
void |
addWorkflows(WorkflowInstance... workflows)
Add new workflows.
|
List<WorkflowInstance> |
getAllChildWorkflows()
Return all child workflows for current workflow.
|
String |
getBusinessKey()
Return the business key associated to the workflow instance.
|
Optional<Integer> |
getParentId()
Return the parent workflow instance id if this is a child workflow, otherwise return empty.
|
int |
getRetries()
Return the number of retry attempts in the current state.
|
Optional<Integer> |
getSignal()
Return the signal value from database if it has been set, otherwise return empty.
|
String |
getVariable(String name)
Return a string value of the given variable.
|
<T> T |
getVariable(String name,
Class<T> type)
Return the value of the given variable.
|
<T> T |
getVariable(String name,
Class<T> type,
T defaultValue)
Return the value of the given variable, or {code defaultValue} if the variable does not
exist.
|
String |
getVariable(String name,
String defaultValue)
Return the string value of the given variable, or {code defaultValue} if
the variable does not exist.
|
String |
getWorkflowInstanceExternalId()
Return the external id of the workflow instance.
|
int |
getWorkflowInstanceId()
Return the id of the workflow instance.
|
List<WorkflowInstance> |
queryChildWorkflows(QueryWorkflowInstances query)
Return child workflow instances for current workflow.
|
void |
setCreateAction(boolean createAction)
Control if action is created when workflow instance is update to the database after state processing.
|
void |
setSignal(Optional<Integer> signal,
String reason)
Set the signal value to the database.
|
void |
setVariable(String name,
Object value)
Set the value for the given varible.
|
void |
setVariable(String name,
String value)
Set the string value of the given variable.
|
void |
wakeUpParentWorkflow(String... expectedStates)
Notify parent workflow that it may start processing again.
|
WorkflowInstance.Builder |
workflowInstanceBuilder()
Create a builder for creating child workflows.
|
int getWorkflowInstanceId()
String getBusinessKey()
int getRetries()
String getVariable(String name)
name
- The name of the variable.<T> T getVariable(String name, Class<T> type)
T
- The type of object to be deserialized.name
- The name of the variable.type
- The class of the variable.String getVariable(String name, String defaultValue)
name
- The name of the variable.defaultValue
- The default value if the variable does not exist.<T> T getVariable(String name, Class<T> type, T defaultValue)
T
- The type of object to be deserialized.name
- The name of the variable.type
- The class of the variable.defaultValue
- The default value if the variable does not exist.void setVariable(String name, String value)
name
- The name of the variable.value
- The string value for the varible.void setVariable(String name, Object value)
name
- The name of the variable.value
- The value for the variable.String getWorkflowInstanceExternalId()
void addChildWorkflows(WorkflowInstance... childWorkflows)
childWorkflows
- Child workflows to create.void addWorkflows(WorkflowInstance... workflows)
workflows
- Workflows to create.List<WorkflowInstance> queryChildWorkflows(QueryWorkflowInstances query)
query
- The query criterias.List<WorkflowInstance> getAllChildWorkflows()
void wakeUpParentWorkflow(String... expectedStates)
expectedStates
- If parent state is not one of the expected states, it is not woken up. If no expected states are
given, parent workflow is woken up regardless of the state.WorkflowInstance.Builder workflowInstanceBuilder()
void setCreateAction(boolean createAction)
createAction
- Whether action should be created or not.Optional<Integer> getSignal()
void setSignal(Optional<Integer> signal, String reason)
signal
- Signal value to be set.reason
- The reason for setting the signal.Copyright © 2014–2017 Nitor Creations. All rights reserved.