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
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/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 inputCollectionString
getInputCollection()
JsonPath expression selecting an array element of the states dataString
getIterationParam()
Name of the iteration parameter that can be referenced in actions/workflow.int
getMax()
Specifies how upper bound on how many iterations may run in parallelString
getOutputCollection()
JsonPath expression specifying an array element of the states data to add the results of each iterationString
getWorkflowId()
Unique Id of a workflow to be executed for each of the elements of inputCollectionboolean
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
setInputCollection(String inputCollection)
JsonPath 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
setMax(int max)
Specifies how upper bound on how many iterations may run in parallelvoid
setOutputCollection(String outputCollection)
JsonPath 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.void
setWorkflowId(String workflowId)
Unique Id of a workflow to be executed for each of the elements of inputCollectionForEachState
withActions(List<Action> actions)
ForEachState
withCompensatedBy(String compensatedBy)
ForEachState
withDataInputSchema(String dataInputSchema)
ForEachState
withDataOutputSchema(String dataOutputSchema)
ForEachState
withEnd(End end)
ForEachState
withId(String id)
ForEachState
withInputCollection(String inputCollection)
ForEachState
withIterationParam(String iterationParam)
ForEachState
withMax(int max)
ForEachState
withMetadata(Map<String,String> metadata)
ForEachState
withName(String name)
ForEachState
withOnErrors(List<Error> onErrors)
ForEachState
withOutputCollection(String outputCollection)
ForEachState
withStart(Start start)
ForEachState
withStateDataFilter(StateDataFilter stateDataFilter)
ForEachState
withTransition(Transition transition)
ForEachState
withType(DefaultState.Type type)
ForEachState
withUsedForCompensation(boolean usedForCompensation)
ForEachState
withWorkflowId(String workflowId)
-
Methods inherited from class io.serverlessworkflow.api.states.DefaultState
getCompensatedBy, getDataInputSchema, getDataOutputSchema, getEnd, getId, getMetadata, getName, getOnErrors, getStart, getStateDataFilter, getTransition, getType, setCompensatedBy, setDataInputSchema, setDataOutputSchema, setEnd, setId, setMetadata, setName, setOnErrors, setStart, setStateDataFilter, 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, getDataInputSchema, getDataOutputSchema, getEnd, getId, getMetadata, getName, getOnErrors, getStart, getStateDataFilter, getTransition, getType
-
-
-
-
Constructor Detail
-
ForEachState
public ForEachState()
No args constructor for use in serialization
-
ForEachState
public ForEachState(String name, DefaultState.Type type)
- Parameters:
name
-type
-
-
-
Method Detail
-
getInputCollection
public String getInputCollection()
JsonPath expression selecting an array element of the states data
-
setInputCollection
public void setInputCollection(String inputCollection)
JsonPath expression selecting an array element of the states data
-
withInputCollection
public ForEachState withInputCollection(String inputCollection)
-
getOutputCollection
public String getOutputCollection()
JsonPath expression specifying an array element of the states data to add the results of each iteration
-
setOutputCollection
public void setOutputCollection(String outputCollection)
JsonPath 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)
-
getMax
public int getMax()
Specifies how upper bound on how many iterations may run in parallel
-
setMax
public void setMax(int max)
Specifies how upper bound on how many iterations may run in parallel
-
withMax
public ForEachState withMax(int max)
-
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)
-
getWorkflowId
public String getWorkflowId()
Unique Id of a workflow to be executed for each of the elements of inputCollection
-
setWorkflowId
public void setWorkflowId(String workflowId)
Unique Id of a workflow to be executed for each of the elements of inputCollection
-
withWorkflowId
public ForEachState withWorkflowId(String workflowId)
-
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)
-
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
-
withStart
public ForEachState withStart(Start start)
- Overrides:
withStart
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
-
withDataInputSchema
public ForEachState withDataInputSchema(String dataInputSchema)
- Overrides:
withDataInputSchema
in classDefaultState
-
withDataOutputSchema
public ForEachState withDataOutputSchema(String dataOutputSchema)
- Overrides:
withDataOutputSchema
in classDefaultState
-
withOnErrors
public ForEachState withOnErrors(List<Error> onErrors)
- Overrides:
withOnErrors
in classDefaultState
-
withCompensatedBy
public ForEachState withCompensatedBy(String compensatedBy)
- Overrides:
withCompensatedBy
in classDefaultState
-
-