Package io.serverlessworkflow.api.states
Class ParallelState
- java.lang.Object
-
- io.serverlessworkflow.api.states.DefaultState
-
- io.serverlessworkflow.api.states.ParallelState
-
- All Implemented Interfaces:
State
,Serializable
public class ParallelState extends DefaultState implements Serializable, State
Consists of a number of states that are executed in parallel- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ParallelState.CompletionType
-
Nested classes/interfaces inherited from class io.serverlessworkflow.api.states.DefaultState
DefaultState.Type
-
-
Constructor Summary
Constructors Constructor Description ParallelState()
No args constructor for use in serializationParallelState(List<Branch> branches, String name, DefaultState.Type type)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<Branch>
getBranches()
Branch Definitions (Required)ParallelState.CompletionType
getCompletionType()
Option types on how to complete branch execution.String
getNumCompleted()
Used when completionType is set to 'atLeast' to specify the minimum number of branches that must complete before the state will transition.boolean
isUsedForCompensation()
If true, this state is used to compensate another state.void
setBranches(List<Branch> branches)
Branch Definitions (Required)void
setCompletionType(ParallelState.CompletionType completionType)
Option types on how to complete branch execution.void
setNumCompleted(String numCompleted)
Used when completionType is set to 'atLeast' to specify the minimum number of branches that must complete before the state will transition.void
setUsedForCompensation(boolean usedForCompensation)
If true, this state is used to compensate another state.ParallelState
withBranches(List<Branch> branches)
ParallelState
withCompensatedBy(String compensatedBy)
ParallelState
withCompletionType(ParallelState.CompletionType completionType)
ParallelState
withEnd(End end)
ParallelState
withId(String id)
ParallelState
withMetadata(Map<String,String> metadata)
ParallelState
withName(String name)
ParallelState
withNumCompleted(String numCompleted)
ParallelState
withOnErrors(List<Error> onErrors)
ParallelState
withStateDataFilter(StateDataFilter stateDataFilter)
ParallelState
withTimeouts(TimeoutsDefinition timeouts)
ParallelState
withTransition(Transition transition)
ParallelState
withType(DefaultState.Type type)
ParallelState
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
-
ParallelState
public ParallelState()
No args constructor for use in serialization
-
ParallelState
public ParallelState(List<Branch> branches, String name, DefaultState.Type type)
- Parameters:
name
-branches
-type
-
-
-
Method Detail
-
withBranches
public ParallelState withBranches(List<Branch> branches)
-
getCompletionType
public ParallelState.CompletionType getCompletionType()
Option types on how to complete branch execution.
-
setCompletionType
public void setCompletionType(ParallelState.CompletionType completionType)
Option types on how to complete branch execution.
-
withCompletionType
public ParallelState withCompletionType(ParallelState.CompletionType completionType)
-
getNumCompleted
public String getNumCompleted()
Used when completionType is set to 'atLeast' to specify the minimum number of branches that must complete before the state will transition.
-
setNumCompleted
public void setNumCompleted(String numCompleted)
Used when completionType is set to 'atLeast' to specify the minimum number of branches that must complete before the state will transition.
-
withNumCompleted
public ParallelState withNumCompleted(String numCompleted)
-
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 ParallelState withUsedForCompensation(boolean usedForCompensation)
-
withId
public ParallelState withId(String id)
- Overrides:
withId
in classDefaultState
-
withName
public ParallelState withName(String name)
- Overrides:
withName
in classDefaultState
-
withType
public ParallelState withType(DefaultState.Type type)
- Overrides:
withType
in classDefaultState
-
withEnd
public ParallelState withEnd(End end)
- Overrides:
withEnd
in classDefaultState
-
withStateDataFilter
public ParallelState withStateDataFilter(StateDataFilter stateDataFilter)
- Overrides:
withStateDataFilter
in classDefaultState
-
withMetadata
public ParallelState withMetadata(Map<String,String> metadata)
- Overrides:
withMetadata
in classDefaultState
-
withTransition
public ParallelState withTransition(Transition transition)
- Overrides:
withTransition
in classDefaultState
-
withOnErrors
public ParallelState withOnErrors(List<Error> onErrors)
- Overrides:
withOnErrors
in classDefaultState
-
withCompensatedBy
public ParallelState withCompensatedBy(String compensatedBy)
- Overrides:
withCompensatedBy
in classDefaultState
-
withTimeouts
public ParallelState withTimeouts(TimeoutsDefinition timeouts)
- Overrides:
withTimeouts
in classDefaultState
-
-