Package io.iworkflow.core.persistence
Class StateExecutionLocalsImpl
- java.lang.Object
-
- io.iworkflow.core.persistence.StateExecutionLocalsImpl
-
- All Implemented Interfaces:
StateExecutionLocals
public class StateExecutionLocalsImpl extends java.lang.Object implements StateExecutionLocals
-
-
Constructor Summary
Constructors Constructor Description StateExecutionLocalsImpl(java.util.Map<java.lang.String,EncodedObject> attributeNameToEncodedObjectMap, ObjectEncoder objectEncoder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<KeyValue>
getRecordEvents()
<T> T
getStateExecutionLocal(java.lang.String key, java.lang.Class<T> type)
Retrieve a local state attribute User code must make sure using the same type for both get and setjava.util.List<KeyValue>
getUpsertStateExecutionLocalAttributes()
void
recordEvent(java.lang.String key, java.lang.Object... eventData)
Record an arbitrary event in State Start/Decide API for debugging/tracking purposevoid
setStateExecutionLocal(java.lang.String key, java.lang.Object value)
set a local attribute.
-
-
-
Constructor Detail
-
StateExecutionLocalsImpl
public StateExecutionLocalsImpl(java.util.Map<java.lang.String,EncodedObject> attributeNameToEncodedObjectMap, ObjectEncoder objectEncoder)
-
-
Method Detail
-
setStateExecutionLocal
public void setStateExecutionLocal(java.lang.String key, java.lang.Object value)
Description copied from interface:StateExecutionLocals
set a local attribute. The scope of the attribute is only within the execution of this state. Usually it's for passing from State Start API to State Decide API User code must make sure using the same type for both get and set- Specified by:
setStateExecutionLocal
in interfaceStateExecutionLocals
- Parameters:
key
- the key of the stateExecutionLocal(scope of the state execution)value
- the value
-
getStateExecutionLocal
public <T> T getStateExecutionLocal(java.lang.String key, java.lang.Class<T> type)
Description copied from interface:StateExecutionLocals
Retrieve a local state attribute User code must make sure using the same type for both get and set- Specified by:
getStateExecutionLocal
in interfaceStateExecutionLocals
- Type Parameters:
T
- the value type- Parameters:
key
- the key of the stateExecutionLocal(scope of the state execution)type
- the value type- Returns:
- the value
-
recordEvent
public void recordEvent(java.lang.String key, java.lang.Object... eventData)
Description copied from interface:StateExecutionLocals
Record an arbitrary event in State Start/Decide API for debugging/tracking purpose- Specified by:
recordEvent
in interfaceStateExecutionLocals
- Parameters:
key
- the key of the event. Within a Start/Decide API, the same key cannot be used for more than once.eventData
- the data of the event.
-
getUpsertStateExecutionLocalAttributes
public java.util.List<KeyValue> getUpsertStateExecutionLocalAttributes()
-
getRecordEvents
public java.util.List<KeyValue> getRecordEvents()
-
-