Package io.iworkflow.core
Class WorkflowStateOptionsExtension
java.lang.Object
io.iworkflow.gen.models.WorkflowStateOptions
io.iworkflow.core.WorkflowStateOptionsExtension
WorkflowStateOptionsExtension provides extension to WorkflowStateOptions
to make it easier to build some fields of the stateOptions.
This is also because WorkflowState interface uses WorkflowStateOptions
directly instead of using a separate model.
See TODO
Example usage in a state implementation:
public WorkflowStateOptions getStateOptions() {
return new WorkflowStateOptionsExtension()
.setProceedAfterRetryExhaustedOnExecute(StateRecoverBasic.class)
.executeApiRetryPolicy(
new RetryPolicy()
.maximumAttempts(10)
);
}
-
Field Summary
Fields inherited from class io.iworkflow.gen.models.WorkflowStateOptions
JSON_PROPERTY_DATA_ATTRIBUTES_LOADING_POLICY, JSON_PROPERTY_EXECUTE_API_DATA_ATTRIBUTES_LOADING_POLICY, JSON_PROPERTY_EXECUTE_API_FAILURE_POLICY, JSON_PROPERTY_EXECUTE_API_FAILURE_PROCEED_STATE_ID, JSON_PROPERTY_EXECUTE_API_FAILURE_PROCEED_STATE_OPTIONS, JSON_PROPERTY_EXECUTE_API_RETRY_POLICY, JSON_PROPERTY_EXECUTE_API_SEARCH_ATTRIBUTES_LOADING_POLICY, JSON_PROPERTY_EXECUTE_API_TIMEOUT_SECONDS, JSON_PROPERTY_SEARCH_ATTRIBUTES_LOADING_POLICY, JSON_PROPERTY_SKIP_WAIT_UNTIL, JSON_PROPERTY_WAIT_UNTIL_API_DATA_ATTRIBUTES_LOADING_POLICY, JSON_PROPERTY_WAIT_UNTIL_API_FAILURE_POLICY, JSON_PROPERTY_WAIT_UNTIL_API_RETRY_POLICY, JSON_PROPERTY_WAIT_UNTIL_API_SEARCH_ATTRIBUTES_LOADING_POLICY, JSON_PROPERTY_WAIT_UNTIL_API_TIMEOUT_SECONDS
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionsetProceedOnExecuteFailure
(Class<? extends WorkflowState> proceedingState) Deprecated.setProceedOnExecuteFailure
(Class<? extends WorkflowState> proceedingState, WorkflowStateOptions stateOptionsOverride) Deprecated.setProceedWhenExecuteRetryExhausted
(Class<? extends WorkflowState> proceedingState) By default, workflow would fail after execute API retry exhausted.setProceedWhenExecuteRetryExhausted
(Class<? extends WorkflowState> proceedingState, WorkflowStateOptions stateOptionsOverride) By default, workflow would fail after execute API retry exhausted.setProceedWhenWaitUntilRetryExhausted
(boolean proceed) By default, workflow would fail after waitUntil API retry exhausted.Methods inherited from class io.iworkflow.gen.models.WorkflowStateOptions
dataAttributesLoadingPolicy, equals, executeApiDataAttributesLoadingPolicy, executeApiFailurePolicy, executeApiFailureProceedStateId, executeApiFailureProceedStateOptions, executeApiRetryPolicy, executeApiSearchAttributesLoadingPolicy, executeApiTimeoutSeconds, getDataAttributesLoadingPolicy, getExecuteApiDataAttributesLoadingPolicy, getExecuteApiFailurePolicy, getExecuteApiFailureProceedStateId, getExecuteApiFailureProceedStateOptions, getExecuteApiRetryPolicy, getExecuteApiSearchAttributesLoadingPolicy, getExecuteApiTimeoutSeconds, getSearchAttributesLoadingPolicy, getSkipWaitUntil, getWaitUntilApiDataAttributesLoadingPolicy, getWaitUntilApiFailurePolicy, getWaitUntilApiRetryPolicy, getWaitUntilApiSearchAttributesLoadingPolicy, getWaitUntilApiTimeoutSeconds, hashCode, searchAttributesLoadingPolicy, setDataAttributesLoadingPolicy, setExecuteApiDataAttributesLoadingPolicy, setExecuteApiFailurePolicy, setExecuteApiFailureProceedStateId, setExecuteApiFailureProceedStateOptions, setExecuteApiRetryPolicy, setExecuteApiSearchAttributesLoadingPolicy, setExecuteApiTimeoutSeconds, setSearchAttributesLoadingPolicy, setSkipWaitUntil, setWaitUntilApiDataAttributesLoadingPolicy, setWaitUntilApiFailurePolicy, setWaitUntilApiRetryPolicy, setWaitUntilApiSearchAttributesLoadingPolicy, setWaitUntilApiTimeoutSeconds, skipWaitUntil, toString, waitUntilApiDataAttributesLoadingPolicy, waitUntilApiFailurePolicy, waitUntilApiRetryPolicy, waitUntilApiSearchAttributesLoadingPolicy, waitUntilApiTimeoutSeconds
-
Constructor Details
-
WorkflowStateOptionsExtension
public WorkflowStateOptionsExtension()
-
-
Method Details
-
setProceedWhenExecuteRetryExhausted
public WorkflowStateOptionsExtension setProceedWhenExecuteRetryExhausted(Class<? extends WorkflowState> proceedingState) By default, workflow would fail after execute API retry exhausted. Set the state to proceed to the specified state after the execute API exhausted all retries This is useful for some advanced use cases like SAGA pattern. RetryPolicy is required to be set with maximumAttempts or maximumAttemptsDurationSeconds for execute API. NOTE: The proceeding state will take the same input as the failed state that proceeded from. See more in wiki- Parameters:
proceedingState
- the state to proceed to- Returns:
- this
-
setProceedWhenExecuteRetryExhausted
public WorkflowStateOptionsExtension setProceedWhenExecuteRetryExhausted(Class<? extends WorkflowState> proceedingState, WorkflowStateOptions stateOptionsOverride) By default, workflow would fail after execute API retry exhausted. Set the state to proceed to the specified state after the execute API exhausted all retries This is useful for some advanced use cases like SAGA pattern. RetryPolicy is required to be set with maximumAttempts or maximumAttemptsDurationSeconds for execute API. NOTE: The proceeding state will take the same input as the failed state that proceeded from. See more in wiki- Parameters:
proceedingState
- the state to proceed tostateOptionsOverride
- the stateOptions for the proceeding state. This is for a rare case that you need to override the stateOptions returned from state instance.- Returns:
- this
-
setProceedWhenWaitUntilRetryExhausted
By default, workflow would fail after waitUntil API retry exhausted. If set to true, then after waitUntil API exhausted all retries, proceed to the execute API This is useful for some advanced use cases like SAGA pattern. RetryPolicy is required to be set with maximumAttempts or maximumAttemptsDurationSeconds for waitUntil API. NOTE: execute API will use commandResults to check whether the waitUntil has succeeded or not. See more in wiki- Parameters:
proceed
- true to proceed- Returns:
- this
-
setProceedOnExecuteFailure
@Deprecated public WorkflowStateOptionsExtension setProceedOnExecuteFailure(Class<? extends WorkflowState> proceedingState) Deprecated.Use setProceedAfterRetryExhaustedOnExecuteFailure instead. It's a renaming for better clarity. -
setProceedOnExecuteFailure
@Deprecated public WorkflowStateOptionsExtension setProceedOnExecuteFailure(Class<? extends WorkflowState> proceedingState, WorkflowStateOptions stateOptionsOverride) Deprecated.Use setProceedAfterRetryExhaustedOnExecuteFailure instead It's a renaming for better clarity.
-