public void handleEvent(EventSubscriptionEntity eventSubscription, Object payload, CommandContext commandContext) { ExecutionEntity execution = eventSubscription.getExecution(); FlowNode currentFlowElement = (FlowNode) execution.getCurrentFlowElement(); if (currentFlowElement == null) { throw new ActivitiException("Error while sending signal for event subscription '" + eventSubscription.getId() + "': " + "no activity associated with event subscription"); } if (payload instanceof Map) { @SuppressWarnings("unchecked") Map<String, Object> processVariables = (Map<String, Object>) payload; execution.setVariables(processVariables); } if (currentFlowElement instanceof BoundaryEvent || currentFlowElement instanceof EventSubProcess) { try { dispatchActivitiesCanceledIfNeeded(eventSubscription, execution, currentFlowElement, commandContext); } catch (RuntimeException e) { throw e; } catch (Exception e) { throw new ActivitiException("exception while sending signal for event subscription '" + eventSubscription + "':" + e.getMessage(), e); } } Context.getAgenda().planTriggerExecutionOperation(execution); }
public void handleEvent(EventSubscriptionEntity eventSubscription, Object payload, CommandContext commandContext) { ExecutionEntity execution = eventSubscription.getExecution(); FlowNode currentFlowElement = (FlowNode) execution.getCurrentFlowElement(); if (currentFlowElement == null) { throw new ActivitiException("Error while sending signal for event subscription '" + eventSubscription.getId() + "': " + "no activity associated with event subscription"); } if (payload instanceof Map) { @SuppressWarnings("unchecked") Map<String, Object> processVariables = (Map<String, Object>) payload; execution.setVariables(processVariables); } if (currentFlowElement instanceof BoundaryEvent || currentFlowElement instanceof EventSubProcess) { try { dispatchActivitiesCanceledIfNeeded(eventSubscription, execution, currentFlowElement, commandContext); } catch (RuntimeException e) { throw e; } catch (Exception e) { throw new ActivitiException("exception while sending signal for event subscription '" + eventSubscription + "':" + e.getMessage(), e); } } Context.getAgenda().planTriggerExecutionOperation(execution); }
dispatchActivitiesCanceledIfNeeded(eventSubscription, execution, activity, commandContext);