Class EventInstanceServiceImpl
- java.lang.Object
-
- org.bonitasoft.engine.core.process.instance.event.impl.EventInstanceServiceImpl
-
- All Implemented Interfaces:
EventInstanceService
public class EventInstanceServiceImpl extends java.lang.Object implements EventInstanceService
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringBONITA_BPMENGINE_MESSAGE_SENT
-
Constructor Summary
Constructors Constructor Description EventInstanceServiceImpl(EventInstanceRepository eventInstanceRepository, DataInstanceService dataInstanceService, io.micrometer.core.instrument.MeterRegistry meterRegistry, java.lang.Long tenantId)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcreateEventInstance(SEventInstance eventInstance)voidcreateMessageInstance(SMessageInstance messageInstance)voidcreateTimerEventTriggerInstance(STimerEventTriggerInstance sEventTriggerInstance)STimerEventTriggerInstance is used to keep track of currently running timers usingProcessRuntimeAPI.searchTimerEventTriggerInstances(long, SearchOptions)voidcreateWaitingEvent(SWaitingEvent sWaitingEvent)voiddeleteEventTriggerInstance(STimerEventTriggerInstance sTimerEventTriggerInstance)voiddeleteEventTriggerInstanceOfFlowNode(long flowNodeInstanceId)java.lang.IntegerdeleteMessageAndDataInstanceOlderThanCreationDate(long creationDate, QueryOptions queryOptions)voiddeleteMessageInstance(SMessageInstance messageInstance)voiddeleteWaitingEvent(SWaitingEvent sWaitingEvent)voiddeleteWaitingEvents(SFlowNodeInstance flowNodeInstance)voiddeleteWaitingEvents(SProcessInstance processInstance)java.util.List<SBoundaryEventInstance>getActivityBoundaryEventInstances(long id, int fromIndex, int maxResults)SWaitingErrorEventgetBoundaryWaitingErrorEvent(long id, java.lang.String catchingErrorCode)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 i, int maxCouples)SMessageInstancegetMessageInstance(long messageInstanceId)java.util.List<java.lang.Long>getMessageInstanceIdOlderThanCreationDate(long creationDate, QueryOptions queryOptions)longgetNumberOfTimerEventTriggerInstances(long processInstanceId, QueryOptions searchOptions)Get the number of STimerEventTriggerInstance on the specific process instance & corresponding to the criterialonggetNumberOfWaitingEvents(java.lang.Class<? extends SWaitingEvent> sWaitingEventClass, QueryOptions searchOptions)java.util.List<SWaitingEvent>getStartWaitingEventsOfProcessDefinition(long processDefinitionId)java.util.Optional<STimerEventTriggerInstance>getTimerEventTriggerInstanceOfFlowNode(long flowNodeInstanceId)SWaitingMessageEventgetWaitingMessage(long waitingMessageId)SWaitingSignalEventgetWaitingSignalEvent(long signalId)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 searchOptions)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> waitingEventClass, QueryOptions queryOptions)voidupdateEventTriggerInstance(STimerEventTriggerInstance sTimerEventTriggerInstance, EntityUpdateDescriptor descriptor)Update an event trigger instance.voidupdateMessageInstance(SMessageInstance messageInstance, EntityUpdateDescriptor descriptor)voidupdateWaitingMessage(SWaitingMessageEvent waitingMsg, EntityUpdateDescriptor descriptor)
-
-
-
Field Detail
-
BONITA_BPMENGINE_MESSAGE_SENT
public static final java.lang.String BONITA_BPMENGINE_MESSAGE_SENT
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
EventInstanceServiceImpl
public EventInstanceServiceImpl(EventInstanceRepository eventInstanceRepository, DataInstanceService dataInstanceService, io.micrometer.core.instrument.MeterRegistry meterRegistry, java.lang.Long tenantId)
-
-
Method Detail
-
createEventInstance
public void createEventInstance(SEventInstance eventInstance) throws SEventInstanceCreationException
- Specified by:
createEventInstancein interfaceEventInstanceService- Throws:
SEventInstanceCreationException
-
createTimerEventTriggerInstance
public void createTimerEventTriggerInstance(STimerEventTriggerInstance sEventTriggerInstance) throws SEventTriggerInstanceCreationException
Description copied from interface:EventInstanceServiceSTimerEventTriggerInstance is used to keep track of currently running timers usingProcessRuntimeAPI.searchTimerEventTriggerInstances(long, SearchOptions)- Specified by:
createTimerEventTriggerInstancein interfaceEventInstanceService- Throws:
SEventTriggerInstanceCreationException
-
createMessageInstance
public void createMessageInstance(SMessageInstance messageInstance) throws SMessageInstanceCreationException
- Specified by:
createMessageInstancein interfaceEventInstanceService- Throws:
SMessageInstanceCreationException
-
createWaitingEvent
public void createWaitingEvent(SWaitingEvent sWaitingEvent) throws SWaitingEventCreationException
- Specified by:
createWaitingEventin interfaceEventInstanceService- Throws:
SWaitingEventCreationException
-
deleteEventTriggerInstance
public void deleteEventTriggerInstance(STimerEventTriggerInstance sTimerEventTriggerInstance) throws SEventTriggerInstanceDeletionException
- Specified by:
deleteEventTriggerInstancein interfaceEventInstanceService- Throws:
SEventTriggerInstanceDeletionException
-
deleteEventTriggerInstanceOfFlowNode
public void deleteEventTriggerInstanceOfFlowNode(long flowNodeInstanceId) throws SBonitaReadException, SEventTriggerInstanceDeletionException- Specified by:
deleteEventTriggerInstanceOfFlowNodein interfaceEventInstanceService- Throws:
SBonitaReadExceptionSEventTriggerInstanceDeletionException
-
deleteMessageInstance
public void deleteMessageInstance(SMessageInstance messageInstance) throws SMessageModificationException
- Specified by:
deleteMessageInstancein interfaceEventInstanceService- Throws:
SMessageModificationException
-
deleteWaitingEvent
public void deleteWaitingEvent(SWaitingEvent sWaitingEvent) throws SWaitingEventModificationException
- Specified by:
deleteWaitingEventin interfaceEventInstanceService- Throws:
SWaitingEventModificationException
-
deleteWaitingEvents
public void deleteWaitingEvents(SFlowNodeInstance flowNodeInstance) throws SWaitingEventModificationException, SEventTriggerInstanceReadException
- Specified by:
deleteWaitingEventsin interfaceEventInstanceService- Throws:
SWaitingEventModificationExceptionSEventTriggerInstanceReadException
-
deleteWaitingEvents
public void deleteWaitingEvents(SProcessInstance processInstance) throws SWaitingEventModificationException, SEventTriggerInstanceReadException
- Specified by:
deleteWaitingEventsin interfaceEventInstanceService- Throws:
SWaitingEventModificationExceptionSEventTriggerInstanceReadException
-
getActivityBoundaryEventInstances
public java.util.List<SBoundaryEventInstance> getActivityBoundaryEventInstances(long id, int fromIndex, int maxResults) throws SEventInstanceReadException
- Specified by:
getActivityBoundaryEventInstancesin interfaceEventInstanceService- Returns:
- List of SBoundaryEventInstance, ordered by identifier ascending
- Throws:
SEventInstanceReadException
-
getBoundaryWaitingErrorEvent
public SWaitingErrorEvent getBoundaryWaitingErrorEvent(long id, java.lang.String catchingErrorCode) throws SWaitingEventReadException
- Specified by:
getBoundaryWaitingErrorEventin interfaceEventInstanceService- 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 interfaceEventInstanceService- Throws:
SEventInstanceReadException
-
getEventTriggerInstance
public <T extends STimerEventTriggerInstance> T getEventTriggerInstance(java.lang.Class<T> entityClass, long eventTriggerInstanceId) throws SEventTriggerInstanceReadException
- Specified by:
getEventTriggerInstancein interfaceEventInstanceService- Returns:
- Throws:
SEventTriggerInstanceReadException
-
resetProgressMessageInstances
public int resetProgressMessageInstances() throws SMessageModificationExceptionDescription copied from interface:EventInstanceServiceResets all Message Instances marked as handled, so that they are eligible to match Waiting Events again.- Specified by:
resetProgressMessageInstancesin interfaceEventInstanceService- Throws:
SMessageModificationException- if an error occurs when resetting the 'handled' flag.
-
resetInProgressWaitingEvents
public int resetInProgressWaitingEvents() throws SWaitingEventModificationExceptionDescription copied from interface:EventInstanceServiceResets all Waiting Message Events marked as 'in progress", so that they are eligible to match Message Instances again.- Specified by:
resetInProgressWaitingEventsin interfaceEventInstanceService- 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 i, int maxCouples) throws SEventTriggerInstanceReadException
- Specified by:
getMessageEventCouplesin interfaceEventInstanceService- Throws:
SEventTriggerInstanceReadException
-
getMessageInstance
public SMessageInstance getMessageInstance(long messageInstanceId) throws SMessageInstanceReadException
- Specified by:
getMessageInstancein interfaceEventInstanceService- Throws:
SMessageInstanceReadException
-
getNumberOfWaitingEvents
public long getNumberOfWaitingEvents(java.lang.Class<? extends SWaitingEvent> sWaitingEventClass, QueryOptions searchOptions) throws SBonitaReadException
- Specified by:
getNumberOfWaitingEventsin interfaceEventInstanceService- Throws:
SBonitaReadException
-
getStartWaitingEventsOfProcessDefinition
public java.util.List<SWaitingEvent> getStartWaitingEventsOfProcessDefinition(long processDefinitionId) throws SBonitaReadException
- Specified by:
getStartWaitingEventsOfProcessDefinitionin interfaceEventInstanceService- Returns:
- Throws:
SBonitaReadException
-
getWaitingMessage
public SWaitingMessageEvent getWaitingMessage(long waitingMessageId) throws SWaitingEventReadException
- Specified by:
getWaitingMessagein interfaceEventInstanceService- Throws:
SWaitingEventReadException
-
getWaitingSignalEvents
public java.util.List<SWaitingSignalEvent> getWaitingSignalEvents(java.lang.String signalName, int fromIndex, int maxResults) throws SEventTriggerInstanceReadException
- Specified by:
getWaitingSignalEventsin interfaceEventInstanceService- Returns:
- Throws:
SEventTriggerInstanceReadException
-
getWaitingSignalEvent
public SWaitingSignalEvent getWaitingSignalEvent(long signalId) throws SEventTriggerInstanceReadException, SEventTriggerInstanceNotFoundException
- Specified by:
getWaitingSignalEventin interfaceEventInstanceService- Throws:
SEventTriggerInstanceReadExceptionSEventTriggerInstanceNotFoundException
-
getTimerEventTriggerInstanceOfFlowNode
public java.util.Optional<STimerEventTriggerInstance> getTimerEventTriggerInstanceOfFlowNode(long flowNodeInstanceId) throws SBonitaReadException
- Specified by:
getTimerEventTriggerInstanceOfFlowNodein interfaceEventInstanceService- 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 searchOptions) throws SBonitaReadExceptionDescription copied from interface:EventInstanceServiceGet the number of STimerEventTriggerInstance on the specific process instance & corresponding to the criteria- Specified by:
getNumberOfTimerEventTriggerInstancesin interfaceEventInstanceService- Parameters:
processInstanceId- The identifier of the process instancesearchOptions- 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 searchOptions) throws SBonitaReadException
Description copied from interface:EventInstanceServiceSearch the list of STimerEventTriggerInstance on the specific process instance & corresponding to the criteria- Specified by:
searchTimerEventTriggerInstancesin interfaceEventInstanceService- Parameters:
processInstanceId- The identifier of the process instancesearchOptions- 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> waitingEventClass, QueryOptions queryOptions) throws SBonitaReadException
- Specified by:
searchWaitingEventsin interfaceEventInstanceService- Throws:
SBonitaReadException
-
updateMessageInstance
public void updateMessageInstance(SMessageInstance messageInstance, EntityUpdateDescriptor descriptor) throws SMessageModificationException
- Specified by:
updateMessageInstancein interfaceEventInstanceService- Throws:
SMessageModificationException
-
updateWaitingMessage
public void updateWaitingMessage(SWaitingMessageEvent waitingMsg, EntityUpdateDescriptor descriptor) throws SWaitingEventModificationException
- Specified by:
updateWaitingMessagein interfaceEventInstanceService- Throws:
SWaitingEventModificationException
-
deleteMessageAndDataInstanceOlderThanCreationDate
public java.lang.Integer deleteMessageAndDataInstanceOlderThanCreationDate(long creationDate, QueryOptions queryOptions) throws SMessageModificationException- Specified by:
deleteMessageAndDataInstanceOlderThanCreationDatein interfaceEventInstanceService- Throws:
SMessageModificationException
-
getMessageInstanceIdOlderThanCreationDate
public java.util.List<java.lang.Long> getMessageInstanceIdOlderThanCreationDate(long creationDate, QueryOptions queryOptions) throws SEventTriggerInstanceReadException, SMessageInstanceReadException- Specified by:
getMessageInstanceIdOlderThanCreationDatein interfaceEventInstanceService- Throws:
SEventTriggerInstanceReadExceptionSMessageInstanceReadException
-
updateEventTriggerInstance
public void updateEventTriggerInstance(STimerEventTriggerInstance sTimerEventTriggerInstance, EntityUpdateDescriptor descriptor) throws SEventTriggerInstanceModificationException
Description copied from interface:EventInstanceServiceUpdate an event trigger instance.- Specified by:
updateEventTriggerInstancein interfaceEventInstanceService- Parameters:
sTimerEventTriggerInstance- The event trigger instance to updatedescriptor- The fields to update- Throws:
SEventTriggerInstanceModificationException
-
-