Package io.serverlessworkflow.api.states
Class SleepState
- java.lang.Object
-
- io.serverlessworkflow.api.states.DefaultState
-
- io.serverlessworkflow.api.states.SleepState
-
- All Implemented Interfaces:
State,Serializable
public class SleepState extends DefaultState implements Serializable, State
This state is used to wait for events from event sources and then transitioning to a next state- 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 SleepState()No args constructor for use in serializationSleepState(String duration, String name, DefaultState.Type type)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetDuration()Duration (ISO 8601 duration format) to sleep (Required)booleanisUsedForCompensation()If true, this state is used to compensate another state.voidsetDuration(String duration)Duration (ISO 8601 duration format) to sleep (Required)voidsetUsedForCompensation(boolean usedForCompensation)If true, this state is used to compensate another state.SleepStatewithCompensatedBy(String compensatedBy)SleepStatewithDuration(String duration)SleepStatewithEnd(End end)SleepStatewithId(String id)SleepStatewithMetadata(Map<String,String> metadata)SleepStatewithName(String name)SleepStatewithOnErrors(List<Error> onErrors)SleepStatewithStateDataFilter(StateDataFilter stateDataFilter)SleepStatewithTimeouts(TimeoutsDefinition timeouts)SleepStatewithTransition(Transition transition)SleepStatewithType(DefaultState.Type type)SleepStatewithUsedForCompensation(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
-
SleepState
public SleepState()
No args constructor for use in serialization
-
SleepState
public SleepState(String duration, String name, DefaultState.Type type)
- Parameters:
duration-name-type-
-
-
Method Detail
-
getDuration
public String getDuration()
Duration (ISO 8601 duration format) to sleep (Required)
-
setDuration
public void setDuration(String duration)
Duration (ISO 8601 duration format) to sleep (Required)
-
withDuration
public SleepState withDuration(String duration)
-
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 SleepState withUsedForCompensation(boolean usedForCompensation)
-
withId
public SleepState withId(String id)
- Overrides:
withIdin classDefaultState
-
withName
public SleepState withName(String name)
- Overrides:
withNamein classDefaultState
-
withType
public SleepState withType(DefaultState.Type type)
- Overrides:
withTypein classDefaultState
-
withEnd
public SleepState withEnd(End end)
- Overrides:
withEndin classDefaultState
-
withStateDataFilter
public SleepState withStateDataFilter(StateDataFilter stateDataFilter)
- Overrides:
withStateDataFilterin classDefaultState
-
withMetadata
public SleepState withMetadata(Map<String,String> metadata)
- Overrides:
withMetadatain classDefaultState
-
withTransition
public SleepState withTransition(Transition transition)
- Overrides:
withTransitionin classDefaultState
-
withOnErrors
public SleepState withOnErrors(List<Error> onErrors)
- Overrides:
withOnErrorsin classDefaultState
-
withCompensatedBy
public SleepState withCompensatedBy(String compensatedBy)
- Overrides:
withCompensatedByin classDefaultState
-
withTimeouts
public SleepState withTimeouts(TimeoutsDefinition timeouts)
- Overrides:
withTimeoutsin classDefaultState
-
-