Class EventsHandler
java.lang.Object
org.bonitasoft.engine.execution.event.EventsHandler
Handle event depending on its type
TODO
* Move all code that instantiate process/execute flow node after a event was triggered here + make it call
reachedCatchEvent
* For event sub process: the instantiate process must cancel all activities then instantiate the process
* the instantiate event subprocess method is like the start of the process executor but with less things: factorise
it
* check that there is no execution issues with event sub process (add more test)
* add test for each kind of start event in event sub process
* try to trigger event subprocess with multiple events
- Author:
- Baptiste Mesta, Elias Ricken de Medeiros, Celine Souchet
-
Constructor Summary
ConstructorsConstructorDescriptionEventsHandler(SchedulerService schedulerService, ExpressionResolverService expressionResolverService, EventInstanceService eventInstanceService, BPMInstancesCreator bpmInstancesCreator, ProcessDefinitionService processDefinitionService, ContainerRegistry containerRegistry, ProcessInstanceService processInstanceService, FlowNodeInstanceService flowNodeInstanceService, OperationService operationService, MessagesHandlingService messagesHandlingService, WorkService workService, BPMWorkFactory workFactory, ProcessInstanceInterruptor processInstanceInterruptor) -
Method Summary
Modifier and TypeMethodDescriptiongetHandler(SEventTriggerType triggerType) voidhandleCatchEvent(SProcessDefinition processDefinition, SEventDefinition eventDefinition, SEventInstance eventInstance) called when a catchEvent is reached e.g.voidhandleCatchMessage(SProcessDefinition processDefinition, SReceiveTaskDefinition receiveTaskDefinition, SReceiveTaskInstance receiveTaskInstance) voidhandleEventSubProcess(SProcessDefinition sDefinition, SProcessInstance parentProcessInstance) booleanhandlePostThrowEvent(SProcessDefinition sProcessDefinition, SEndEventDefinition sEndEventDefinition, SThrowEventInstance sThrowEventInstance, SFlowNodeInstance sFlowNodeInstance) voidhandleThrowEvent(SEventTriggerDefinition sEventTriggerDefinition) called when a BPM event is triggered by the APIvoidhandleThrowEvent(SProcessDefinition processDefinition, SEventDefinition eventDefinition, SEventInstance eventInstance) called when we reach a throw event in the flow of a processvoidhandleThrowMessage(SProcessDefinition processDefinition, SSendTaskDefinition sendTaskDefinition, SSendTaskInstance sendTaskInstance) voidsetProcessExecutor(ProcessExecutor processExecutor) voidtriggerCatchEvent(String eventType, Long processDefinitionId, Long targetSFlowNodeDefinitionId, Long flowNodeInstanceId, String containerType) voidtriggerCatchEvent(SEventTriggerType eventTriggerType, Long processDefinitionId, Long targetSFlowNodeDefinitionId, String containerType, long subProcessId, Long parentProcessInstanceId, Long rootProcessInstanceId, Boolean isInterrupting) voidtriggerCatchEvent(SWaitingEvent waitingEvent, Long triggeringElementID) When a trigger is 'launched' the catch event is reached and is waken up/created using its waiting event Depending on the type it will execute the catch event of instantiate the process/subprocessvoidunregisterEventSubProcess(SProcessDefinition sDefinition, SProcessInstance parentProcessInstance)
-
Constructor Details
-
EventsHandler
public EventsHandler(SchedulerService schedulerService, ExpressionResolverService expressionResolverService, EventInstanceService eventInstanceService, BPMInstancesCreator bpmInstancesCreator, ProcessDefinitionService processDefinitionService, ContainerRegistry containerRegistry, ProcessInstanceService processInstanceService, FlowNodeInstanceService flowNodeInstanceService, OperationService operationService, MessagesHandlingService messagesHandlingService, WorkService workService, BPMWorkFactory workFactory, ProcessInstanceInterruptor processInstanceInterruptor)
-
-
Method Details
-
setProcessExecutor
-
handleCatchEvent
public void handleCatchEvent(SProcessDefinition processDefinition, SEventDefinition eventDefinition, SEventInstance eventInstance) throws SBonitaException called when a catchEvent is reached e.g. we are going on a catch event in the flow of a process This is different of trigger catch event: e.g. for a message handleCatchEvent will create the waiting event and triggerCatchEvent is called when the message is received- Parameters:
processDefinition-eventDefinition-eventInstance-- Throws:
SBonitaException
-
handleCatchMessage
public void handleCatchMessage(SProcessDefinition processDefinition, SReceiveTaskDefinition receiveTaskDefinition, SReceiveTaskInstance receiveTaskInstance) throws SBonitaException - Throws:
SBonitaException
-
handleEventSubProcess
public void handleEventSubProcess(SProcessDefinition sDefinition, SProcessInstance parentProcessInstance) throws SBonitaException - Throws:
SBonitaException
-
unregisterEventSubProcess
public void unregisterEventSubProcess(SProcessDefinition sDefinition, SProcessInstance parentProcessInstance) throws SBonitaException - Throws:
SBonitaException
-
handleThrowEvent
public void handleThrowEvent(SProcessDefinition processDefinition, SEventDefinition eventDefinition, SEventInstance eventInstance) throws SBonitaException called when we reach a throw event in the flow of a process- Parameters:
processDefinition-eventDefinition-eventInstance-- Throws:
SBonitaException
-
handleThrowMessage
public void handleThrowMessage(SProcessDefinition processDefinition, SSendTaskDefinition sendTaskDefinition, SSendTaskInstance sendTaskInstance) throws SMessageInstanceCreationException, SDataInstanceException, SExpressionException, STransactionNotFoundException -
handlePostThrowEvent
public boolean handlePostThrowEvent(SProcessDefinition sProcessDefinition, SEndEventDefinition sEndEventDefinition, SThrowEventInstance sThrowEventInstance, SFlowNodeInstance sFlowNodeInstance) throws SBonitaException - Throws:
SBonitaException
-
handleThrowEvent
public void handleThrowEvent(SEventTriggerDefinition sEventTriggerDefinition) throws SBonitaException called when a BPM event is triggered by the API- Parameters:
sEventTriggerDefinition-- Throws:
SBonitaException
-
triggerCatchEvent
public void triggerCatchEvent(SWaitingEvent waitingEvent, Long triggeringElementID) throws SBonitaException When a trigger is 'launched' the catch event is reached and is waken up/created using its waiting event Depending on the type it will execute the catch event of instantiate the process/subprocess- Parameters:
waitingEvent-triggeringElementID-- Throws:
SBonitaException
-
triggerCatchEvent
public void triggerCatchEvent(String eventType, Long processDefinitionId, Long targetSFlowNodeDefinitionId, Long flowNodeInstanceId, String containerType) throws SBonitaException - Throws:
SBonitaException
-
triggerCatchEvent
public void triggerCatchEvent(SEventTriggerType eventTriggerType, Long processDefinitionId, Long targetSFlowNodeDefinitionId, String containerType, long subProcessId, Long parentProcessInstanceId, Long rootProcessInstanceId, Boolean isInterrupting) throws SBonitaException - Throws:
SBonitaException
-
getHandler
-