Package io.serverlessworkflow.api.states
Class ForEachState
- java.lang.Object
-
- io.serverlessworkflow.api.states.DefaultState
-
- io.serverlessworkflow.api.states.ForEachState
-
- All Implemented Interfaces:
State
,Serializable
@Generated("jsonschema2pojo") public class ForEachState extends DefaultState implements Serializable, State
Execute a set of defined actions or workflows for each element of a data array- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ForEachState.Mode
Specifies how iterations are to be performed (sequentially or in parallel)-
Nested classes/interfaces inherited from class io.serverlessworkflow.api.states.DefaultState
DefaultState.Type
-
-
Constructor Summary
Constructors Constructor Description ForEachState()
No args constructor for use in serializationForEachState(String name, DefaultState.Type type)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<Action>
getActions()
Actions to be executed for each of the elements of inputCollectionint
getBatchSize()
Specifies how many iterations may run in parallel at the same time.String
getInputCollection()
Workflow expression selecting an array element of the states dataString
getIterationParam()
Name of the iteration parameter that can be referenced in actions/workflow.ForEachState.Mode
getMode()
Specifies how iterations are to be performed (sequentially or in parallel)String
getOutputCollection()
Workflow expression specifying an array element of the states data to add the results of each iterationboolean
isUsedForCompensation()
If true, this state is used to compensate another state.void
setActions(List<Action> actions)
Actions to be executed for each of the elements of inputCollectionvoid
setBatchSize(int batchSize)
Specifies how many iterations may run in parallel at the same time.void
setInputCollection(String inputCollection)
Workflow expression selecting an array element of the states datavoid
setIterationParam(String iterationParam)
Name of the iteration parameter that can be referenced in actions/workflow.void
setMode(ForEachState.Mode mode)
Specifies how iterations are to be performed (sequentially or in parallel)void
setOutputCollection(String outputCollection)
Workflow expression specifying an array element of the states data to add the results of each iterationvoid
setUsedForCompensation(boolean usedForCompensation)
If true, this state is used to compensate another state.ForEachState
withActions(List<Action> actions)
ForEachState
withBatchSize(int batchSize)
ForEachState
withCompensatedBy(String compensatedBy)
ForEachState
withEnd(End end)
ForEachState
withId(String id)
ForEachState
withInputCollection(String inputCollection)
ForEachState
withIterationParam(String iterationParam)
ForEachState
withMetadata(Map<String,String> metadata)
ForEachState
withMode(ForEachState.Mode mode)
ForEachState
withName(String name)
ForEachState
withOnErrors(List<Error> onErrors)
ForEachState
withOutputCollection(String outputCollection)
ForEachState
withStateDataFilter(StateDataFilter stateDataFilter)
ForEachState
withTimeouts(TimeoutsDefinition timeouts)
ForEachState
withTransition(Transition transition)
ForEachState
withType(DefaultState.Type type)
ForEachState
withUsedForCompensation(boolean usedForCompensation)
-
Methods inherited from class io.serverlessworkflow.api.states.DefaultState
getCompensatedBy, getEnd, getId, getMetadata, getName, getOnErrors, getStateDataFilter, getTimeouts, getTransition, getType, setCompensatedBy, setEnd, setId, setMetadata, setName, setOnErrors, setStateDataFilter, setTimeouts, setTransition, setType
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.serverlessworkflow.api.interfaces.State
getCompensatedBy, getEnd, getId, getMetadata, getName, getOnErrors, getStateDataFilter, getTimeouts, getTransition, getType
-
-
-
-
Constructor Detail
-
ForEachState
public ForEachState()
No args constructor for use in serialization
-
ForEachState
public ForEachState(String name, DefaultState.Type type)
- Parameters:
name
- Unique name of the state.type
- State type.
-
-
Method Detail
-
getInputCollection
public String getInputCollection()
Workflow expression selecting an array element of the states data
-
setInputCollection
public void setInputCollection(String inputCollection)
Workflow expression selecting an array element of the states data
-
withInputCollection
public ForEachState withInputCollection(String inputCollection)
-
getOutputCollection
public String getOutputCollection()
Workflow expression specifying an array element of the states data to add the results of each iteration
-
setOutputCollection
public void setOutputCollection(String outputCollection)
Workflow expression specifying an array element of the states data to add the results of each iteration
-
withOutputCollection
public ForEachState withOutputCollection(String outputCollection)
-
getIterationParam
public String getIterationParam()
Name of the iteration parameter that can be referenced in actions/workflow. For each parallel iteration, this param should contain an unique element of the inputCollection array
-
setIterationParam
public void setIterationParam(String iterationParam)
Name of the iteration parameter that can be referenced in actions/workflow. For each parallel iteration, this param should contain an unique element of the inputCollection array
-
withIterationParam
public ForEachState withIterationParam(String iterationParam)
-
getBatchSize
public int getBatchSize()
Specifies how many iterations may run in parallel at the same time. Used if 'mode' property is set to 'parallel' (default)
-
setBatchSize
public void setBatchSize(int batchSize)
Specifies how many iterations may run in parallel at the same time. Used if 'mode' property is set to 'parallel' (default)
-
withBatchSize
public ForEachState withBatchSize(int batchSize)
-
getActions
public List<Action> getActions()
Actions to be executed for each of the elements of inputCollection
-
setActions
public void setActions(List<Action> actions)
Actions to be executed for each of the elements of inputCollection
-
withActions
public ForEachState withActions(List<Action> actions)
-
isUsedForCompensation
public boolean isUsedForCompensation()
If true, this state is used to compensate another state. Default is false
-
setUsedForCompensation
public void setUsedForCompensation(boolean usedForCompensation)
If true, this state is used to compensate another state. Default is false
-
withUsedForCompensation
public ForEachState withUsedForCompensation(boolean usedForCompensation)
-
getMode
public ForEachState.Mode getMode()
Specifies how iterations are to be performed (sequentially or in parallel)
-
setMode
public void setMode(ForEachState.Mode mode)
Specifies how iterations are to be performed (sequentially or in parallel)
-
withMode
public ForEachState withMode(ForEachState.Mode mode)
-
withId
public ForEachState withId(String id)
- Overrides:
withId
in classDefaultState
-
withName
public ForEachState withName(String name)
- Overrides:
withName
in classDefaultState
-
withType
public ForEachState withType(DefaultState.Type type)
- Overrides:
withType
in classDefaultState
-
withEnd
public ForEachState withEnd(End end)
- Overrides:
withEnd
in classDefaultState
-
withStateDataFilter
public ForEachState withStateDataFilter(StateDataFilter stateDataFilter)
- Overrides:
withStateDataFilter
in classDefaultState
-
withMetadata
public ForEachState withMetadata(Map<String,String> metadata)
- Overrides:
withMetadata
in classDefaultState
-
withTransition
public ForEachState withTransition(Transition transition)
- Overrides:
withTransition
in classDefaultState
-
withOnErrors
public ForEachState withOnErrors(List<Error> onErrors)
- Overrides:
withOnErrors
in classDefaultState
-
withCompensatedBy
public ForEachState withCompensatedBy(String compensatedBy)
- Overrides:
withCompensatedBy
in classDefaultState
-
withTimeouts
public ForEachState withTimeouts(TimeoutsDefinition timeouts)
- Overrides:
withTimeouts
in classDefaultState
-
-