public class ProcessCtrlStateMachineEngine extends Object implements StateMachineEngine
| Constructor and Description |
|---|
ProcessCtrlStateMachineEngine() |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
checkStatus(StateMachineInstance stateMachineInstance,
ExecutionStatus[] acceptStatus,
ExecutionStatus[] denyStatus,
ExecutionStatus status,
ExecutionStatus compenStatus,
String operation)
Check if the status is legal
|
StateMachineInstance |
compensate(String stateMachineInstId,
Map<String,Object> replaceParams)
compensate a state machine instance
|
StateMachineInstance |
compensateAsync(String stateMachineInstId,
Map<String,Object> replaceParams,
AsyncCallback callback)
compensate a state machine instance asynchronously
|
StateMachineInstance |
compensateInternal(String stateMachineInstId,
Map<String,Object> replaceParams,
boolean async,
AsyncCallback callback) |
StateInstance |
findOutLastForwardStateInstance(List<StateInstance> stateInstanceList)
Find the last instance of the forward execution state
|
StateMachineInstance |
forward(String stateMachineInstId,
Map<String,Object> replaceParams)
forward restart a failed state machine instance
|
StateMachineInstance |
forwardAsync(String stateMachineInstId,
Map<String,Object> replaceParams,
AsyncCallback callback)
forward restart a failed state machine instance asynchronously
|
protected StateMachineInstance |
forwardInternal(String stateMachineInstId,
Map<String,Object> replaceParams,
boolean skip,
boolean async,
AsyncCallback callback) |
StateMachineConfig |
getStateMachineConfig()
get state machine configurations
|
StateMachineInstance |
reloadStateMachineInstance(String instId)
override state machine instance
|
protected Map<String,Object> |
replayContextVariables(StateMachineInstance stateMachineInstance) |
void |
setStateMachineConfig(StateMachineConfig stateMachineConfig) |
StateMachineInstance |
skipAndForward(String stateMachineInstId,
Map<String,Object> replaceParams)
skip current failed state instance and forward restart state machine instance
|
StateMachineInstance |
skipAndForwardAsync(String stateMachineInstId,
AsyncCallback callback)
skip current failed state instance and forward restart state machine instance asynchronously
|
StateMachineInstance |
start(String stateMachineName,
String tenantId,
Map<String,Object> startParams)
start a state machine instance
|
StateMachineInstance |
startAsync(String stateMachineName,
String tenantId,
Map<String,Object> startParams,
AsyncCallback callback)
start a state machine instance asynchronously
|
StateMachineInstance |
startWithBusinessKey(String stateMachineName,
String tenantId,
String businessKey,
Map<String,Object> startParams)
start a state machine instance with businessKey
|
StateMachineInstance |
startWithBusinessKeyAsync(String stateMachineName,
String tenantId,
String businessKey,
Map<String,Object> startParams,
AsyncCallback callback)
start a state machine instance asynchronously with businessKey
|
public StateMachineInstance start(String stateMachineName, String tenantId, Map<String,Object> startParams) throws EngineExecutionException
StateMachineEnginestart in interface StateMachineEnginestateMachineName - the state machine nametenantId - the tenant idstartParams - the start paramsEngineExecutionException - the engine execution exceptionpublic StateMachineInstance startAsync(String stateMachineName, String tenantId, Map<String,Object> startParams, AsyncCallback callback) throws EngineExecutionException
StateMachineEnginestartAsync in interface StateMachineEnginestateMachineName - the state machine nametenantId - the tenant idstartParams - the start paramscallback - callback after start machineEngineExecutionException - the engine execution exceptionpublic StateMachineInstance startWithBusinessKey(String stateMachineName, String tenantId, String businessKey, Map<String,Object> startParams) throws EngineExecutionException
StateMachineEnginestartWithBusinessKey in interface StateMachineEnginestateMachineName - the state machine nametenantId - the tenant idbusinessKey - the businessKeystartParams - the start paramsEngineExecutionException - the engine execution exceptionpublic StateMachineInstance startWithBusinessKeyAsync(String stateMachineName, String tenantId, String businessKey, Map<String,Object> startParams, AsyncCallback callback) throws EngineExecutionException
StateMachineEnginestartWithBusinessKeyAsync in interface StateMachineEnginestateMachineName - the state machine nametenantId - the tenant idbusinessKey - the businessKeystartParams - the start paramscallback - the callback after start a state machineEngineExecutionException - the engine execution exceptionpublic StateMachineInstance forward(String stateMachineInstId, Map<String,Object> replaceParams) throws EngineExecutionException
StateMachineEngineforward in interface StateMachineEnginestateMachineInstId - the state machine instance idreplaceParams - the replace paramsForwardInvalidException - forward invalid exceptionEngineExecutionExceptionpublic StateMachineInstance forwardAsync(String stateMachineInstId, Map<String,Object> replaceParams, AsyncCallback callback) throws EngineExecutionException
StateMachineEngineforwardAsync in interface StateMachineEnginestateMachineInstId - the state machine instance idreplaceParams - the replace paramscallback - callback after forward restart a failed state machineForwardInvalidException - the forward invalid exceptionEngineExecutionExceptionprotected StateMachineInstance forwardInternal(String stateMachineInstId, Map<String,Object> replaceParams, boolean skip, boolean async, AsyncCallback callback) throws EngineExecutionException
EngineExecutionExceptionprotected Map<String,Object> replayContextVariables(StateMachineInstance stateMachineInstance)
public StateInstance findOutLastForwardStateInstance(List<StateInstance> stateInstanceList)
stateInstanceList - the state instance listpublic StateMachineInstance compensate(String stateMachineInstId, Map<String,Object> replaceParams) throws EngineExecutionException
StateMachineEnginecompensate in interface StateMachineEnginestateMachineInstId - the state machine idreplaceParams - the replace paramsEngineExecutionException - the engin execution exceptionpublic StateMachineInstance compensateAsync(String stateMachineInstId, Map<String,Object> replaceParams, AsyncCallback callback) throws EngineExecutionException
StateMachineEnginecompensateAsync in interface StateMachineEnginestateMachineInstId - the state machine instance idreplaceParams - the replace paramscallback - callback after compensate a failed state machineEngineExecutionException - the engine execution exceptionpublic StateMachineInstance compensateInternal(String stateMachineInstId, Map<String,Object> replaceParams, boolean async, AsyncCallback callback) throws EngineExecutionException
EngineExecutionExceptionpublic StateMachineInstance skipAndForward(String stateMachineInstId, Map<String,Object> replaceParams) throws EngineExecutionException
StateMachineEngineskipAndForward in interface StateMachineEnginestateMachineInstId - the state machine instance idEngineExecutionException - the engine execution exceptionpublic StateMachineInstance skipAndForwardAsync(String stateMachineInstId, AsyncCallback callback) throws EngineExecutionException
StateMachineEngineskipAndForwardAsync in interface StateMachineEnginestateMachineInstId - the state machine instance idcallback - callback after skip and forward restart a failed state machineEngineExecutionException - the engine execution exceptionpublic StateMachineInstance reloadStateMachineInstance(String instId)
reloadStateMachineInstance in interface StateMachineEngineinstId - the state instance idprotected boolean checkStatus(StateMachineInstance stateMachineInstance, ExecutionStatus[] acceptStatus, ExecutionStatus[] denyStatus, ExecutionStatus status, ExecutionStatus compenStatus, String operation)
stateMachineInstance - the state machine instanceacceptStatus - accept statusdenyStatus - deny statusstatus - execution statuscompenStatus - compensate statusoperation - the operationpublic StateMachineConfig getStateMachineConfig()
StateMachineEnginegetStateMachineConfig in interface StateMachineEnginepublic void setStateMachineConfig(StateMachineConfig stateMachineConfig)
Copyright © 2023 Seata. All rights reserved.