public abstract class AbstractWorkflowDefinition<S extends WorkflowState> extends ModelObject
| Modifier and Type | Field and Description |
|---|---|
protected Map<String,List<String>> |
allowedTransitions |
protected Map<String,WorkflowState> |
failureTransitions |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractWorkflowDefinition(String type,
S initialState,
S errorState) |
protected |
AbstractWorkflowDefinition(String type,
S initialState,
S errorState,
WorkflowSettings settings) |
protected |
AbstractWorkflowDefinition(String type,
S initialState,
S errorState,
WorkflowSettings settings,
Map<String,WorkflowStateMethod> stateMethods) |
| Modifier and Type | Method and Description |
|---|---|
Map<String,List<String>> |
getAllowedTransitions()
Return allowed transitions between the states of the workflow.
|
String |
getDescription()
Return the description of the workflow.
|
S |
getErrorState()
Return the generic error state of the workflow.
|
Map<String,WorkflowState> |
getFailureTransitions()
Return transitions from states to failure states.
|
S |
getInitialState()
Return the initial state of the workflow.
|
WorkflowStateMethod |
getMethod(String stateName)
Returns the workflow state method for the given state name.
|
String |
getName()
Return the name of the workflow.
|
WorkflowSettings |
getSettings()
Return the workflow settings.
|
WorkflowState |
getState(String state)
Returns the workflow state for the given state name.
|
abstract Set<S> |
getStates()
Return all possible states of the workflow.
|
Map<Integer,String> |
getSupportedSignals()
Return signals supported by this workflow.
|
String |
getType()
Return the type of the workflow.
|
boolean |
isAllowedNextAction(WorkflowInstance instance,
NextAction nextAction)
Return true if the given nextAction is permitted for given instance.
|
boolean |
isStartState(String state)
Check if the given state is a valid start state.
|
protected AbstractWorkflowDefinition<S> |
permit(S originState,
S targetState)
Add a state transition to the allowed transitions.
|
protected AbstractWorkflowDefinition<S> |
permit(S originState,
S targetState,
S failureState)
Add a state and failure state transitions to the allowed transitions.
|
void |
setDescription(String description)
Set the description of the workflow.
|
void |
setName(String name)
Set the name of the workflow.
|
equals, hashCode, toStringprotected final Map<String,WorkflowState> failureTransitions
protected AbstractWorkflowDefinition(String type, S initialState, S errorState)
protected AbstractWorkflowDefinition(String type, S initialState, S errorState, WorkflowSettings settings)
protected AbstractWorkflowDefinition(String type, S initialState, S errorState, WorkflowSettings settings, Map<String,WorkflowStateMethod> stateMethods)
public String getName()
public void setName(String name)
name - The name.public String getDescription()
public void setDescription(String description)
description - The description.public String getType()
public S getInitialState()
public S getErrorState()
public abstract Set<S> getStates()
public Map<String,List<String>> getAllowedTransitions()
public Map<String,WorkflowState> getFailureTransitions()
protected AbstractWorkflowDefinition<S> permit(S originState, S targetState)
originState - The origin state.targetState - The target state.protected AbstractWorkflowDefinition<S> permit(S originState, S targetState, S failureState)
originState - The origin state.targetState - The target state.failureState - The failure state.public WorkflowSettings getSettings()
public WorkflowStateMethod getMethod(String stateName)
stateName - The name of the workflow state.public WorkflowState getState(String state)
state - The name of the workflow state.IllegalStateException - when a matching state can not be found.public boolean isStartState(String state)
state - The name of the workflow state.IllegalStateException - if the given state name does not match any state.public boolean isAllowedNextAction(WorkflowInstance instance, NextAction nextAction)
instance - The workflow instance for which the action is checked.nextAction - The action to be checked.Copyright © 2014–2020 Nitor Creations. All rights reserved.