public virtual void handleIntermediateEvent(EventSubscriptionEntity eventSubscription, object payload, object localPayload, CommandContext commandContext) { PvmExecutionImpl execution = eventSubscription.Execution; ActivityImpl activity = eventSubscription.Activity; ensureNotNull("Error while sending signal for event subscription '" + eventSubscription.Id + "': " + "no activity associated with event subscription", "activity", activity); if (payload is System.Collections.IDictionary) { execution.Variables = (IDictionary <string, object>)payload; } if (localPayload is System.Collections.IDictionary) { execution.VariablesLocal = (IDictionary <string, object>)localPayload; } if (activity.Equals(execution.getActivity())) { execution.signal("signal", null); } else { // hack around the fact that the start event is referenced by event subscriptions for event subprocesses // and not the subprocess itself if (activity.ActivityBehavior is EventSubProcessStartEventActivityBehavior) { activity = (ActivityImpl)activity.FlowScope; } execution.executeEventHandlerActivity(activity); } }