Package io.iworkflow.core.persistence
Class PersistenceImpl
java.lang.Object
io.iworkflow.core.persistence.PersistenceImpl
- All Implemented Interfaces:
DataAttributesRW
,Persistence
,SearchAttributesRW
,StateExecutionLocals
-
Field Summary
Fields inherited from interface io.iworkflow.core.persistence.SearchAttributesRW
DateTimeFormat
-
Constructor Summary
ConstructorsConstructorDescriptionPersistenceImpl
(DataAttributesRW dataAttributesRW, SearchAttributesRW searchAttributesRW, StateExecutionLocals stateExecutionLocals) -
Method Summary
Modifier and TypeMethodDescription<T> T
getDataAttribute
(String key, Class<T> type) <T> T
getStateExecutionLocal
(String key, Class<T> type) Retrieve a local state attribute User code must make sure using the same type for both get and setvoid
recordEvent
(String key, Object... eventData) Record an arbitrary event in State Start/Decide API for debugging/tracking purposevoid
setDataAttribute
(String key, Object value) void
setSearchAttributeBoolean
(String key, Boolean value) void
setSearchAttributeDatetime
(String key, String value) void
setSearchAttributeDouble
(String key, Double value) void
setSearchAttributeInt64
(String key, Long value) void
setSearchAttributeKeyword
(String key, String value) void
setSearchAttributeKeywordArray
(String key, List<String> value) void
setSearchAttributeText
(String key, String value) void
setStateExecutionLocal
(String key, Object value) set a local attribute.
-
Constructor Details
-
PersistenceImpl
public PersistenceImpl(DataAttributesRW dataAttributesRW, SearchAttributesRW searchAttributesRW, StateExecutionLocals stateExecutionLocals)
-
-
Method Details
-
getDataAttribute
- Specified by:
getDataAttribute
in interfaceDataAttributesRW
-
setDataAttribute
- Specified by:
setDataAttribute
in interfaceDataAttributesRW
-
getSearchAttributeInt64
- Specified by:
getSearchAttributeInt64
in interfaceSearchAttributesRW
-
setSearchAttributeInt64
- Specified by:
setSearchAttributeInt64
in interfaceSearchAttributesRW
-
getSearchAttributeDouble
- Specified by:
getSearchAttributeDouble
in interfaceSearchAttributesRW
-
setSearchAttributeDouble
- Specified by:
setSearchAttributeDouble
in interfaceSearchAttributesRW
-
getSearchAttributeBoolean
- Specified by:
getSearchAttributeBoolean
in interfaceSearchAttributesRW
-
setSearchAttributeBoolean
- Specified by:
setSearchAttributeBoolean
in interfaceSearchAttributesRW
-
getSearchAttributeKeyword
- Specified by:
getSearchAttributeKeyword
in interfaceSearchAttributesRW
-
setSearchAttributeKeyword
- Specified by:
setSearchAttributeKeyword
in interfaceSearchAttributesRW
-
getSearchAttributeText
- Specified by:
getSearchAttributeText
in interfaceSearchAttributesRW
-
setSearchAttributeText
- Specified by:
setSearchAttributeText
in interfaceSearchAttributesRW
-
getSearchAttributeDatetime
- Specified by:
getSearchAttributeDatetime
in interfaceSearchAttributesRW
-
setSearchAttributeDatetime
- Specified by:
setSearchAttributeDatetime
in interfaceSearchAttributesRW
- Parameters:
key
- the search attribute keyvalue
- must be timestamp seconds, or in theSearchAttributesRW.DateTimeFormat
-
getSearchAttributeKeywordArray
- Specified by:
getSearchAttributeKeywordArray
in interfaceSearchAttributesRW
-
setSearchAttributeKeywordArray
- Specified by:
setSearchAttributeKeywordArray
in interfaceSearchAttributesRW
-
setStateExecutionLocal
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
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
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.
-