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 String
getDuration()
Duration (ISO 8601 duration format) to sleep (Required)boolean
isUsedForCompensation()
If true, this state is used to compensate another state.void
setDuration(String duration)
Duration (ISO 8601 duration format) to sleep (Required)void
setUsedForCompensation(boolean usedForCompensation)
If true, this state is used to compensate another state.SleepState
withCompensatedBy(String compensatedBy)
SleepState
withDuration(String duration)
SleepState
withEnd(End end)
SleepState
withId(String id)
SleepState
withMetadata(Map<String,String> metadata)
SleepState
withName(String name)
SleepState
withOnErrors(List<Error> onErrors)
SleepState
withStateDataFilter(StateDataFilter stateDataFilter)
SleepState
withTimeouts(TimeoutsDefinition timeouts)
SleepState
withTransition(Transition transition)
SleepState
withType(DefaultState.Type type)
SleepState
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
-
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:
withId
in classDefaultState
-
withName
public SleepState withName(String name)
- Overrides:
withName
in classDefaultState
-
withType
public SleepState withType(DefaultState.Type type)
- Overrides:
withType
in classDefaultState
-
withEnd
public SleepState withEnd(End end)
- Overrides:
withEnd
in classDefaultState
-
withStateDataFilter
public SleepState withStateDataFilter(StateDataFilter stateDataFilter)
- Overrides:
withStateDataFilter
in classDefaultState
-
withMetadata
public SleepState withMetadata(Map<String,String> metadata)
- Overrides:
withMetadata
in classDefaultState
-
withTransition
public SleepState withTransition(Transition transition)
- Overrides:
withTransition
in classDefaultState
-
withOnErrors
public SleepState withOnErrors(List<Error> onErrors)
- Overrides:
withOnErrors
in classDefaultState
-
withCompensatedBy
public SleepState withCompensatedBy(String compensatedBy)
- Overrides:
withCompensatedBy
in classDefaultState
-
withTimeouts
public SleepState withTimeouts(TimeoutsDefinition timeouts)
- Overrides:
withTimeouts
in classDefaultState
-
-