Class EventsHandler
- java.lang.Object
-
- org.bonitasoft.engine.execution.event.EventsHandler
-
public class EventsHandler extends java.lang.ObjectHandle 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
Constructors Constructor Description EventsHandler(SchedulerService schedulerService, ExpressionResolverService expressionResolverService, EventInstanceService eventInstanceService, BPMInstancesCreator bpmInstancesCreator, ProcessDefinitionService processDefinitionService, ContainerRegistry containerRegistry, ProcessInstanceService processInstanceService, FlowNodeInstanceService flowNodeInstanceService, TechnicalLoggerService logger, OperationService operationService, MessagesHandlingService messagesHandlingService, WorkService workService, BPMWorkFactory workFactory, ProcessInstanceInterruptor processInstanceInterruptor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description EventHandlerStrategygetHandler(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(java.lang.String eventType, java.lang.Long processDefinitionId, java.lang.Long targetSFlowNodeDefinitionId, java.lang.Long flowNodeInstanceId, java.lang.String containerType)voidtriggerCatchEvent(SEventTriggerType eventTriggerType, java.lang.Long processDefinitionId, java.lang.Long targetSFlowNodeDefinitionId, java.lang.String containerType, long subProcessId, java.lang.Long parentProcessInstanceId, java.lang.Long rootProcessInstanceId, java.lang.Boolean isInterrupting)voidtriggerCatchEvent(SWaitingEvent waitingEvent, java.lang.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 Detail
-
EventsHandler
public EventsHandler(SchedulerService schedulerService, ExpressionResolverService expressionResolverService, EventInstanceService eventInstanceService, BPMInstancesCreator bpmInstancesCreator, ProcessDefinitionService processDefinitionService, ContainerRegistry containerRegistry, ProcessInstanceService processInstanceService, FlowNodeInstanceService flowNodeInstanceService, TechnicalLoggerService logger, OperationService operationService, MessagesHandlingService messagesHandlingService, WorkService workService, BPMWorkFactory workFactory, ProcessInstanceInterruptor processInstanceInterruptor)
-
-
Method Detail
-
setProcessExecutor
public void setProcessExecutor(ProcessExecutor processExecutor)
-
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, java.lang.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(java.lang.String eventType, java.lang.Long processDefinitionId, java.lang.Long targetSFlowNodeDefinitionId, java.lang.Long flowNodeInstanceId, java.lang.String containerType) throws SBonitaException- Throws:
SBonitaException
-
triggerCatchEvent
public void triggerCatchEvent(SEventTriggerType eventTriggerType, java.lang.Long processDefinitionId, java.lang.Long targetSFlowNodeDefinitionId, java.lang.String containerType, long subProcessId, java.lang.Long parentProcessInstanceId, java.lang.Long rootProcessInstanceId, java.lang.Boolean isInterrupting) throws SBonitaException
- Throws:
SBonitaException
-
getHandler
public EventHandlerStrategy getHandler(SEventTriggerType triggerType)
-
-