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 correspondingHistoryJobEntitywhen theCommandContextcloses 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
Fields Modifier and Type Field Description protected AsyncHistoryListenerasyncHistoryListenerprotected AsyncHistorySessionasyncHistorySessionprotected StringdataFieldNameprotected StringtypeFieldName
-
Constructor Summary
Constructors Constructor Description AsyncHistorySessionCommandContextCloseListener()AsyncHistorySessionCommandContextCloseListener(AsyncHistorySession asyncHistorySession, AsyncHistoryListener asyncHistoryListener)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterSessionsFlush(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)AsyncHistoryListenergetAsyncHistoryListener()AsyncHistorySessiongetAsyncHistorySession()StringgetDataFieldName()StringgetTypeFieldName()booleanmultipleAllowed()Integerorder()voidsetAsyncHistoryListener(AsyncHistoryListener asyncHistoryListener)voidsetAsyncHistorySession(AsyncHistorySession asyncHistorySession)voidsetDataFieldName(String dataFieldName)voidsetTypeFieldName(String typeFieldName)
-
-
-
Field Detail
-
asyncHistorySession
protected AsyncHistorySession asyncHistorySession
-
asyncHistoryListener
protected AsyncHistoryListener asyncHistoryListener
-
typeFieldName
protected String typeFieldName
-
dataFieldName
protected String dataFieldName
-
-
Constructor Detail
-
AsyncHistorySessionCommandContextCloseListener
public AsyncHistorySessionCommandContextCloseListener()
-
AsyncHistorySessionCommandContextCloseListener
public AsyncHistorySessionCommandContextCloseListener(AsyncHistorySession asyncHistorySession, AsyncHistoryListener asyncHistoryListener)
-
-
Method Detail
-
closing
public void closing(CommandContext commandContext)
- Specified by:
closingin interfaceCommandContextCloseListener
-
generateJson
protected void generateJson(JobServiceConfiguration jobServiceConfiguration, Map<String,List<com.fasterxml.jackson.databind.node.ObjectNode>> jobData, List<com.fasterxml.jackson.databind.node.ObjectNode> objectNodes, String type)
-
generateJson
protected com.fasterxml.jackson.databind.node.ObjectNode generateJson(JobServiceConfiguration jobServiceConfiguration, String type, com.fasterxml.jackson.databind.node.ObjectNode historicData)
-
closed
public void closed(CommandContext commandContext)
- Specified by:
closedin interfaceCommandContextCloseListener
-
closeFailure
public void closeFailure(CommandContext commandContext)
- Specified by:
closeFailurein interfaceCommandContextCloseListener
-
afterSessionsFlush
public void afterSessionsFlush(CommandContext commandContext)
- Specified by:
afterSessionsFlushin interfaceCommandContextCloseListener
-
order
public Integer order()
- Specified by:
orderin interfaceCommandContextCloseListener
-
multipleAllowed
public boolean multipleAllowed()
- Specified by:
multipleAllowedin interfaceCommandContextCloseListener
-
getAsyncHistorySession
public AsyncHistorySession getAsyncHistorySession()
-
setAsyncHistorySession
public void setAsyncHistorySession(AsyncHistorySession asyncHistorySession)
-
getAsyncHistoryListener
public AsyncHistoryListener getAsyncHistoryListener()
-
setAsyncHistoryListener
public void setAsyncHistoryListener(AsyncHistoryListener asyncHistoryListener)
-
getTypeFieldName
public String getTypeFieldName()
-
setTypeFieldName
public void setTypeFieldName(String typeFieldName)
-
getDataFieldName
public String getDataFieldName()
-
setDataFieldName
public void setDataFieldName(String dataFieldName)
-
-