Package io.serverlessworkflow.api.states
Class SwitchState
- java.lang.Object
-
- io.serverlessworkflow.api.states.DefaultState
-
- io.serverlessworkflow.api.states.SwitchState
-
- All Implemented Interfaces:
State
,Serializable
public class SwitchState extends DefaultState implements Serializable, State
Permits transitions to other states based on criteria matching- 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 SwitchState()
No args constructor for use in serializationSwitchState(DefaultDefinition _default, String name, DefaultState.Type type)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<DataCondition>
getDataConditions()
Defines conditions evaluated against state dataDefaultDefinition
getDefault()
Switch state default definition (Required)List<EventCondition>
getEventConditions()
Defines conditions evaluated against eventsString
getEventTimeout()
If eventConditions is used, defines the time period to wait for events (ISO 8601 format)boolean
isUsedForCompensation()
If true, this state is used to compensate another state.void
setDataConditions(List<DataCondition> dataConditions)
Defines conditions evaluated against state datavoid
setDefault(DefaultDefinition _default)
Switch state default definition (Required)void
setEventConditions(List<EventCondition> eventConditions)
Defines conditions evaluated against eventsvoid
setEventTimeout(String eventTimeout)
If eventConditions is used, defines the time period to wait for events (ISO 8601 format)void
setUsedForCompensation(boolean usedForCompensation)
If true, this state is used to compensate another state.SwitchState
withCompensatedBy(String compensatedBy)
SwitchState
withDataConditions(List<DataCondition> dataConditions)
SwitchState
withDataInputSchema(String dataInputSchema)
SwitchState
withDataOutputSchema(String dataOutputSchema)
SwitchState
withDefault(DefaultDefinition _default)
SwitchState
withEnd(End end)
SwitchState
withEventConditions(List<EventCondition> eventConditions)
SwitchState
withEventTimeout(String eventTimeout)
SwitchState
withId(String id)
SwitchState
withMetadata(Map<String,String> metadata)
SwitchState
withName(String name)
SwitchState
withOnErrors(List<Error> onErrors)
SwitchState
withStart(Start start)
SwitchState
withStateDataFilter(StateDataFilter stateDataFilter)
SwitchState
withTransition(Transition transition)
SwitchState
withType(DefaultState.Type type)
SwitchState
withUsedForCompensation(boolean usedForCompensation)
-
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
-
SwitchState
public SwitchState()
No args constructor for use in serialization
-
SwitchState
public SwitchState(DefaultDefinition _default, String name, DefaultState.Type type)
- Parameters:
_default
-name
-type
-
-
-
Method Detail
-
getEventConditions
public List<EventCondition> getEventConditions()
Defines conditions evaluated against events
-
setEventConditions
public void setEventConditions(List<EventCondition> eventConditions)
Defines conditions evaluated against events
-
withEventConditions
public SwitchState withEventConditions(List<EventCondition> eventConditions)
-
getDataConditions
public List<DataCondition> getDataConditions()
Defines conditions evaluated against state data
-
setDataConditions
public void setDataConditions(List<DataCondition> dataConditions)
Defines conditions evaluated against state data
-
withDataConditions
public SwitchState withDataConditions(List<DataCondition> dataConditions)
-
getEventTimeout
public String getEventTimeout()
If eventConditions is used, defines the time period to wait for events (ISO 8601 format)
-
setEventTimeout
public void setEventTimeout(String eventTimeout)
If eventConditions is used, defines the time period to wait for events (ISO 8601 format)
-
withEventTimeout
public SwitchState withEventTimeout(String eventTimeout)
-
getDefault
public DefaultDefinition getDefault()
Switch state default definition (Required)
-
setDefault
public void setDefault(DefaultDefinition _default)
Switch state default definition (Required)
-
withDefault
public SwitchState withDefault(DefaultDefinition _default)
-
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 SwitchState withUsedForCompensation(boolean usedForCompensation)
-
withId
public SwitchState withId(String id)
- Overrides:
withId
in classDefaultState
-
withName
public SwitchState withName(String name)
- Overrides:
withName
in classDefaultState
-
withType
public SwitchState withType(DefaultState.Type type)
- Overrides:
withType
in classDefaultState
-
withStart
public SwitchState withStart(Start start)
- Overrides:
withStart
in classDefaultState
-
withEnd
public SwitchState withEnd(End end)
- Overrides:
withEnd
in classDefaultState
-
withStateDataFilter
public SwitchState withStateDataFilter(StateDataFilter stateDataFilter)
- Overrides:
withStateDataFilter
in classDefaultState
-
withMetadata
public SwitchState withMetadata(Map<String,String> metadata)
- Overrides:
withMetadata
in classDefaultState
-
withTransition
public SwitchState withTransition(Transition transition)
- Overrides:
withTransition
in classDefaultState
-
withDataInputSchema
public SwitchState withDataInputSchema(String dataInputSchema)
- Overrides:
withDataInputSchema
in classDefaultState
-
withDataOutputSchema
public SwitchState withDataOutputSchema(String dataOutputSchema)
- Overrides:
withDataOutputSchema
in classDefaultState
-
withOnErrors
public SwitchState withOnErrors(List<Error> onErrors)
- Overrides:
withOnErrors
in classDefaultState
-
withCompensatedBy
public SwitchState withCompensatedBy(String compensatedBy)
- Overrides:
withCompensatedBy
in classDefaultState
-
-