internal override void ProcessEvent(ActivityExecutionContext context)
 {
     SetStateEventArgs args = context.GetService<WorkflowQueuingService>().GetWorkflowQueue("SetStateQueue").Dequeue() as SetStateEventArgs;
     StateActivity currentState = StateMachineHelpers.GetCurrentState(context);
     if (currentState == null)
     {
         throw new InvalidOperationException(SR.GetStateMachineWorkflowMustHaveACurrentState());
     }
     StateMachineExecutionState state = StateMachineExecutionState.Get(StateMachineHelpers.GetRootState((StateActivity) context.Activity));
     SetStateAction action = new SetStateAction(currentState.QualifiedName, args.TargetStateName);
     state.EnqueueAction(action);
     state.ProcessActions(context);
 }
Beispiel #2
0
        internal override void ProcessEvent(ActivityExecutionContext context)
        {
            SetStateEventArgs args         = context.GetService <WorkflowQueuingService>().GetWorkflowQueue("SetStateQueue").Dequeue() as SetStateEventArgs;
            StateActivity     currentState = StateMachineHelpers.GetCurrentState(context);

            if (currentState == null)
            {
                throw new InvalidOperationException(SR.GetStateMachineWorkflowMustHaveACurrentState());
            }
            StateMachineExecutionState state  = StateMachineExecutionState.Get(StateMachineHelpers.GetRootState((StateActivity)context.Activity));
            SetStateAction             action = new SetStateAction(currentState.QualifiedName, args.TargetStateName);

            state.EnqueueAction(action);
            state.ProcessActions(context);
        }
        internal override void ProcessEvent(ActivityExecutionContext context)
        {
            WorkflowQueuingService workflowQueuingService = context.GetService <WorkflowQueuingService>();
            WorkflowQueue          workflowQueue          = workflowQueuingService.GetWorkflowQueue(StateMachineWorkflowActivity.SetStateQueueName);
            SetStateEventArgs      eventArgs    = workflowQueue.Dequeue() as SetStateEventArgs;
            StateActivity          currentState = StateMachineHelpers.GetCurrentState(context);

            if (currentState == null)
            {
                throw new InvalidOperationException(SR.GetStateMachineWorkflowMustHaveACurrentState());
            }

            StateActivity rootState = StateMachineHelpers.GetRootState((StateActivity)context.Activity);
            StateMachineExecutionState executionState = StateMachineExecutionState.Get(rootState);
            SetStateAction             action         = new SetStateAction(currentState.QualifiedName, eventArgs.TargetStateName);

            Debug.Assert(!executionState.HasEnqueuedActions);
            executionState.EnqueueAction(action);
            executionState.ProcessActions(context);
        }