Package io.serverlessworkflow.api.states
Class EventState
- java.lang.Object
-
- io.serverlessworkflow.api.states.DefaultState
-
- io.serverlessworkflow.api.states.EventState
-
- All Implemented Interfaces:
State
,Serializable
public class EventState extends DefaultState implements Serializable, State
This state is used to wait for events from event sources and then to invoke one or more functions to run in sequence or in parallel.- 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 EventState()
No args constructor for use in serializationEventState(String name, DefaultState.Type type)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<OnEvents>
getOnEvents()
Define what events trigger one or more actions to be performedString
getTimeout()
Time period to wait for incoming events (ISO 8601 format)boolean
isExclusive()
If true consuming one of the defined events causes its associated actions to be performed.void
setExclusive(boolean exclusive)
If true consuming one of the defined events causes its associated actions to be performed.void
setOnEvents(List<OnEvents> onEvents)
Define what events trigger one or more actions to be performedvoid
setTimeout(String timeout)
Time period to wait for incoming events (ISO 8601 format)EventState
withCompensatedBy(String compensatedBy)
EventState
withDataInputSchema(String dataInputSchema)
EventState
withDataOutputSchema(String dataOutputSchema)
EventState
withEnd(End end)
EventState
withExclusive(boolean exclusive)
EventState
withId(String id)
EventState
withMetadata(Map<String,String> metadata)
EventState
withName(String name)
EventState
withOnErrors(List<Error> onErrors)
EventState
withOnEvents(List<OnEvents> onEvents)
EventState
withStart(Start start)
EventState
withStateDataFilter(StateDataFilter stateDataFilter)
EventState
withTimeout(String timeout)
EventState
withTransition(Transition transition)
EventState
withType(DefaultState.Type type)
-
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
-
EventState
public EventState()
No args constructor for use in serialization
-
EventState
public EventState(String name, DefaultState.Type type)
- Parameters:
name
-type
-
-
-
Method Detail
-
isExclusive
public boolean isExclusive()
If true consuming one of the defined events causes its associated actions to be performed. If false all of the defined events must be consumed in order for actions to be performed
-
setExclusive
public void setExclusive(boolean exclusive)
If true consuming one of the defined events causes its associated actions to be performed. If false all of the defined events must be consumed in order for actions to be performed
-
withExclusive
public EventState withExclusive(boolean exclusive)
-
getOnEvents
public List<OnEvents> getOnEvents()
Define what events trigger one or more actions to be performed
-
setOnEvents
public void setOnEvents(List<OnEvents> onEvents)
Define what events trigger one or more actions to be performed
-
withOnEvents
public EventState withOnEvents(List<OnEvents> onEvents)
-
getTimeout
public String getTimeout()
Time period to wait for incoming events (ISO 8601 format)
-
setTimeout
public void setTimeout(String timeout)
Time period to wait for incoming events (ISO 8601 format)
-
withTimeout
public EventState withTimeout(String timeout)
-
withId
public EventState withId(String id)
- Overrides:
withId
in classDefaultState
-
withName
public EventState withName(String name)
- Overrides:
withName
in classDefaultState
-
withType
public EventState withType(DefaultState.Type type)
- Overrides:
withType
in classDefaultState
-
withStart
public EventState withStart(Start start)
- Overrides:
withStart
in classDefaultState
-
withEnd
public EventState withEnd(End end)
- Overrides:
withEnd
in classDefaultState
-
withStateDataFilter
public EventState withStateDataFilter(StateDataFilter stateDataFilter)
- Overrides:
withStateDataFilter
in classDefaultState
-
withMetadata
public EventState withMetadata(Map<String,String> metadata)
- Overrides:
withMetadata
in classDefaultState
-
withTransition
public EventState withTransition(Transition transition)
- Overrides:
withTransition
in classDefaultState
-
withDataInputSchema
public EventState withDataInputSchema(String dataInputSchema)
- Overrides:
withDataInputSchema
in classDefaultState
-
withDataOutputSchema
public EventState withDataOutputSchema(String dataOutputSchema)
- Overrides:
withDataOutputSchema
in classDefaultState
-
withOnErrors
public EventState withOnErrors(List<Error> onErrors)
- Overrides:
withOnErrors
in classDefaultState
-
withCompensatedBy
public EventState withCompensatedBy(String compensatedBy)
- Overrides:
withCompensatedBy
in classDefaultState
-
-