Search in sources :

Example 1 with EventSubProcessStartEventActivityBehavior

use of org.camunda.bpm.engine.impl.bpmn.behavior.EventSubProcessStartEventActivityBehavior in project camunda-bpm-platform by camunda.

the class EventHandlerImpl method handleIntermediateEvent.

public void handleIntermediateEvent(EventSubscriptionEntity eventSubscription, Object payload, CommandContext commandContext) {
    PvmExecutionImpl execution = eventSubscription.getExecution();
    ActivityImpl activity = eventSubscription.getActivity();
    ensureNotNull("Error while sending signal for event subscription '" + eventSubscription.getId() + "': " + "no activity associated with event subscription", "activity", activity);
    if (payload instanceof Map) {
        execution.setVariables((Map<String, Object>) payload);
    }
    if (activity.equals(execution.getActivity())) {
        execution.signal("signal", null);
    } else {
        // and not the subprocess itself
        if (activity.getActivityBehavior() instanceof EventSubProcessStartEventActivityBehavior) {
            activity = (ActivityImpl) activity.getFlowScope();
        }
        execution.executeEventHandlerActivity(activity);
    }
}
Also used : ActivityImpl(org.camunda.bpm.engine.impl.pvm.process.ActivityImpl) PvmExecutionImpl(org.camunda.bpm.engine.impl.pvm.runtime.PvmExecutionImpl) EventSubProcessStartEventActivityBehavior(org.camunda.bpm.engine.impl.bpmn.behavior.EventSubProcessStartEventActivityBehavior) Map(java.util.Map)

Aggregations

Map (java.util.Map)1 EventSubProcessStartEventActivityBehavior (org.camunda.bpm.engine.impl.bpmn.behavior.EventSubProcessStartEventActivityBehavior)1 ActivityImpl (org.camunda.bpm.engine.impl.pvm.process.ActivityImpl)1 PvmExecutionImpl (org.camunda.bpm.engine.impl.pvm.runtime.PvmExecutionImpl)1