Class AsyncHistorySessionCommandContextCloseListener
java.lang.Object
org.flowable.job.service.impl.history.async.AsyncHistorySessionCommandContextCloseListener
- All Implemented Interfaces:
CommandContextCloseListener
public class AsyncHistorySessionCommandContextCloseListener
extends Object
implements CommandContextCloseListener
A listener for command context lifecycle close events that generates JSON
(using Jackson) and corresponding
HistoryJobEntity when the
CommandContext closes and adds them to the list of entities that will
be inserted to the database.
The reason why this is done at the very end, is because that way the historical data
can be optimized (some events cancel others, can be grouped, etc.)- Author:
- Joram Barrez
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AsyncHistoryListenerprotected AsyncHistorySessionprotected Stringprotected String -
Constructor Summary
ConstructorsConstructorDescriptionAsyncHistorySessionCommandContextCloseListener(AsyncHistorySession asyncHistorySession, AsyncHistoryListener asyncHistoryListener) -
Method Summary
Modifier and TypeMethodDescriptionvoidafterSessionsFlush(CommandContext commandContext) voidclosed(CommandContext commandContext) voidcloseFailure(CommandContext commandContext) voidclosing(CommandContext commandContext) protected com.fasterxml.jackson.databind.node.ObjectNodegenerateJson(JobServiceConfiguration jobServiceConfiguration, String type, com.fasterxml.jackson.databind.node.ObjectNode historicData) protected voidgenerateJson(JobServiceConfiguration jobServiceConfiguration, Map<String, List<com.fasterxml.jackson.databind.node.ObjectNode>> jobData, List<com.fasterxml.jackson.databind.node.ObjectNode> objectNodes, String type) booleanorder()voidsetAsyncHistoryListener(AsyncHistoryListener asyncHistoryListener) voidsetAsyncHistorySession(AsyncHistorySession asyncHistorySession) voidsetDataFieldName(String dataFieldName) voidsetTypeFieldName(String typeFieldName)
-
Field Details
-
asyncHistorySession
-
asyncHistoryListener
-
typeFieldName
-
dataFieldName
-
-
Constructor Details
-
AsyncHistorySessionCommandContextCloseListener
public AsyncHistorySessionCommandContextCloseListener() -
AsyncHistorySessionCommandContextCloseListener
public AsyncHistorySessionCommandContextCloseListener(AsyncHistorySession asyncHistorySession, AsyncHistoryListener asyncHistoryListener)
-
-
Method Details
-
closing
- Specified by:
closingin interfaceCommandContextCloseListener
-
generateJson
-
generateJson
protected com.fasterxml.jackson.databind.node.ObjectNode generateJson(JobServiceConfiguration jobServiceConfiguration, String type, com.fasterxml.jackson.databind.node.ObjectNode historicData) -
closed
- Specified by:
closedin interfaceCommandContextCloseListener
-
closeFailure
- Specified by:
closeFailurein interfaceCommandContextCloseListener
-
afterSessionsFlush
- Specified by:
afterSessionsFlushin interfaceCommandContextCloseListener
-
order
- Specified by:
orderin interfaceCommandContextCloseListener
-
multipleAllowed
public boolean multipleAllowed()- Specified by:
multipleAllowedin interfaceCommandContextCloseListener
-
getAsyncHistorySession
-
setAsyncHistorySession
-
getAsyncHistoryListener
-
setAsyncHistoryListener
-
getTypeFieldName
-
setTypeFieldName
-
getDataFieldName
-
setDataFieldName
-