コード例 #1
0
ファイル: EventHandlerImpl.cs プロジェクト: zf321/ESS.FW.Bpm
        public virtual void HandleIntermediateEvent(EventSubscriptionEntity eventSubscription, object payload,
                                                    CommandContext commandContext)
        {
            PvmExecutionImpl execution = eventSubscription.Execution;
            ActivityImpl     activity  = eventSubscription.Activity;

            EnsureUtil.EnsureNotNull("Error while sending signal for event subscription '" + eventSubscription.Id + "': " + "no activity associated with event subscription", "activity", activity);

            if (payload is IDictionary)
            {
                var processVariables = payload as IDictionary <string, object>;
                execution.Variables = processVariables;
            }

            if (activity == execution.Activity)
            {
                execution.Signal("signal", null);
            }
            else
            {
                // hack around the fact that the start event is refrenced by event subscriptions for event subprocesses
                // and not the subprocess itself
                if (activity.ActivityBehavior is EventSubProcessStartEventActivityBehavior)
                {
                    activity = (ActivityImpl)activity.FlowScope;
                }

                execution.ExecuteEventHandlerActivity(activity);
            }
        }
コード例 #2
0
        public virtual void LeaveOnSatisfiedCondition(EventSubscriptionEntity eventSubscription,
                                                      VariableEvent variableEvent)
        {
            PvmExecutionImpl execution = eventSubscription.Execution;

            if (execution != null && !execution.IsEnded && execution.IsScope &&
                ConditionalEvent.TryEvaluate(variableEvent, execution))
            {
                execution.ExecuteEventHandlerActivity(eventSubscription.Activity);
            }
        }
コード例 #3
0
        public virtual void LeaveOnSatisfiedCondition(EventSubscriptionEntity eventSubscription,
                                                      VariableEvent variableEvent)
        {
            PvmExecutionImpl execution = eventSubscription.Execution;

            if (execution != null && !execution.IsEnded && variableEvent != null && ConditionalEvent.TryEvaluate(variableEvent, execution) && execution.IsActive && execution.IsScope)
            {
                if (IsAfterEventBasedGateway)
                {
                    ActivityImpl activity = eventSubscription.Activity;
                    execution.ExecuteEventHandlerActivity(activity);
                }
                else
                {
                    Leave(execution);
                }
            }
        }