Class EventInstanceRepositoryImpl
- java.lang.Object
-
- org.bonitasoft.engine.core.process.instance.event.impl.EventInstanceRepositoryImpl
-
- All Implemented Interfaces:
EventInstanceRepository
public class EventInstanceRepositoryImpl extends java.lang.Object implements EventInstanceRepository
- Author:
- Elias Ricken de Medeiros, Matthieu Chaffotte, Frederic Bouquet, Celine Souchet
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringQUERY_RESET_IN_PROGRESS_WAITING_EVENTS-
Fields inherited from interface org.bonitasoft.engine.core.process.instance.api.event.EventInstanceRepository
EVENT_INSTANCE, EVENT_TRIGGER_INSTANCE, IN_REQUEST_SIZE, MESSAGE_INSTANCE
-
-
Constructor Summary
Constructors Constructor Description EventInstanceRepositoryImpl(Recorder recorder, PersistenceService persistenceService, EventService eventService, TechnicalLoggerService logger, ArchiveService archiveService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcreateEventInstance(SEventInstance eventInstance)voidcreateMessageInstance(SMessageInstance messageInstance)voidcreateTimerEventTriggerInstance(STimerEventTriggerInstance eventTriggerInstance)STimerEventTriggerInstance is used to keep track of currently running timers usingProcessRuntimeAPI.searchTimerEventTriggerInstances(long, SearchOptions)voidcreateWaitingEvent(SWaitingEvent waitingEvent)voiddeleteEventTriggerInstance(STimerEventTriggerInstance eventTriggerInstance)voiddeleteMessageInstance(SMessageInstance messageInstance)voiddeleteMessageInstanceByIds(java.util.List<java.lang.Long> ids)voiddeleteWaitingEvent(SWaitingEvent waitingEvent)java.util.List<SBoundaryEventInstance>getActivityBoundaryEventInstances(long activityInstanceId, int fromIndex, int maxResults)java.util.List<SWaitingEvent>getAllWaitingEventsForProcessInstance(long processInstanceId, int fromIndex, int maxResults)Return waiting events related to the process instance passed as parameter, including the ones at flow node level.SWaitingErrorEventgetBoundaryWaitingErrorEvent(long relatedActivityInstanceId, java.lang.String errorCode)java.util.List<SEventInstance>getEventInstances(long rootContainerId, int fromIndex, int maxResults, java.lang.String fieldName, OrderByType orderByType)<T extends STimerEventTriggerInstance>
TgetEventTriggerInstance(java.lang.Class<T> entityClass, long eventTriggerInstanceId)java.util.List<SMessageEventCouple>getMessageEventCouples(int fromIndex, int maxResults)SMessageInstancegetMessageInstance(long messageInstanceId)java.util.List<java.lang.Long>getMessageInstanceIdOlderThanCreationDate(long creationDate, QueryOptions queryOptions)longgetNumberOfTimerEventTriggerInstances(long processInstanceId, QueryOptions queryOptions)Get the number of STimerEventTriggerInstance on the specific process instance & corresponding to the criterialonggetNumberOfWaitingEvents(java.lang.Class<? extends SWaitingEvent> entityClass, QueryOptions countOptions)java.util.List<SWaitingEvent>getStartWaitingEventsOfProcessDefinition(long processDefinitionId)search start waiting events related to a process definition (not its event sub processes)java.util.Optional<STimerEventTriggerInstance>getTimerEventTriggerInstanceOfFlowNode(long flowNodeInstanceId)java.util.List<SWaitingEvent>getWaitingEventsForFlowNodeId(long flowNodeInstanceId)SWaitingMessageEventgetWaitingMessage(long waitingMessageId)SWaitingSignalEventgetWaitingSignalEvent(long id)java.util.List<SWaitingSignalEvent>getWaitingSignalEvents(java.lang.String signalName, int fromIndex, int maxResults)intresetInProgressWaitingEvents()Resets all Waiting Message Events marked as 'in progress", so that they are eligible to match Message Instances again.intresetProgressMessageInstances()Resets all Message Instances marked as handled, so that they are eligible to match Waiting Events again.java.util.List<STimerEventTriggerInstance>searchTimerEventTriggerInstances(long processInstanceId, QueryOptions queryOptions)Search the list of STimerEventTriggerInstance on the specific process instance & corresponding to the criteria<T extends SWaitingEvent>
java.util.List<T>searchWaitingEvents(java.lang.Class<T> entityClass, QueryOptions searchOptions)voidupdateEventTriggerInstance(STimerEventTriggerInstance sTimerEventTriggerInstance, EntityUpdateDescriptor descriptor)Update an event trigger instance.voidupdateMessageInstance(SMessageInstance messageInstance, EntityUpdateDescriptor descriptor)voidupdateWaitingMessage(SWaitingMessageEvent waitingMessageEvent, EntityUpdateDescriptor descriptor)
-
-
-
Field Detail
-
QUERY_RESET_IN_PROGRESS_WAITING_EVENTS
public static final java.lang.String QUERY_RESET_IN_PROGRESS_WAITING_EVENTS
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
EventInstanceRepositoryImpl
public EventInstanceRepositoryImpl(Recorder recorder, PersistenceService persistenceService, EventService eventService, TechnicalLoggerService logger, ArchiveService archiveService)
-
-
Method Detail
-
createEventInstance
public void createEventInstance(SEventInstance eventInstance) throws SEventInstanceCreationException
- Specified by:
createEventInstancein interfaceEventInstanceRepository- Throws:
SEventInstanceCreationException
-
createTimerEventTriggerInstance
public void createTimerEventTriggerInstance(STimerEventTriggerInstance eventTriggerInstance) throws SEventTriggerInstanceCreationException
Description copied from interface:EventInstanceRepositorySTimerEventTriggerInstance is used to keep track of currently running timers usingProcessRuntimeAPI.searchTimerEventTriggerInstances(long, SearchOptions)- Specified by:
createTimerEventTriggerInstancein interfaceEventInstanceRepository- Throws:
SEventTriggerInstanceCreationException
-
createMessageInstance
public void createMessageInstance(SMessageInstance messageInstance) throws SMessageInstanceCreationException
- Specified by:
createMessageInstancein interfaceEventInstanceRepository- Throws:
SMessageInstanceCreationException
-
createWaitingEvent
public void createWaitingEvent(SWaitingEvent waitingEvent) throws SWaitingEventCreationException
- Specified by:
createWaitingEventin interfaceEventInstanceRepository- Throws:
SWaitingEventCreationException
-
deleteEventTriggerInstance
public void deleteEventTriggerInstance(STimerEventTriggerInstance eventTriggerInstance) throws SEventTriggerInstanceDeletionException
- Specified by:
deleteEventTriggerInstancein interfaceEventInstanceRepository- Throws:
SEventTriggerInstanceDeletionException
-
deleteMessageInstance
public void deleteMessageInstance(SMessageInstance messageInstance) throws SMessageModificationException
- Specified by:
deleteMessageInstancein interfaceEventInstanceRepository- Throws:
SMessageModificationException
-
getActivityBoundaryEventInstances
public java.util.List<SBoundaryEventInstance> getActivityBoundaryEventInstances(long activityInstanceId, int fromIndex, int maxResults) throws SEventInstanceReadException
- Specified by:
getActivityBoundaryEventInstancesin interfaceEventInstanceRepository- Returns:
- List of SBoundaryEventInstance, ordered by identifier ascending
- Throws:
SEventInstanceReadException
-
getBoundaryWaitingErrorEvent
public SWaitingErrorEvent getBoundaryWaitingErrorEvent(long relatedActivityInstanceId, java.lang.String errorCode) throws SWaitingEventReadException
- Specified by:
getBoundaryWaitingErrorEventin interfaceEventInstanceRepository- Throws:
SWaitingEventReadException
-
getEventInstances
public java.util.List<SEventInstance> getEventInstances(long rootContainerId, int fromIndex, int maxResults, java.lang.String fieldName, OrderByType orderByType) throws SEventInstanceReadException
- Specified by:
getEventInstancesin interfaceEventInstanceRepository- Throws:
SEventInstanceReadException
-
getEventTriggerInstance
public <T extends STimerEventTriggerInstance> T getEventTriggerInstance(java.lang.Class<T> entityClass, long eventTriggerInstanceId) throws SEventTriggerInstanceReadException
- Specified by:
getEventTriggerInstancein interfaceEventInstanceRepository- Returns:
- Throws:
SEventTriggerInstanceReadException
-
resetProgressMessageInstances
public int resetProgressMessageInstances() throws SMessageModificationExceptionDescription copied from interface:EventInstanceRepositoryResets all Message Instances marked as handled, so that they are eligible to match Waiting Events again.- Specified by:
resetProgressMessageInstancesin interfaceEventInstanceRepository- Throws:
SMessageModificationException- if an error occurs when resetting the 'handled' flag.
-
resetInProgressWaitingEvents
public int resetInProgressWaitingEvents() throws SWaitingEventModificationExceptionDescription copied from interface:EventInstanceRepositoryResets all Waiting Message Events marked as 'in progress", so that they are eligible to match Message Instances again.- Specified by:
resetInProgressWaitingEventsin interfaceEventInstanceRepository- Returns:
- the number of waiting events reset.
- Throws:
SWaitingEventModificationException- if an error occurs when resetting the 'progress' flag.
-
getMessageEventCouples
public java.util.List<SMessageEventCouple> getMessageEventCouples(int fromIndex, int maxResults) throws SEventTriggerInstanceReadException
- Specified by:
getMessageEventCouplesin interfaceEventInstanceRepository- Throws:
SEventTriggerInstanceReadException
-
getMessageInstance
public SMessageInstance getMessageInstance(long messageInstanceId) throws SMessageInstanceReadException
- Specified by:
getMessageInstancein interfaceEventInstanceRepository- Throws:
SMessageInstanceReadException
-
getMessageInstanceIdOlderThanCreationDate
public java.util.List<java.lang.Long> getMessageInstanceIdOlderThanCreationDate(long creationDate, QueryOptions queryOptions) throws SMessageInstanceReadException- Specified by:
getMessageInstanceIdOlderThanCreationDatein interfaceEventInstanceRepository- Throws:
SMessageInstanceReadException
-
deleteMessageInstanceByIds
public void deleteMessageInstanceByIds(java.util.List<java.lang.Long> ids) throws SMessageModificationException- Specified by:
deleteMessageInstanceByIdsin interfaceEventInstanceRepository- Throws:
SMessageModificationException
-
getNumberOfWaitingEvents
public long getNumberOfWaitingEvents(java.lang.Class<? extends SWaitingEvent> entityClass, QueryOptions countOptions) throws SBonitaReadException
- Specified by:
getNumberOfWaitingEventsin interfaceEventInstanceRepository- Throws:
SBonitaReadException
-
getStartWaitingEventsOfProcessDefinition
public java.util.List<SWaitingEvent> getStartWaitingEventsOfProcessDefinition(long processDefinitionId) throws SBonitaReadException
Description copied from interface:EventInstanceRepositorysearch start waiting events related to a process definition (not its event sub processes)- Specified by:
getStartWaitingEventsOfProcessDefinitionin interfaceEventInstanceRepository- Returns:
- Throws:
SBonitaReadException
-
getWaitingMessage
public SWaitingMessageEvent getWaitingMessage(long waitingMessageId) throws SWaitingEventReadException
- Specified by:
getWaitingMessagein interfaceEventInstanceRepository- Throws:
SWaitingEventReadException
-
deleteWaitingEvent
public void deleteWaitingEvent(SWaitingEvent waitingEvent) throws SWaitingEventModificationException
- Specified by:
deleteWaitingEventin interfaceEventInstanceRepository- Throws:
SWaitingEventModificationException
-
getWaitingEventsForFlowNodeId
public java.util.List<SWaitingEvent> getWaitingEventsForFlowNodeId(long flowNodeInstanceId) throws SEventTriggerInstanceReadException
- Specified by:
getWaitingEventsForFlowNodeIdin interfaceEventInstanceRepository- Throws:
SEventTriggerInstanceReadException
-
getAllWaitingEventsForProcessInstance
public java.util.List<SWaitingEvent> getAllWaitingEventsForProcessInstance(long processInstanceId, int fromIndex, int maxResults) throws SEventTriggerInstanceReadException
Description copied from interface:EventInstanceRepositoryReturn waiting events related to the process instance passed as parameter, including the ones at flow node level.- Specified by:
getAllWaitingEventsForProcessInstancein interfaceEventInstanceRepository- Throws:
SEventTriggerInstanceReadException
-
getWaitingSignalEvents
public java.util.List<SWaitingSignalEvent> getWaitingSignalEvents(java.lang.String signalName, int fromIndex, int maxResults) throws SEventTriggerInstanceReadException
- Specified by:
getWaitingSignalEventsin interfaceEventInstanceRepository- Returns:
- Throws:
SEventTriggerInstanceReadException
-
getWaitingSignalEvent
public SWaitingSignalEvent getWaitingSignalEvent(long id) throws SEventTriggerInstanceReadException, SEventTriggerInstanceNotFoundException
- Specified by:
getWaitingSignalEventin interfaceEventInstanceRepository- Throws:
SEventTriggerInstanceReadExceptionSEventTriggerInstanceNotFoundException
-
getTimerEventTriggerInstanceOfFlowNode
public java.util.Optional<STimerEventTriggerInstance> getTimerEventTriggerInstanceOfFlowNode(long flowNodeInstanceId) throws SBonitaReadException
- Specified by:
getTimerEventTriggerInstanceOfFlowNodein interfaceEventInstanceRepository- Parameters:
flowNodeInstanceId- the flow node instance id- Returns:
- the timer event trigger instance of this flow node if there is one
- Throws:
SBonitaReadException
-
getNumberOfTimerEventTriggerInstances
public long getNumberOfTimerEventTriggerInstances(long processInstanceId, QueryOptions queryOptions) throws SBonitaReadExceptionDescription copied from interface:EventInstanceRepositoryGet the number of STimerEventTriggerInstance on the specific process instance & corresponding to the criteria- Specified by:
getNumberOfTimerEventTriggerInstancesin interfaceEventInstanceRepository- Parameters:
processInstanceId- The identifier of the process instancequeryOptions- Criteria of the search- Returns:
- The number of STimerEventTriggerInstance on the specific process instance & corresponding to the criteria
- Throws:
SBonitaReadException
-
searchTimerEventTriggerInstances
public java.util.List<STimerEventTriggerInstance> searchTimerEventTriggerInstances(long processInstanceId, QueryOptions queryOptions) throws SBonitaReadException
Description copied from interface:EventInstanceRepositorySearch the list of STimerEventTriggerInstance on the specific process instance & corresponding to the criteria- Specified by:
searchTimerEventTriggerInstancesin interfaceEventInstanceRepository- Parameters:
processInstanceId- The identifier of the process instancequeryOptions- Criteria of the search- Returns:
- The list of STimerEventTriggerInstance on the specific process instance & corresponding to the criteria
- Throws:
SBonitaReadException
-
searchWaitingEvents
public <T extends SWaitingEvent> java.util.List<T> searchWaitingEvents(java.lang.Class<T> entityClass, QueryOptions searchOptions) throws SBonitaReadException
- Specified by:
searchWaitingEventsin interfaceEventInstanceRepository- Throws:
SBonitaReadException
-
updateMessageInstance
public void updateMessageInstance(SMessageInstance messageInstance, EntityUpdateDescriptor descriptor) throws SMessageModificationException
- Specified by:
updateMessageInstancein interfaceEventInstanceRepository- Throws:
SMessageModificationException
-
updateWaitingMessage
public void updateWaitingMessage(SWaitingMessageEvent waitingMessageEvent, EntityUpdateDescriptor descriptor) throws SWaitingEventModificationException
- Specified by:
updateWaitingMessagein interfaceEventInstanceRepository- Throws:
SWaitingEventModificationException
-
updateEventTriggerInstance
public void updateEventTriggerInstance(STimerEventTriggerInstance sTimerEventTriggerInstance, EntityUpdateDescriptor descriptor) throws SEventTriggerInstanceModificationException
Description copied from interface:EventInstanceRepositoryUpdate an event trigger instance.- Specified by:
updateEventTriggerInstancein interfaceEventInstanceRepository- Parameters:
sTimerEventTriggerInstance- The event trigger instance to updatedescriptor- The fields to update- Throws:
SEventTriggerInstanceModificationException
-
-