public override ValidationErrorCollection Validate(ValidationManager manager, object obj) { ValidationErrorCollection errors = base.Validate(manager, obj); StateFinalizationActivity compositeActivity = obj as StateFinalizationActivity; if (compositeActivity == null) { throw new ArgumentException(SR.GetString("Error_UnexpectedArgumentType", new object[] { typeof(StateFinalizationActivity).FullName }), "obj"); } StateActivity parent = compositeActivity.Parent as StateActivity; if (parent == null) { errors.Add(new ValidationError(SR.GetError_StateFinalizationParentNotState(), 0x606)); return(errors); } foreach (Activity activity3 in parent.EnabledActivities) { StateFinalizationActivity activity4 = activity3 as StateFinalizationActivity; if ((activity4 != null) && (activity4 != compositeActivity)) { errors.Add(new ValidationError(SR.GetError_MultipleStateFinalizationActivities(), 0x61a)); break; } } if (StateMachineHelpers.ContainsEventActivity(compositeActivity)) { errors.Add(new ValidationError(SR.GetError_EventActivityNotValidInStateFinalization(), 0x603)); } return(errors); }
internal static StateActivity FindDynamicStateByName(StateActivity state, string stateQualifiedName) { while (!state.QualifiedName.Equals(stateQualifiedName) && ContainsState(state, stateQualifiedName)) { foreach (Activity activity in state.EnabledActivities) { StateActivity activity2 = activity as StateActivity; if ((activity2 != null) && ContainsState(activity2, stateQualifiedName)) { StateActivity dynamicActivity = (StateActivity) state.GetDynamicActivity(activity2.QualifiedName); if (dynamicActivity == null) { return null; } state = dynamicActivity; continue; } } } if (state.QualifiedName.Equals(stateQualifiedName)) { return state; } return null; }
internal static bool ContainsState(StateActivity state, string stateName) { if (state == null) { throw new ArgumentNullException("state"); } if (string.IsNullOrEmpty(stateName)) { throw new ArgumentNullException("stateName"); } Queue<StateActivity> queue = new Queue<StateActivity>(); queue.Enqueue(state); while (queue.Count > 0) { state = queue.Dequeue(); if (state.QualifiedName.Equals(stateName)) { return true; } foreach (Activity activity in state.EnabledActivities) { StateActivity item = activity as StateActivity; if (item != null) { queue.Enqueue(item); } } } return false; }
internal override void Execute(ActivityExecutionContext context) { base.Execute(context); StateActivity state = (StateActivity)base.State.Activities[this.ChildStateName]; StateActivity.ExecuteState(context, state); }
private static ReadOnlyCollection<StateActivity> GetLeafStates(StateActivity parentState) { if (parentState == null) { throw new ArgumentNullException("parentState"); } List<StateActivity> list = new List<StateActivity>(); Queue<StateActivity> queue = new Queue<StateActivity>(); queue.Enqueue(parentState); while (queue.Count > 0) { foreach (Activity activity2 in queue.Dequeue().EnabledActivities) { StateActivity state = activity2 as StateActivity; if (state != null) { if (StateMachineHelpers.IsLeafState(state)) { list.Add(state); } else { queue.Enqueue(state); } } } } return list.AsReadOnly(); }
internal static StateActivity FindDynamicStateByName(StateActivity state, string stateQualifiedName) { while (!state.QualifiedName.Equals(stateQualifiedName) && ContainsState(state, stateQualifiedName)) { foreach (Activity activity in state.EnabledActivities) { StateActivity activity2 = activity as StateActivity; if ((activity2 != null) && ContainsState(activity2, stateQualifiedName)) { StateActivity dynamicActivity = (StateActivity)state.GetDynamicActivity(activity2.QualifiedName); if (dynamicActivity == null) { return(null); } state = dynamicActivity; continue; } } } if (state.QualifiedName.Equals(stateQualifiedName)) { return(state); } return(null); }
internal override void Execute(ActivityExecutionContext context) { base.Execute(context); EventDrivenActivity eventDriven = (EventDrivenActivity)base.State.Activities[this.EventDrivenName]; StateActivity.ExecuteEventDriven(context, eventDriven); }
private static void ValidateCustomStateActivity(StateActivity state, ValidationErrorCollection validationErrors) { if (state.Activities.Count > 0) { validationErrors.Add(new ValidationError(SR.GetError_BlackBoxCustomStateNotSupported(), ErrorNumbers.Error_BlackBoxCustomStateNotSupported)); } }
public override ValidationError ValidateActivityChange(Activity activity, ActivityChangeAction action) { if (activity == null) { throw new ArgumentNullException("activity"); } if (action == null) { throw new ArgumentNullException("action"); } if (((activity.ExecutionStatus != ActivityExecutionStatus.Initialized) && (activity.ExecutionStatus != ActivityExecutionStatus.Executing)) && (activity.ExecutionStatus != ActivityExecutionStatus.Closed)) { return(new ValidationError(SR.GetString("Error_DynamicActivity2", new object[] { activity.QualifiedName, activity.ExecutionStatus, activity.GetType().FullName }), 0x50f)); } RemovedActivityAction action2 = action as RemovedActivityAction; if (action2 != null) { StateActivity originalRemovedActivity = action2.OriginalRemovedActivity as StateActivity; if (originalRemovedActivity != null) { return(new ValidationError(SR.GetError_CantRemoveState(originalRemovedActivity.QualifiedName), 0x61b)); } if (activity.ExecutionStatus == ActivityExecutionStatus.Executing) { EventDrivenActivity activity3 = action2.OriginalRemovedActivity as EventDrivenActivity; if (activity3 != null) { return(new ValidationError(SR.GetError_CantRemoveEventDrivenFromExecutingState(activity3.QualifiedName, activity.QualifiedName), 0x620)); } } } return(null); }
private static void ValidateLeafStateChildren(StateActivity state, ValidationErrorCollection validationErrors) { bool invalidChild = false; foreach (Activity activity in state.Activities) { if (!activity.Enabled) { continue; } if (activity is EventDrivenActivity || activity is StateInitializationActivity || activity is StateFinalizationActivity) { continue; } else { invalidChild = true; break; } } // validate that all child activities are event driven activities. if (invalidChild) { validationErrors.Add(new ValidationError( SR.GetError_InvalidLeafStateChild(), ErrorNumbers.Error_InvalidLeafStateChild)); } }
private static void ValidateInitialState(StateActivity state, ValidationErrorCollection validationErrors) { string initialStateName = StateMachineHelpers.GetInitialStateName(state); if (string.IsNullOrEmpty(initialStateName)) { if (state.Activities.Count > 0) { validationErrors.Add(new ValidationError(SR.GetString("Error_PropertyNotSet", new object[] { "InitialStateName" }), 0x116, false, "InitialStateName")); } } else { StateActivity activity = StateMachineHelpers.FindStateByName(state, initialStateName); if (activity == null) { validationErrors.Add(new ValidationError(SR.GetError_InitialStateMustPointToAState(), 0x5f5, false, "InitialStateName")); } else { if (!StateMachineHelpers.IsLeafState(activity)) { validationErrors.Add(new ValidationError(SR.GetError_InitialStateMustPointToALeafNodeState(), 0x5f7, false, "InitialStateName")); } string completedStateName = StateMachineHelpers.GetCompletedStateName(state); if (initialStateName == completedStateName) { validationErrors.Add(new ValidationError(SR.GetError_InitialStateMustBeDifferentThanCompletedState(), 0x62c, false, "InitialStateName")); } } } }
static internal bool ContainsState(StateActivity state, string stateName) { if (state == null) { throw new ArgumentNullException("state"); } if (String.IsNullOrEmpty(stateName)) { throw new ArgumentNullException("stateName"); } Queue <StateActivity> states = new Queue <StateActivity>(); states.Enqueue(state); while (states.Count > 0) { state = states.Dequeue(); if (state.QualifiedName.Equals(stateName)) { return(true); } foreach (Activity childActivity in state.EnabledActivities) { StateActivity childState = childActivity as StateActivity; if (childState != null) { states.Enqueue(childState); } } } return(false); }
internal override void Execute(ActivityExecutionContext context) { base.Execute(context); StateActivity rootState = StateMachineHelpers.GetRootState(base.State); Queue <StateActivity> queue = new Queue <StateActivity>(); queue.Enqueue(rootState); while (queue.Count > 0) { foreach (Activity activity3 in queue.Dequeue().EnabledActivities) { EventDrivenActivity eventDriven = activity3 as EventDrivenActivity; if (eventDriven != null) { IComparable queueName = StateMachineHelpers.GetEventActivity(eventDriven).QueueName; if (queueName != null) { WorkflowQueue workflowQueue = StateMachineSubscriptionManager.GetWorkflowQueue(context, queueName); if (workflowQueue != null) { workflowQueue.Enabled = base.SubscriptionManager.Subscriptions.ContainsKey(queueName); } } } else { StateActivity item = activity3 as StateActivity; if (item != null) { queue.Enqueue(item); } } } } }
internal static string GetCompletedStateName(StateActivity state) { Debug.Assert(state != null); StateActivity rootState = GetRootState(state); return((string)rootState.GetValue(StateMachineWorkflowActivity.CompletedStateNameProperty)); }
private static ReadOnlyCollection <StateActivity> GetLeafStates(StateActivity parentState) { if (parentState == null) { throw new ArgumentNullException("parentState"); } List <StateActivity> leafStates = new List <StateActivity>(); Queue <StateActivity> states = new Queue <StateActivity>(); states.Enqueue(parentState); while (states.Count > 0) { StateActivity parent = states.Dequeue(); foreach (Activity childActivity in parent.EnabledActivities) { StateActivity childState = childActivity as StateActivity; if (childState != null) { if (StateMachineHelpers.IsLeafState(childState)) { leafStates.Add(childState); } else { states.Enqueue(childState); } } } } return(leafStates.AsReadOnly()); }
static internal StateActivity FindDynamicStateByName(StateActivity state, string stateQualifiedName) { while (!state.QualifiedName.Equals(stateQualifiedName) && ContainsState(state, stateQualifiedName)) { foreach (Activity activity in state.EnabledActivities) { StateActivity childState = activity as StateActivity; if (childState == null) { continue; } if (ContainsState(childState, stateQualifiedName)) { StateActivity dynamicChildState = (StateActivity)state.GetDynamicActivity(childState.QualifiedName); if (dynamicChildState == null) { return(null); } state = dynamicChildState; break; } } } if (state.QualifiedName.Equals(stateQualifiedName)) { return(state); } else { return(null); } }
protected override void Enqueue(ActivityExecutionContext context) { StateActivity rootState = StateMachineHelpers.GetRootState((StateActivity)context.Activity); StateMachineExecutionState executionState = StateMachineExecutionState.Get(rootState); executionState.SubscriptionManager.Enqueue(context, this.SubscriptionId); }
private static void ValidateCompositeStateChildren(StateActivity state, ValidationErrorCollection validationErrors) { bool invalidChild = false; foreach (Activity activity in state.Activities) { if (!activity.Enabled) { continue; } if (activity is EventDrivenActivity || activity is StateActivity) { continue; } else { invalidChild = true; break; } } if (invalidChild) { validationErrors.Add(new ValidationError( SR.GetError_InvalidCompositeStateChild(), ErrorNumbers.Error_InvalidCompositeStateChild)); } }
private static ReadOnlyCollection <StateActivity> GetLeafStates(StateActivity parentState) { if (parentState == null) { throw new ArgumentNullException("parentState"); } List <StateActivity> list = new List <StateActivity>(); Queue <StateActivity> queue = new Queue <StateActivity>(); queue.Enqueue(parentState); while (queue.Count > 0) { foreach (Activity activity2 in queue.Dequeue().EnabledActivities) { StateActivity state = activity2 as StateActivity; if (state != null) { if (StateMachineHelpers.IsLeafState(state)) { list.Add(state); } else { queue.Enqueue(state); } } } } return(list.AsReadOnly()); }
private static void CleanUp(ActivityExecutionContext context) { if (context == null) { throw new ArgumentNullException("context"); } StateActivity state = (StateActivity)context.Activity; if (state.ExecutionStatus == ActivityExecutionStatus.Faulting) { return; // if we're faulting, then we're already in a bad state, so we don't try to unsubscribe } StateMachineExecutionState executionState = GetExecutionState(state); StateMachineSubscriptionManager subscriptionManager = executionState.SubscriptionManager; subscriptionManager.UnsubscribeState(context); if (StateMachineHelpers.IsRootState(state)) { subscriptionManager.DeleteSetStateEventQueue(context); } else if (StateMachineHelpers.IsLeafState(state)) { subscriptionManager.UnsubscribeToSetStateEvent(context); } }
internal static void LeavingState(ActivityExecutionContext context) { if (context == null) { throw new ArgumentNullException("context"); } StateActivity state = (StateActivity)context.Activity; if (StateMachineHelpers.IsLeafState(state)) { StateFinalizationActivity stateFinalization = GetStateFinalization(context); if (stateFinalization == null) { Complete(context); } else { ExecuteStateFinalization(context, stateFinalization); } } else { Complete(context); } }
protected override void Initialize(IServiceProvider provider) { base.Initialize(provider); ActivityExecutionContext context = (ActivityExecutionContext)provider; StateActivity rootState = StateMachineHelpers.GetRootState(this); if (!StateMachineHelpers.IsStateMachine(rootState)) { throw new InvalidOperationException(SR.GetError_StateActivityMustBeContainedInAStateMachine()); } string initialStateName = StateMachineHelpers.GetInitialStateName(this); if (String.IsNullOrEmpty(initialStateName)) { throw new InvalidOperationException(SR.GetError_CannotExecuteStateMachineWithoutInitialState()); } // if (this.QualifiedName != initialStateName) { StateMachineSubscriptionManager.DisableStateWorkflowQueues(context, this); } }
internal static bool ContainsState(StateActivity state, string stateName) { if (state == null) { throw new ArgumentNullException("state"); } if (string.IsNullOrEmpty(stateName)) { throw new ArgumentNullException("stateName"); } Queue <StateActivity> queue = new Queue <StateActivity>(); queue.Enqueue(state); while (queue.Count > 0) { state = queue.Dequeue(); if (state.QualifiedName.Equals(stateName)) { return(true); } foreach (Activity activity in state.EnabledActivities) { StateActivity item = activity as StateActivity; if (item != null) { queue.Enqueue(item); } } } return(false); }
internal static bool IsStateMachine(StateActivity state) { if (state == null) throw new ArgumentNullException("state"); return (state is StateMachineWorkflowActivity); }
public override ValidationErrorCollection Validate(ValidationManager manager, object obj) { ValidationErrorCollection validationErrors = new ValidationErrorCollection(base.Validate(manager, obj)); SetStateActivity setState = obj as SetStateActivity; if (setState == null) { throw new ArgumentException(SR.GetString("Error_UnexpectedArgumentType", new object[] { typeof(StateActivity).FullName }), "obj"); } if (SetStateContainment.Validate(setState, validationErrors)) { if (string.IsNullOrEmpty(setState.TargetStateName)) { validationErrors.Add(new ValidationError(SR.GetString("Error_PropertyNotSet", new object[] { "TargetStateName" }), 0x116, false, "TargetStateName")); return(validationErrors); } StateActivity state = StateMachineHelpers.FindStateByName(StateMachineHelpers.GetRootState(StateMachineHelpers.FindEnclosingState(setState)), setState.TargetStateName); if (state == null) { validationErrors.Add(new ValidationError(SR.GetError_SetStateMustPointToAState(), 0x5f3, false, "TargetStateName")); return(validationErrors); } if (!StateMachineHelpers.IsLeafState(state)) { validationErrors.Add(new ValidationError(SR.GetError_SetStateMustPointToALeafNodeState(), 0x5f4, false, "TargetStateName")); } } return(validationErrors); }
internal override void Execute(ActivityExecutionContext context) { base.Execute(context); StateActivity childState = (StateActivity)this.State.Activities[this.ChildStateName]; Debug.Assert(childState.Enabled); StateActivity.ExecuteState(context, childState); }
private static StateFinalizationActivity GetStateFinalization(ActivityExecutionContext context) { StateActivity state = (StateActivity)context.Activity; Debug.Assert(StateMachineHelpers.IsLeafState(state), "GetStateFinalization: StateFinalization is only allowed in a leaf node state"); return(GetHandlerActivity <StateFinalizationActivity>(context)); }
internal static bool IsStateMachine(StateActivity state) { if (state == null) { throw new ArgumentNullException("state"); } return(state is StateMachineWorkflowActivity); }
internal static StateActivity GetRootState(StateActivity state) { if ((state.Parent != null) && (state.Parent is StateActivity)) { return(GetRootState((StateActivity)state.Parent)); } return(state); }
private static StateMachineExecutionState GetExecutionState(StateActivity state) { if (state == null) { throw new ArgumentNullException("state"); } return(StateMachineExecutionState.Get(StateMachineHelpers.GetRootState(state))); }
internal override void Execute(ActivityExecutionContext context) { base.Execute(context); EventDrivenActivity eventDriven = (EventDrivenActivity)this.State.Activities[this.EventDrivenName]; Debug.Assert(eventDriven.Enabled); StateActivity.ExecuteEventDriven(context, eventDriven); }
public void SetState(StateActivity targetState) { if (targetState == null) { throw new ArgumentNullException("targetState"); } this.SetState(targetState.QualifiedName); }
static internal StateActivity FindStateByName(StateActivity state, string qualifiedName) { Debug.Assert(state != null); Debug.Assert(qualifiedName != null); StateActivity found = FindActivityByName(state, qualifiedName) as StateActivity; return(found); }
internal static bool IsRootState(StateActivity state) { if (state == null) throw new ArgumentNullException("state"); StateActivity parent = state.Parent as StateActivity; return parent == null; }
private static void InvalidChildActivity(StateActivity state) { if (StateMachineHelpers.IsLeafState(state)) { throw new InvalidOperationException(SR.GetError_InvalidLeafStateChild()); } throw new InvalidOperationException(SR.GetError_InvalidCompositeStateChild()); }
internal virtual void Execute(ActivityExecutionContext context) { if (context == null) throw new ArgumentNullException("context"); Debug.Assert(context.Activity.QualifiedName.Equals(this.StateName)); _state = (StateActivity)context.Activity; _currentState = StateMachineHelpers.GetCurrentState(context); StateActivity rootState = StateMachineHelpers.GetRootState(_state); _executionState = StateMachineExecutionState.Get(rootState); _subscriptionManager = _executionState.SubscriptionManager; }
private static void ChangeStateWorkflowQueuesState(ActivityExecutionContext context, StateActivity state, bool enabled) { foreach (Activity activity in state.EnabledActivities) { EventDrivenActivity eventDriven = activity as EventDrivenActivity; if (eventDriven != null) { ChangeEventDrivenQueueState(context, eventDriven, enabled); } } }
internal void Subscribe(ActivityExecutionContext context, StateActivity state, IEventActivity eventActivity) { eventActivity.Subscribe(context, this); Activity activity = (Activity) eventActivity; this._queueName = eventActivity.QueueName; this._eventActivityName = activity.QualifiedName; this._stateName = state.QualifiedName; base.SubscriptionId = Guid.NewGuid(); EventDrivenActivity parentEventDriven = StateMachineHelpers.GetParentEventDriven(eventActivity); this._eventDrivenName = parentEventDriven.QualifiedName; }
internal virtual void Execute(ActivityExecutionContext context) { if (context == null) { throw new ArgumentNullException("context"); } this._state = (StateActivity) context.Activity; this._currentState = StateMachineHelpers.GetCurrentState(context); StateActivity rootState = StateMachineHelpers.GetRootState(this._state); this._executionState = StateMachineExecutionState.Get(rootState); this._subscriptionManager = this._executionState.SubscriptionManager; }
internal static bool IsLeafState(StateActivity state) { if (state == null) throw new ArgumentNullException("state"); if (IsRootState(state)) return false; foreach (Activity child in state.EnabledActivities) { if (child is StateActivity) return false; } return true; }
/// <summary> /// Returns the root State activity /// </summary> /// <param name="state"></param> /// <returns></returns> internal static StateActivity GetRootState(StateActivity state) { Debug.Assert(state != null); Debug.Assert(state.Parent != state); if (state.Parent == null) return state; // this handles the case when the StateMachineWorkflow // is called using an Invoke activity if (!(state.Parent is StateActivity)) return state; return GetRootState((StateActivity)state.Parent); }
private void FindStates(ListBox dropDownList, StateActivity parent) { foreach (Activity activity in parent.EnabledActivities) { StateActivity state = activity as StateActivity; if (state != null) { if (StateMachineHelpers.IsLeafState(state)) { dropDownList.Items.Add(state.QualifiedName); } else { this.FindStates(dropDownList, state); } } } }
private void InitializeComponent() { this.CanModifyActivities = true; this.$safeitemname$InitialState = new System.Workflow.Activities.StateActivity(); // // $safeitemname$InitialState // this.$safeitemname$InitialState.Name = "$safeitemname$InitialState"; // // $safeitemname$ // this.Activities.Add(this.$safeitemname$InitialState); this.CompletedStateName = null; this.DynamicUpdateCondition = null; this.InitialStateName = "$safeitemname$InitialState"; this.Name = "$safeitemrootname$"; this.CanModifyActivities = false; }
private void ValidateSetStateInsideStateInitializationCore(CompositeActivity compositeActivity, StateActivity state, ValidationErrorCollection validationErrors) { foreach (Activity activity in compositeActivity.EnabledActivities) { CompositeActivity activity2 = activity as CompositeActivity; if (activity2 != null) { this.ValidateSetStateInsideStateInitializationCore(activity2, state, validationErrors); } else { SetStateActivity activity3 = activity as SetStateActivity; if (((activity3 != null) && !string.IsNullOrEmpty(activity3.TargetStateName)) && activity3.TargetStateName.Equals(state.QualifiedName)) { validationErrors.Add(new ValidationError(SR.GetError_InvalidTargetStateInStateInitialization(), 0x605)); break; } } } }
internal void CalculateStateTransition(StateActivity currentState, string targetStateName) { if (currentState == null) { throw new ArgumentNullException("currentState"); } if (string.IsNullOrEmpty(targetStateName)) { throw new ArgumentNullException("targetStateName"); } while ((currentState != null) && (currentState.QualifiedName.Equals(targetStateName) || !StateMachineHelpers.ContainsState(currentState, targetStateName))) { CloseStateAction item = new CloseStateAction(currentState.QualifiedName); this.Actions.Enqueue(item); currentState = currentState.Parent as StateActivity; } if (currentState == null) { throw new InvalidOperationException(SR.GetUnableToTransitionToState(targetStateName)); } while (!currentState.QualifiedName.Equals(targetStateName)) { foreach (Activity activity in currentState.EnabledActivities) { StateActivity state = activity as StateActivity; if ((state != null) && StateMachineHelpers.ContainsState(state, targetStateName)) { ExecuteChildStateAction action2 = new ExecuteChildStateAction(currentState.QualifiedName, state.QualifiedName); this.Actions.Enqueue(action2); currentState = state; break; } } } if (!StateMachineHelpers.IsLeafState(currentState)) { throw new InvalidOperationException(SR.GetInvalidStateTransitionPath()); } }
private static void ValidateCompletedState(StateActivity state, ValidationErrorCollection validationErrors) { string completedStateName = StateMachineHelpers.GetCompletedStateName(state); if (!string.IsNullOrEmpty(completedStateName)) { StateActivity activity = StateMachineHelpers.FindStateByName(state, completedStateName); if (activity == null) { validationErrors.Add(new ValidationError(SR.GetError_CompletedStateMustPointToAState(), 0x5f6, false, "CompletedStateName")); } else if (StateMachineHelpers.IsLeafState(activity)) { if (activity.EnabledActivities.Count > 0) { validationErrors.Add(new ValidationError(SR.GetString("Error_CompletedStateCannotContainActivities"), 0x5ff, false, "CompletedStateName")); } } else { validationErrors.Add(new ValidationError(SR.GetError_CompletedStateMustPointToALeafNodeState(), 0x5f8, false, "CompletedStateName")); } } }
/* Currently not used, left here for completeness internal static void EnableStateWorkflowQueues(ActivityExecutionContext context, StateActivity state) { ChangeStateWorkflowQueuesState(context, state, true); } */ internal static void DisableStateWorkflowQueues(ActivityExecutionContext context, StateActivity state) { ChangeStateWorkflowQueuesState(context, state, false); }
private void AddOrderOnHoldState() { // Get a reference to the WorkflowInstance for the selected workflow WorkflowInstance instance = this.runtime.GetWorkflow(this.GetSelectedWorkflowInstanceID()); // Get a reference to the root activity for the workflow Activity root = instance.GetWorkflowDefinition(); // Create a new instance of the WorkflowChanges class for managing // the in-memory changes to the workflow WorkflowChanges changes = new WorkflowChanges(root); // Create a new State activity to the workflow StateActivity orderOnHoldState = new StateActivity(); orderOnHoldState.Name = "OrderOnHoldState"; // Add a new EventDriven activity to the State EventDrivenActivity eventDrivenDelay = new EventDrivenActivity(); eventDrivenDelay.Name = "DelayOrderEvent"; orderOnHoldState.Activities.Add(eventDrivenDelay); // Add a new Delay, initialized to 5 seconds DelayActivity delayOrder = new DelayActivity(); delayOrder.Name = "delayOrder"; delayOrder.TimeoutDuration = new TimeSpan(0, 0, 5); eventDrivenDelay.Activities.Add(delayOrder); // Add a new SetState to the OrderOpenState SetStateActivity setStateOrderOpen = new SetStateActivity(); setStateOrderOpen.TargetStateName = "OrderOpenState"; eventDrivenDelay.Activities.Add(setStateOrderOpen); // Add the OnHoldState to the workflow changes.TransientWorkflow.Activities.Add(orderOnHoldState); // Apply the changes to the workflow instance try { instance.ApplyWorkflowChanges(changes); } catch (WorkflowValidationFailedException) { // New state has already been added MessageBox.Show("On Hold state has already been added to this workflow."); } }
private static void ValidateRootState(StateActivity state, ValidationErrorCollection validationErrors) { ValidateCompositeStateChildren(state, validationErrors); if (StateMachineHelpers.IsStateMachine(state)) { ValidateInitialState(state, validationErrors); ValidateCompletedState(state, validationErrors); } }
private bool IsParentState(StateActivity state, string stateName) { StateActivity parentState = state.Parent as StateActivity; while (parentState != null) { if (parentState.QualifiedName.Equals(stateName)) return true; parentState = parentState.Parent as StateActivity; } return false; }
private void InitializeComponent() { this.CanModifyActivities = true; System.Workflow.ComponentModel.ActivityBind activitybind1 = new System.Workflow.ComponentModel.ActivityBind(); System.Workflow.ComponentModel.WorkflowParameterBinding workflowparameterbinding1 = new System.Workflow.ComponentModel.WorkflowParameterBinding(); System.Workflow.ComponentModel.ActivityBind activitybind2 = new System.Workflow.ComponentModel.ActivityBind(); System.Workflow.ComponentModel.WorkflowParameterBinding workflowparameterbinding2 = new System.Workflow.ComponentModel.WorkflowParameterBinding(); System.Workflow.Activities.TypedOperationInfo typedoperationinfo1 = new System.Workflow.Activities.TypedOperationInfo(); System.Workflow.Activities.WorkflowServiceAttributes workflowserviceattributes1 = new System.Workflow.Activities.WorkflowServiceAttributes(); this.setStateActivity1 = new System.Workflow.Activities.SetStateActivity(); this.receiveActivity1 = new System.Workflow.Activities.ReceiveActivity(); this.eventDrivenActivity1 = new System.Workflow.Activities.EventDrivenActivity(); this.stateActivity1 = new System.Workflow.Activities.StateActivity(); this.$safeitemrootname$InitialState = new System.Workflow.Activities.StateActivity(); // // setStateActivity1 // this.setStateActivity1.Name = "setStateActivity1"; this.setStateActivity1.TargetStateName = "stateActivity1"; // // receiveActivity1 // this.receiveActivity1.CanCreateInstance = true; this.receiveActivity1.Name = "receiveActivity1"; activitybind1.Name = "$safeitemrootname$"; activitybind1.Path = "ReturnValue"; workflowparameterbinding1.ParameterName = "(ReturnValue)"; workflowparameterbinding1.SetBinding(System.Workflow.ComponentModel.WorkflowParameterBinding.ValueProperty, ((System.Workflow.ComponentModel.ActivityBind)(activitybind1))); activitybind2.Name = "$safeitemrootname$"; activitybind2.Path = "InputValue"; workflowparameterbinding2.ParameterName = "value"; workflowparameterbinding2.SetBinding(System.Workflow.ComponentModel.WorkflowParameterBinding.ValueProperty, ((System.Workflow.ComponentModel.ActivityBind)(activitybind2))); this.receiveActivity1.ParameterBindings.Add(workflowparameterbinding1); this.receiveActivity1.ParameterBindings.Add(workflowparameterbinding2); typedoperationinfo1.ContractType = typeof($rootnamespace$.$contractName$); typedoperationinfo1.Name = "GetData"; this.receiveActivity1.ServiceOperationInfo = typedoperationinfo1; // // eventDrivenActivity1 // this.eventDrivenActivity1.Activities.Add(this.receiveActivity1); this.eventDrivenActivity1.Activities.Add(this.setStateActivity1); this.eventDrivenActivity1.Name = "eventDrivenActivity1"; // // stateActivity1 // this.stateActivity1.Name = "stateActivity1"; // // $safeitemrootname$InitialState // this.$safeitemrootname$InitialState.Activities.Add(this.eventDrivenActivity1); this.$safeitemrootname$InitialState.Name = "$safeitemrootname$InitialState"; workflowserviceattributes1.ConfigurationName = "$safeitemrootname$"; workflowserviceattributes1.Name = "$safeitemrootname$"; // // $safeitemrootname$ // this.Activities.Add(this.$safeitemrootname$InitialState); this.Activities.Add(this.stateActivity1); this.CompletedStateName = "stateActivity1"; this.DynamicUpdateCondition = null; this.InitialStateName = "$safeitemrootname$InitialState"; this.Name = "$safeitemrootname$"; this.SetValue(System.Workflow.Activities.ReceiveActivity.WorkflowServiceAttributesProperty, workflowserviceattributes1); this.CanModifyActivities = false; }
private static void ValidateState(StateActivity state, ValidationErrorCollection validationErrors) { ValidateCompositeStateChildren(state, validationErrors); }
private void ValidateSetStateInsideStateInitializationCore(CompositeActivity compositeActivity, StateActivity state, ValidationErrorCollection validationErrors) { foreach (Activity activity in compositeActivity.EnabledActivities) { CompositeActivity childCompositeActivity = activity as CompositeActivity; if (childCompositeActivity != null) { ValidateSetStateInsideStateInitializationCore(childCompositeActivity, state, validationErrors); } else { SetStateActivity setState = activity as SetStateActivity; if (setState != null) { if (!String.IsNullOrEmpty(setState.TargetStateName)) { if (setState.TargetStateName.Equals(state.QualifiedName)) { validationErrors.Add(new ValidationError( SR.GetError_InvalidTargetStateInStateInitialization(), ErrorNumbers.Error_InvalidTargetStateInStateInitialization)); return; } } } } } }
private void ValidateSetStateInsideStateInitialization(StateInitializationActivity stateInitialization, StateActivity state, ValidationErrorCollection validationErrors) { ValidateSetStateInsideStateInitializationCore(stateInitialization, state, validationErrors); }
private void InitializeComponent() { this.CanModifyActivities = true; this.setStateActivity1 = new System.Workflow.Activities.SetStateActivity(); this.delayActivity1 = new System.Workflow.Activities.DelayActivity(); this.eventDrivenActivity1 = new System.Workflow.Activities.EventDrivenActivity(); this.stateActivity1 = new System.Workflow.Activities.StateActivity(); this.stateActivity2 = new System.Workflow.Activities.StateActivity(); // // setStateActivity1 // this.setStateActivity1.Name = "setStateActivity1"; this.setStateActivity1.TargetStateName = "stateActivity1"; // // delayActivity1 // this.delayActivity1.Name = "delayActivity1"; this.delayActivity1.TimeoutDuration = System.TimeSpan.Parse("00:01:00"); // // eventDrivenActivity1 // this.eventDrivenActivity1.Activities.Add(this.delayActivity1); this.eventDrivenActivity1.Activities.Add(this.setStateActivity1); this.eventDrivenActivity1.Name = "eventDrivenActivity1"; // // stateActivity1 // this.stateActivity1.Name = "stateActivity1"; // // _initial // this.stateActivity2.Activities.Add(this.eventDrivenActivity1); this.stateActivity2.Name = "stateActivity2"; // // PressFlow // this.Activities.Add(this.stateActivity2); this.Activities.Add(this.stateActivity1); this.CompletedStateName = "stateActivity1"; this.DynamicUpdateCondition = null; this.InitialStateName = "stateActivity2"; this.Name = "PressFlow"; this.CanModifyActivities = false; }
private ConnectionPoint GetTargetStateConnectionPoint(StateActivity targetState) { // Debug.Assert(targetState != null); StateDesigner targetStateDesigner = (StateDesigner)GetDesigner(targetState); return new ConnectionPoint(targetStateDesigner, DesignerEdges.Top, 0); }
internal void OnAddState(object sender, EventArgs e) { StateActivity state = new StateActivity(); AddChild(state); }
private void InitializeComponent() { this.CanModifyActivities = true; System.Workflow.Activities.Rules.RuleConditionReference ruleconditionreference1 = new System.Workflow.Activities.Rules.RuleConditionReference(); System.Workflow.ComponentModel.ActivityBind activitybind1 = new System.Workflow.ComponentModel.ActivityBind(); System.Workflow.ComponentModel.WorkflowParameterBinding workflowparameterbinding1 = new System.Workflow.ComponentModel.WorkflowParameterBinding(); System.Workflow.ComponentModel.WorkflowParameterBinding workflowparameterbinding2 = new System.Workflow.ComponentModel.WorkflowParameterBinding(); System.Workflow.ComponentModel.ActivityBind activitybind2 = new System.Workflow.ComponentModel.ActivityBind(); System.Workflow.ComponentModel.WorkflowParameterBinding workflowparameterbinding3 = new System.Workflow.ComponentModel.WorkflowParameterBinding(); System.Workflow.ComponentModel.WorkflowParameterBinding workflowparameterbinding4 = new System.Workflow.ComponentModel.WorkflowParameterBinding(); System.Workflow.ComponentModel.ActivityBind activitybind3 = new System.Workflow.ComponentModel.ActivityBind(); System.Workflow.ComponentModel.WorkflowParameterBinding workflowparameterbinding5 = new System.Workflow.ComponentModel.WorkflowParameterBinding(); System.Workflow.ComponentModel.ActivityBind activitybind4 = new System.Workflow.ComponentModel.ActivityBind(); System.Workflow.ComponentModel.WorkflowParameterBinding workflowparameterbinding6 = new System.Workflow.ComponentModel.WorkflowParameterBinding(); System.Workflow.ComponentModel.ActivityBind activitybind5 = new System.Workflow.ComponentModel.ActivityBind(); System.Workflow.ComponentModel.WorkflowParameterBinding workflowparameterbinding7 = new System.Workflow.ComponentModel.WorkflowParameterBinding(); System.Workflow.ComponentModel.ActivityBind activitybind6 = new System.Workflow.ComponentModel.ActivityBind(); System.Workflow.ComponentModel.WorkflowParameterBinding workflowparameterbinding8 = new System.Workflow.ComponentModel.WorkflowParameterBinding(); System.Workflow.Activities.Rules.RuleConditionReference ruleconditionreference2 = new System.Workflow.Activities.Rules.RuleConditionReference(); System.Workflow.Activities.Rules.RuleConditionReference ruleconditionreference3 = new System.Workflow.Activities.Rules.RuleConditionReference(); System.Workflow.Activities.Rules.RuleConditionReference ruleconditionreference4 = new System.Workflow.Activities.Rules.RuleConditionReference(); System.Workflow.Activities.Rules.RuleConditionReference ruleconditionreference5 = new System.Workflow.Activities.Rules.RuleConditionReference(); System.Workflow.Activities.Rules.RuleConditionReference ruleconditionreference6 = new System.Workflow.Activities.Rules.RuleConditionReference(); System.Workflow.Activities.Rules.RuleConditionReference ruleconditionreference7 = new System.Workflow.Activities.Rules.RuleConditionReference(); System.Workflow.Activities.Rules.RuleConditionReference ruleconditionreference8 = new System.Workflow.Activities.Rules.RuleConditionReference(); System.Workflow.Activities.Rules.RuleConditionReference ruleconditionreference9 = new System.Workflow.Activities.Rules.RuleConditionReference(); System.Workflow.Activities.Rules.RuleConditionReference ruleconditionreference10 = new System.Workflow.Activities.Rules.RuleConditionReference(); System.Workflow.Activities.Rules.RuleConditionReference ruleconditionreference11 = new System.Workflow.Activities.Rules.RuleConditionReference(); System.Workflow.Activities.Rules.RuleConditionReference ruleconditionreference12 = new System.Workflow.Activities.Rules.RuleConditionReference(); System.Workflow.Activities.Rules.RuleConditionReference ruleconditionreference13 = new System.Workflow.Activities.Rules.RuleConditionReference(); System.Workflow.Activities.Rules.RuleConditionReference ruleconditionreference14 = new System.Workflow.Activities.Rules.RuleConditionReference(); System.Workflow.ComponentModel.WorkflowParameterBinding workflowparameterbinding9 = new System.Workflow.ComponentModel.WorkflowParameterBinding(); System.Workflow.ComponentModel.WorkflowParameterBinding workflowparameterbinding10 = new System.Workflow.ComponentModel.WorkflowParameterBinding(); System.Workflow.ComponentModel.WorkflowParameterBinding workflowparameterbinding11 = new System.Workflow.ComponentModel.WorkflowParameterBinding(); System.Workflow.ComponentModel.ActivityBind activitybind7 = new System.Workflow.ComponentModel.ActivityBind(); System.Workflow.ComponentModel.WorkflowParameterBinding workflowparameterbinding12 = new System.Workflow.ComponentModel.WorkflowParameterBinding(); System.Workflow.ComponentModel.ActivityBind activitybind8 = new System.Workflow.ComponentModel.ActivityBind(); System.Workflow.ComponentModel.WorkflowParameterBinding workflowparameterbinding13 = new System.Workflow.ComponentModel.WorkflowParameterBinding(); System.Workflow.ComponentModel.ActivityBind activitybind9 = new System.Workflow.ComponentModel.ActivityBind(); System.Workflow.ComponentModel.WorkflowParameterBinding workflowparameterbinding14 = new System.Workflow.ComponentModel.WorkflowParameterBinding(); System.Workflow.Activities.Rules.RuleConditionReference ruleconditionreference15 = new System.Workflow.Activities.Rules.RuleConditionReference(); System.Workflow.ComponentModel.ActivityBind activitybind10 = new System.Workflow.ComponentModel.ActivityBind(); System.Workflow.ComponentModel.WorkflowParameterBinding workflowparameterbinding15 = new System.Workflow.ComponentModel.WorkflowParameterBinding(); this.setStateActivity3 = new System.Workflow.Activities.SetStateActivity(); this.AuthFailed = new System.Workflow.Activities.CallExternalMethodActivity(); this.SetMenuState = new System.Workflow.Activities.SetStateActivity(); this.ifElseBranchActivity2 = new System.Workflow.Activities.IfElseBranchActivity(); this.ifElseBranchActivity1 = new System.Workflow.Activities.IfElseBranchActivity(); this.callExternalMethodActivity7 = new System.Workflow.Activities.CallExternalMethodActivity(); this.setStateActivity10 = new System.Workflow.Activities.SetStateActivity(); this.callExternalMethodActivity11 = new System.Workflow.Activities.CallExternalMethodActivity(); this.codeActivity2 = new System.Workflow.Activities.CodeActivity(); this.callExternalMethodActivity12 = new System.Workflow.Activities.CallExternalMethodActivity(); this.callExternalMethodActivity2 = new System.Workflow.Activities.CallExternalMethodActivity(); this.callExternalMethodActivity3 = new System.Workflow.Activities.CallExternalMethodActivity(); this.callExternalMethodActivity5 = new System.Workflow.Activities.CallExternalMethodActivity(); this.setStateActivity9 = new System.Workflow.Activities.SetStateActivity(); this.ViewCurrentCardNumber = new System.Workflow.Activities.CallExternalMethodActivity(); this.SetSelectLanguageState = new System.Workflow.Activities.SetStateActivity(); this.setStateActivity1 = new System.Workflow.Activities.SetStateActivity(); this.ExitFromBalance = new System.Workflow.Activities.SetStateActivity(); this.ViewCurrentPin = new System.Workflow.Activities.CallExternalMethodActivity(); this.ifElseActivity1 = new System.Workflow.Activities.IfElseActivity(); this.setStateActivity8 = new System.Workflow.Activities.SetStateActivity(); this.codeActivity1 = new System.Workflow.Activities.CodeActivity(); this.setStateActivity4 = new System.Workflow.Activities.SetStateActivity(); this.setStateActivity5 = new System.Workflow.Activities.SetStateActivity(); this.codeActivity8 = new System.Workflow.Activities.CodeActivity(); this.setStateActivity7 = new System.Workflow.Activities.SetStateActivity(); this.codeActivity7 = new System.Workflow.Activities.CodeActivity(); this.setStateActivity6 = new System.Workflow.Activities.SetStateActivity(); this.codeActivity5 = new System.Workflow.Activities.CodeActivity(); this.ifElseBranchActivity13 = new System.Workflow.Activities.IfElseBranchActivity(); this.ifElseBranchActivity12 = new System.Workflow.Activities.IfElseBranchActivity(); this.ifElseBranchActivity11 = new System.Workflow.Activities.IfElseBranchActivity(); this.ifElseBranchActivity10 = new System.Workflow.Activities.IfElseBranchActivity(); this.ifElseBranchActivity9 = new System.Workflow.Activities.IfElseBranchActivity(); this.ifElseBranchActivity6 = new System.Workflow.Activities.IfElseBranchActivity(); this.ifElseBranchActivity5 = new System.Workflow.Activities.IfElseBranchActivity(); this.ifElseBranchActivity8 = new System.Workflow.Activities.IfElseBranchActivity(); this.ifElseBranchActivity7 = new System.Workflow.Activities.IfElseBranchActivity(); this.ifElseBranchActivity4 = new System.Workflow.Activities.IfElseBranchActivity(); this.ifElseBranchActivity3 = new System.Workflow.Activities.IfElseBranchActivity(); this.cancellationHandlerActivity1 = new System.Workflow.ComponentModel.CancellationHandlerActivity(); this.compensatableSequenceActivity5 = new System.Workflow.Activities.CompensatableSequenceActivity(); this.compensatableSequenceActivity4 = new System.Workflow.Activities.CompensatableSequenceActivity(); this.compensatableSequenceActivity3 = new System.Workflow.Activities.CompensatableSequenceActivity(); this.compensatableSequenceActivity2 = new System.Workflow.Activities.CompensatableSequenceActivity(); this.compensatableSequenceActivity1 = new System.Workflow.Activities.CompensatableSequenceActivity(); this.ifElseActivity5 = new System.Workflow.Activities.IfElseActivity(); this.handleExternalEventActivity3 = new System.Workflow.Activities.HandleExternalEventActivity(); this.callExternalMethodActivity6 = new System.Workflow.Activities.CallExternalMethodActivity(); this.ifElseActivity4 = new System.Workflow.Activities.IfElseActivity(); this.handleExternalEventActivity2 = new System.Workflow.Activities.HandleExternalEventActivity(); this.callExternalMethodActivity4 = new System.Workflow.Activities.CallExternalMethodActivity(); this.callExternalMethodActivity10 = new System.Workflow.Activities.CallExternalMethodActivity(); this.callExternalMethodActivity8 = new System.Workflow.Activities.CallExternalMethodActivity(); this.ReadCardIfElse = new System.Workflow.Activities.IfElseActivity(); this.ReadCardNumber = new System.Workflow.Activities.HandleExternalEventActivity(); this.DisplayWelcomeMessage = new System.Workflow.Activities.CallExternalMethodActivity(); this.InitCode = new System.Workflow.Activities.CodeActivity(); this.ifElseActivity3 = new System.Workflow.Activities.IfElseActivity(); this.handleExternalEventActivity1 = new System.Workflow.Activities.HandleExternalEventActivity(); this.callExternalMethodActivity9 = new System.Workflow.Activities.CallExternalMethodActivity(); this.ifElseActivity2 = new System.Workflow.Activities.IfElseActivity(); this.GetPinHandle = new System.Workflow.Activities.HandleExternalEventActivity(); this.callExternalMethodActivity1 = new System.Workflow.Activities.CallExternalMethodActivity(); this.setStateActivity2 = new System.Workflow.Activities.SetStateActivity(); this.conditionedActivityGroup1 = new System.Workflow.Activities.ConditionedActivityGroup(); this.GetActionToDo = new System.Workflow.Activities.HandleExternalEventActivity(); this.ViewMenuText = new System.Workflow.Activities.CallExternalMethodActivity(); this.SetAuthState = new System.Workflow.Activities.SetStateActivity(); this.GetLanguageHandle = new System.Workflow.Activities.HandleExternalEventActivity(); this.ViewLanguageMenu = new System.Workflow.Activities.CallExternalMethodActivity(); this.eventDrivenActivity2 = new System.Workflow.Activities.EventDrivenActivity(); this.stateInitializationActivity3 = new System.Workflow.Activities.StateInitializationActivity(); this.eventDrivenActivity1 = new System.Workflow.Activities.EventDrivenActivity(); this.stateInitializationActivity2 = new System.Workflow.Activities.StateInitializationActivity(); this.handleExternalEventActivity5 = new System.Workflow.Activities.HandleExternalEventActivity(); this.handleExternalEventActivity6 = new System.Workflow.Activities.HandleExternalEventActivity(); this.stateInitializationActivity7 = new System.Workflow.Activities.StateInitializationActivity(); this.stateInitializationActivity5 = new System.Workflow.Activities.StateInitializationActivity(); this.EnterCardEvent = new System.Workflow.Activities.EventDrivenActivity(); this.Init = new System.Workflow.Activities.StateInitializationActivity(); this.MenuOrExit = new System.Workflow.Activities.EventDrivenActivity(); this.InitBalace = new System.Workflow.Activities.StateInitializationActivity(); this.GetPin = new System.Workflow.Activities.EventDrivenActivity(); this.InitAuth = new System.Workflow.Activities.StateInitializationActivity(); this.stateInitializationActivity1 = new System.Workflow.Activities.StateInitializationActivity(); this.SelectActionToDo = new System.Workflow.Activities.EventDrivenActivity(); this.InitMenu = new System.Workflow.Activities.StateInitializationActivity(); this.GetLanguage = new System.Workflow.Activities.EventDrivenActivity(); this.InitLanguage = new System.Workflow.Activities.StateInitializationActivity(); this.EnterNewPin = new System.Workflow.Activities.StateActivity(); this.EnterOldPin = new System.Workflow.Activities.StateActivity(); this.NumHandler = new System.Workflow.Activities.EventDrivenActivity(); this.ActionHandler = new System.Workflow.Activities.EventDrivenActivity(); this.Deposit = new System.Workflow.Activities.StateActivity(); this.Withdrawal = new System.Workflow.Activities.StateActivity(); this.EnterCard = new System.Workflow.Activities.StateActivity(); this.ViewBalance = new System.Workflow.Activities.StateActivity(); this.Authenticate = new System.Workflow.Activities.StateActivity(); this.Final = new System.Workflow.Activities.StateActivity(); this.Menu = new System.Workflow.Activities.StateActivity(); this.SelectLanguage = new System.Workflow.Activities.StateActivity(); // // setStateActivity3 // this.setStateActivity3.Name = "setStateActivity3"; this.setStateActivity3.TargetStateName = "Final"; // // AuthFailed // this.AuthFailed.InterfaceType = typeof(Interfaces.IFormService); this.AuthFailed.MethodName = "AuthFailed"; this.AuthFailed.Name = "AuthFailed"; // // SetMenuState // this.SetMenuState.Name = "SetMenuState"; this.SetMenuState.TargetStateName = "Menu"; // // ifElseBranchActivity2 // this.ifElseBranchActivity2.Activities.Add(this.AuthFailed); this.ifElseBranchActivity2.Activities.Add(this.setStateActivity3); this.ifElseBranchActivity2.Name = "ifElseBranchActivity2"; // // ifElseBranchActivity1 // this.ifElseBranchActivity1.Activities.Add(this.SetMenuState); ruleconditionreference1.ConditionName = "IsAuth"; this.ifElseBranchActivity1.Condition = ruleconditionreference1; this.ifElseBranchActivity1.Name = "ifElseBranchActivity1"; // // callExternalMethodActivity7 // this.callExternalMethodActivity7.InterfaceType = typeof(Interfaces.IFormService); this.callExternalMethodActivity7.MethodName = "SendBackMessage"; this.callExternalMethodActivity7.Name = "callExternalMethodActivity7"; activitybind1.Name = "BankomatsWorkflow"; activitybind1.Path = "newPIN"; workflowparameterbinding1.ParameterName = "message"; workflowparameterbinding1.SetBinding(System.Workflow.ComponentModel.WorkflowParameterBinding.ValueProperty, ((System.Workflow.ComponentModel.ActivityBind)(activitybind1))); this.callExternalMethodActivity7.ParameterBindings.Add(workflowparameterbinding1); // // setStateActivity10 // this.setStateActivity10.Name = "setStateActivity10"; this.setStateActivity10.TargetStateName = "Menu"; // // callExternalMethodActivity11 // this.callExternalMethodActivity11.InterfaceType = typeof(Interfaces.IFormService); this.callExternalMethodActivity11.MethodName = "SendBackMessageLine"; this.callExternalMethodActivity11.Name = "callExternalMethodActivity11"; workflowparameterbinding2.ParameterName = "message"; workflowparameterbinding2.Value = "\"Ja pomenjal pin\""; this.callExternalMethodActivity11.ParameterBindings.Add(workflowparameterbinding2); // // codeActivity2 // this.codeActivity2.Name = "codeActivity2"; this.codeActivity2.ExecuteCode += new System.EventHandler(this.codeActivity2_ExecuteCode_1); // // callExternalMethodActivity12 // this.callExternalMethodActivity12.InterfaceType = typeof(Interfaces.IFormService); this.callExternalMethodActivity12.MethodName = "SendBackMessage"; this.callExternalMethodActivity12.Name = "callExternalMethodActivity12"; activitybind2.Name = "BankomatsWorkflow"; activitybind2.Path = "newPIN"; workflowparameterbinding3.ParameterName = "message"; workflowparameterbinding3.SetBinding(System.Workflow.ComponentModel.WorkflowParameterBinding.ValueProperty, ((System.Workflow.ComponentModel.ActivityBind)(activitybind2))); this.callExternalMethodActivity12.ParameterBindings.Add(workflowparameterbinding3); // // callExternalMethodActivity2 // this.callExternalMethodActivity2.InterfaceType = typeof(Interfaces.IFormService); this.callExternalMethodActivity2.MethodName = "SendBackMessage"; this.callExternalMethodActivity2.Name = "callExternalMethodActivity2"; workflowparameterbinding4.ParameterName = "message"; workflowparameterbinding4.Value = "\"Ti sosew\""; this.callExternalMethodActivity2.ParameterBindings.Add(workflowparameterbinding4); // // callExternalMethodActivity3 // this.callExternalMethodActivity3.InterfaceType = typeof(Interfaces.IFormService); this.callExternalMethodActivity3.MethodName = "SendBackMessage"; this.callExternalMethodActivity3.Name = "callExternalMethodActivity3"; activitybind3.Name = "BankomatsWorkflow"; activitybind3.Path = "oldPIN"; workflowparameterbinding5.ParameterName = "message"; workflowparameterbinding5.SetBinding(System.Workflow.ComponentModel.WorkflowParameterBinding.ValueProperty, ((System.Workflow.ComponentModel.ActivityBind)(activitybind3))); this.callExternalMethodActivity3.ParameterBindings.Add(workflowparameterbinding5); // // callExternalMethodActivity5 // this.callExternalMethodActivity5.InterfaceType = typeof(Interfaces.IFormService); this.callExternalMethodActivity5.MethodName = "SendBackMessage"; this.callExternalMethodActivity5.Name = "callExternalMethodActivity5"; activitybind4.Name = "BankomatsWorkflow"; activitybind4.Path = "oldPIN"; workflowparameterbinding6.ParameterName = "message"; workflowparameterbinding6.SetBinding(System.Workflow.ComponentModel.WorkflowParameterBinding.ValueProperty, ((System.Workflow.ComponentModel.ActivityBind)(activitybind4))); this.callExternalMethodActivity5.ParameterBindings.Add(workflowparameterbinding6); // // setStateActivity9 // this.setStateActivity9.Name = "setStateActivity9"; this.setStateActivity9.TargetStateName = "EnterNewPin"; // // ViewCurrentCardNumber // this.ViewCurrentCardNumber.InterfaceType = typeof(Interfaces.IFormService); this.ViewCurrentCardNumber.MethodName = "SendBackMessage"; this.ViewCurrentCardNumber.Name = "ViewCurrentCardNumber"; activitybind5.Name = "BankomatsWorkflow"; activitybind5.Path = "currentAccountNumber"; workflowparameterbinding7.ParameterName = "message"; workflowparameterbinding7.SetBinding(System.Workflow.ComponentModel.WorkflowParameterBinding.ValueProperty, ((System.Workflow.ComponentModel.ActivityBind)(activitybind5))); this.ViewCurrentCardNumber.ParameterBindings.Add(workflowparameterbinding7); // // SetSelectLanguageState // this.SetSelectLanguageState.Name = "SetSelectLanguageState"; this.SetSelectLanguageState.TargetStateName = "SelectLanguage"; // // setStateActivity1 // this.setStateActivity1.Name = "setStateActivity1"; this.setStateActivity1.TargetStateName = "Menu"; // // ExitFromBalance // this.ExitFromBalance.Name = "ExitFromBalance"; this.ExitFromBalance.TargetStateName = "Final"; // // ViewCurrentPin // this.ViewCurrentPin.InterfaceType = typeof(Interfaces.IFormService); this.ViewCurrentPin.MethodName = "SendBackMessage"; this.ViewCurrentPin.Name = "ViewCurrentPin"; activitybind6.Name = "BankomatsWorkflow"; activitybind6.Path = "tryPIN"; workflowparameterbinding8.ParameterName = "message"; workflowparameterbinding8.SetBinding(System.Workflow.ComponentModel.WorkflowParameterBinding.ValueProperty, ((System.Workflow.ComponentModel.ActivityBind)(activitybind6))); this.ViewCurrentPin.ParameterBindings.Add(workflowparameterbinding8); // // ifElseActivity1 // this.ifElseActivity1.Activities.Add(this.ifElseBranchActivity1); this.ifElseActivity1.Activities.Add(this.ifElseBranchActivity2); this.ifElseActivity1.Name = "ifElseActivity1"; // // setStateActivity8 // this.setStateActivity8.Name = "setStateActivity8"; this.setStateActivity8.TargetStateName = "EnterOldPin"; // // codeActivity1 // this.codeActivity1.Name = "codeActivity1"; this.codeActivity1.ExecuteCode += new System.EventHandler(this.ChangeMenu); // // setStateActivity4 // this.setStateActivity4.Name = "setStateActivity4"; this.setStateActivity4.TargetStateName = "Final"; // // setStateActivity5 // this.setStateActivity5.Name = "setStateActivity5"; this.setStateActivity5.TargetStateName = "Deposit"; // // codeActivity8 // this.codeActivity8.Name = "codeActivity8"; this.codeActivity8.ExecuteCode += new System.EventHandler(this.ChangeMenu); // // setStateActivity7 // this.setStateActivity7.Name = "setStateActivity7"; this.setStateActivity7.TargetStateName = "Withdrawal"; // // codeActivity7 // this.codeActivity7.Name = "codeActivity7"; this.codeActivity7.ExecuteCode += new System.EventHandler(this.ChangeMenu); // // setStateActivity6 // this.setStateActivity6.Name = "setStateActivity6"; this.setStateActivity6.TargetStateName = "ViewBalance"; // // codeActivity5 // this.codeActivity5.Name = "codeActivity5"; this.codeActivity5.ExecuteCode += new System.EventHandler(this.ChangeMenu); // // ifElseBranchActivity13 // this.ifElseBranchActivity13.Activities.Add(this.callExternalMethodActivity7); this.ifElseBranchActivity13.Name = "ifElseBranchActivity13"; // // ifElseBranchActivity12 // this.ifElseBranchActivity12.Activities.Add(this.callExternalMethodActivity12); this.ifElseBranchActivity12.Activities.Add(this.codeActivity2); this.ifElseBranchActivity12.Activities.Add(this.callExternalMethodActivity11); this.ifElseBranchActivity12.Activities.Add(this.setStateActivity10); ruleconditionreference2.ConditionName = "NewPinLenght"; this.ifElseBranchActivity12.Condition = ruleconditionreference2; this.ifElseBranchActivity12.Name = "ifElseBranchActivity12"; // // ifElseBranchActivity11 // this.ifElseBranchActivity11.Activities.Add(this.callExternalMethodActivity2); ruleconditionreference3.ConditionName = "PinCompare"; this.ifElseBranchActivity11.Condition = ruleconditionreference3; this.ifElseBranchActivity11.Name = "ifElseBranchActivity11"; // // ifElseBranchActivity10 // this.ifElseBranchActivity10.Activities.Add(this.callExternalMethodActivity3); ruleconditionreference4.ConditionName = "NewPinLength"; this.ifElseBranchActivity10.Condition = ruleconditionreference4; this.ifElseBranchActivity10.Name = "ifElseBranchActivity10"; // // ifElseBranchActivity9 // this.ifElseBranchActivity9.Activities.Add(this.setStateActivity9); this.ifElseBranchActivity9.Activities.Add(this.callExternalMethodActivity5); ruleconditionreference5.ConditionName = "NewPinCompare"; this.ifElseBranchActivity9.Condition = ruleconditionreference5; this.ifElseBranchActivity9.Name = "ifElseBranchActivity9"; // // ifElseBranchActivity6 // this.ifElseBranchActivity6.Activities.Add(this.ViewCurrentCardNumber); this.ifElseBranchActivity6.Name = "ifElseBranchActivity6"; // // ifElseBranchActivity5 // this.ifElseBranchActivity5.Activities.Add(this.SetSelectLanguageState); ruleconditionreference6.ConditionName = "IsFullCardNumber"; this.ifElseBranchActivity5.Condition = ruleconditionreference6; this.ifElseBranchActivity5.Name = "ifElseBranchActivity5"; // // ifElseBranchActivity8 // this.ifElseBranchActivity8.Activities.Add(this.setStateActivity1); ruleconditionreference7.ConditionName = "IsAction2"; this.ifElseBranchActivity8.Condition = ruleconditionreference7; this.ifElseBranchActivity8.Name = "ifElseBranchActivity8"; // // ifElseBranchActivity7 // this.ifElseBranchActivity7.Activities.Add(this.ExitFromBalance); ruleconditionreference8.ConditionName = "IsAction1"; this.ifElseBranchActivity7.Condition = ruleconditionreference8; this.ifElseBranchActivity7.Name = "ifElseBranchActivity7"; // // ifElseBranchActivity4 // this.ifElseBranchActivity4.Activities.Add(this.ViewCurrentPin); this.ifElseBranchActivity4.Name = "ifElseBranchActivity4"; // // ifElseBranchActivity3 // this.ifElseBranchActivity3.Activities.Add(this.ifElseActivity1); ruleconditionreference9.ConditionName = "IsFullPin"; this.ifElseBranchActivity3.Condition = ruleconditionreference9; this.ifElseBranchActivity3.Name = "ifElseBranchActivity3"; // // cancellationHandlerActivity1 // this.cancellationHandlerActivity1.Name = "cancellationHandlerActivity1"; ruleconditionreference10.ConditionName = "IsAction5"; // // compensatableSequenceActivity5 // this.compensatableSequenceActivity5.Activities.Add(this.codeActivity1); this.compensatableSequenceActivity5.Activities.Add(this.setStateActivity8); this.compensatableSequenceActivity5.Name = "compensatableSequenceActivity5"; this.compensatableSequenceActivity5.SetValue(System.Workflow.Activities.ConditionedActivityGroup.WhenConditionProperty, ruleconditionreference10); ruleconditionreference11.ConditionName = "IsAction4"; // // compensatableSequenceActivity4 // this.compensatableSequenceActivity4.Activities.Add(this.setStateActivity4); this.compensatableSequenceActivity4.Name = "compensatableSequenceActivity4"; this.compensatableSequenceActivity4.SetValue(System.Workflow.Activities.ConditionedActivityGroup.WhenConditionProperty, ruleconditionreference11); ruleconditionreference12.ConditionName = "IsAction3"; // // compensatableSequenceActivity3 // this.compensatableSequenceActivity3.Activities.Add(this.codeActivity8); this.compensatableSequenceActivity3.Activities.Add(this.setStateActivity5); this.compensatableSequenceActivity3.Name = "compensatableSequenceActivity3"; this.compensatableSequenceActivity3.SetValue(System.Workflow.Activities.ConditionedActivityGroup.WhenConditionProperty, ruleconditionreference12); ruleconditionreference13.ConditionName = "IsAction2"; // // compensatableSequenceActivity2 // this.compensatableSequenceActivity2.Activities.Add(this.codeActivity7); this.compensatableSequenceActivity2.Activities.Add(this.setStateActivity7); this.compensatableSequenceActivity2.Name = "compensatableSequenceActivity2"; this.compensatableSequenceActivity2.SetValue(System.Workflow.Activities.ConditionedActivityGroup.WhenConditionProperty, ruleconditionreference13); ruleconditionreference14.ConditionName = "IsAction1"; // // compensatableSequenceActivity1 // this.compensatableSequenceActivity1.Activities.Add(this.codeActivity5); this.compensatableSequenceActivity1.Activities.Add(this.setStateActivity6); this.compensatableSequenceActivity1.Name = "compensatableSequenceActivity1"; this.compensatableSequenceActivity1.SetValue(System.Workflow.Activities.ConditionedActivityGroup.WhenConditionProperty, ruleconditionreference14); // // ifElseActivity5 // this.ifElseActivity5.Activities.Add(this.ifElseBranchActivity12); this.ifElseActivity5.Activities.Add(this.ifElseBranchActivity13); this.ifElseActivity5.Name = "ifElseActivity5"; // // handleExternalEventActivity3 // this.handleExternalEventActivity3.EventName = "GetNewNum"; this.handleExternalEventActivity3.InterfaceType = typeof(Interfaces.IFormService); this.handleExternalEventActivity3.Name = "handleExternalEventActivity3"; this.handleExternalEventActivity3.Invoked += new System.EventHandler<System.Workflow.Activities.ExternalDataEventArgs>(this.handleExternalEventActivity3_Invoked); // // callExternalMethodActivity6 // this.callExternalMethodActivity6.InterfaceType = typeof(Interfaces.IFormService); this.callExternalMethodActivity6.MethodName = "NewPinCodeInvite"; this.callExternalMethodActivity6.Name = "callExternalMethodActivity6"; // // ifElseActivity4 // this.ifElseActivity4.Activities.Add(this.ifElseBranchActivity9); this.ifElseActivity4.Activities.Add(this.ifElseBranchActivity10); this.ifElseActivity4.Activities.Add(this.ifElseBranchActivity11); this.ifElseActivity4.Name = "ifElseActivity4"; // // handleExternalEventActivity2 // this.handleExternalEventActivity2.EventName = "GetNewNum"; this.handleExternalEventActivity2.InterfaceType = typeof(Interfaces.IFormService); this.handleExternalEventActivity2.Name = "handleExternalEventActivity2"; this.handleExternalEventActivity2.Invoked += new System.EventHandler<System.Workflow.Activities.ExternalDataEventArgs>(this.handleExternalEventActivity2_Invoked); // // callExternalMethodActivity4 // this.callExternalMethodActivity4.InterfaceType = typeof(Interfaces.IFormService); this.callExternalMethodActivity4.MethodName = "SendBackMessageLine"; this.callExternalMethodActivity4.Name = "callExternalMethodActivity4"; workflowparameterbinding9.ParameterName = "message"; workflowparameterbinding9.Value = "\"VVedite Starij PIN\""; this.callExternalMethodActivity4.ParameterBindings.Add(workflowparameterbinding9); // // callExternalMethodActivity10 // this.callExternalMethodActivity10.InterfaceType = typeof(Interfaces.IFormService); this.callExternalMethodActivity10.MethodName = "SendBackMessageLine"; this.callExternalMethodActivity10.Name = "callExternalMethodActivity10"; workflowparameterbinding10.ParameterName = "message"; workflowparameterbinding10.Value = "\"я деписоти \""; this.callExternalMethodActivity10.ParameterBindings.Add(workflowparameterbinding10); // // callExternalMethodActivity8 // this.callExternalMethodActivity8.InterfaceType = typeof(Interfaces.IFormService); this.callExternalMethodActivity8.MethodName = "SendBackMessageLine"; this.callExternalMethodActivity8.Name = "callExternalMethodActivity8"; workflowparameterbinding11.ParameterName = "message"; workflowparameterbinding11.Value = "\"WidtDraw\""; this.callExternalMethodActivity8.ParameterBindings.Add(workflowparameterbinding11); // // ReadCardIfElse // this.ReadCardIfElse.Activities.Add(this.ifElseBranchActivity5); this.ReadCardIfElse.Activities.Add(this.ifElseBranchActivity6); this.ReadCardIfElse.Name = "ReadCardIfElse"; // // ReadCardNumber // this.ReadCardNumber.EventName = "GetNewNum"; this.ReadCardNumber.InterfaceType = typeof(Interfaces.IFormService); this.ReadCardNumber.Name = "ReadCardNumber"; this.ReadCardNumber.Invoked += new System.EventHandler<System.Workflow.Activities.ExternalDataEventArgs>(this.GetInputCardNumber); // // DisplayWelcomeMessage // this.DisplayWelcomeMessage.InterfaceType = typeof(Interfaces.IFormService); this.DisplayWelcomeMessage.MethodName = "WelcomeMessage"; this.DisplayWelcomeMessage.Name = "DisplayWelcomeMessage"; // // InitCode // this.InitCode.Name = "InitCode"; this.InitCode.ExecuteCode += new System.EventHandler(this.WorkFlowInit); // // ifElseActivity3 // this.ifElseActivity3.Activities.Add(this.ifElseBranchActivity7); this.ifElseActivity3.Activities.Add(this.ifElseBranchActivity8); this.ifElseActivity3.Name = "ifElseActivity3"; // // handleExternalEventActivity1 // this.handleExternalEventActivity1.EventName = "GetNewAction"; this.handleExternalEventActivity1.InterfaceType = typeof(Interfaces.IFormService); this.handleExternalEventActivity1.Name = "handleExternalEventActivity1"; activitybind7.Name = "BankomatsWorkflow"; activitybind7.Path = "buffer"; workflowparameterbinding12.ParameterName = "e"; workflowparameterbinding12.SetBinding(System.Workflow.ComponentModel.WorkflowParameterBinding.ValueProperty, ((System.Workflow.ComponentModel.ActivityBind)(activitybind7))); this.handleExternalEventActivity1.ParameterBindings.Add(workflowparameterbinding12); // // callExternalMethodActivity9 // this.callExternalMethodActivity9.InterfaceType = typeof(Interfaces.IFormService); this.callExternalMethodActivity9.MethodName = "ViewBalance"; this.callExternalMethodActivity9.Name = "callExternalMethodActivity9"; activitybind8.Name = "BankomatsWorkflow"; activitybind8.Path = "CurrentAvailableBalance"; workflowparameterbinding13.ParameterName = "accountAvailableBalance"; workflowparameterbinding13.SetBinding(System.Workflow.ComponentModel.WorkflowParameterBinding.ValueProperty, ((System.Workflow.ComponentModel.ActivityBind)(activitybind8))); activitybind9.Name = "BankomatsWorkflow"; activitybind9.Path = "CurrentTotalBalance"; workflowparameterbinding14.ParameterName = "accountTotalBalance"; workflowparameterbinding14.SetBinding(System.Workflow.ComponentModel.WorkflowParameterBinding.ValueProperty, ((System.Workflow.ComponentModel.ActivityBind)(activitybind9))); this.callExternalMethodActivity9.ParameterBindings.Add(workflowparameterbinding13); this.callExternalMethodActivity9.ParameterBindings.Add(workflowparameterbinding14); // // ifElseActivity2 // this.ifElseActivity2.Activities.Add(this.ifElseBranchActivity3); this.ifElseActivity2.Activities.Add(this.ifElseBranchActivity4); this.ifElseActivity2.Name = "ifElseActivity2"; // // GetPinHandle // this.GetPinHandle.EventName = "GetNewNum"; this.GetPinHandle.InterfaceType = typeof(Interfaces.IFormService); this.GetPinHandle.Name = "GetPinHandle"; this.GetPinHandle.Invoked += new System.EventHandler<System.Workflow.Activities.ExternalDataEventArgs>(this.GetInputPin); // // callExternalMethodActivity1 // this.callExternalMethodActivity1.InterfaceType = typeof(Interfaces.IFormService); this.callExternalMethodActivity1.MethodName = "DisplayAuthMenu"; this.callExternalMethodActivity1.Name = "callExternalMethodActivity1"; // // setStateActivity2 // this.setStateActivity2.Name = "setStateActivity2"; this.setStateActivity2.TargetStateName = "EnterCard"; // // conditionedActivityGroup1 // this.conditionedActivityGroup1.Activities.Add(this.compensatableSequenceActivity1); this.conditionedActivityGroup1.Activities.Add(this.compensatableSequenceActivity2); this.conditionedActivityGroup1.Activities.Add(this.compensatableSequenceActivity3); this.conditionedActivityGroup1.Activities.Add(this.compensatableSequenceActivity4); this.conditionedActivityGroup1.Activities.Add(this.compensatableSequenceActivity5); this.conditionedActivityGroup1.Activities.Add(this.cancellationHandlerActivity1); this.conditionedActivityGroup1.Name = "conditionedActivityGroup1"; ruleconditionreference15.ConditionName = "IsValidMenuAction"; this.conditionedActivityGroup1.UntilCondition = ruleconditionreference15; // // GetActionToDo // this.GetActionToDo.EventName = "GetNewAction"; this.GetActionToDo.InterfaceType = typeof(Interfaces.IFormService); this.GetActionToDo.Name = "GetActionToDo"; activitybind10.Name = "BankomatsWorkflow"; activitybind10.Path = "buffer"; workflowparameterbinding15.ParameterName = "e"; workflowparameterbinding15.SetBinding(System.Workflow.ComponentModel.WorkflowParameterBinding.ValueProperty, ((System.Workflow.ComponentModel.ActivityBind)(activitybind10))); this.GetActionToDo.ParameterBindings.Add(workflowparameterbinding15); // // ViewMenuText // this.ViewMenuText.InterfaceType = typeof(Interfaces.IFormService); this.ViewMenuText.MethodName = "DisplayMenu"; this.ViewMenuText.Name = "ViewMenuText"; // // SetAuthState // this.SetAuthState.Name = "SetAuthState"; this.SetAuthState.TargetStateName = "Authenticate"; // // GetLanguageHandle // this.GetLanguageHandle.EventName = "GetNewAction"; this.GetLanguageHandle.InterfaceType = typeof(Interfaces.IFormService); this.GetLanguageHandle.Name = "GetLanguageHandle"; // // ViewLanguageMenu // this.ViewLanguageMenu.InterfaceType = typeof(Interfaces.IFormService); this.ViewLanguageMenu.MethodName = "DisplayLanguage"; this.ViewLanguageMenu.Name = "ViewLanguageMenu"; // // eventDrivenActivity2 // this.eventDrivenActivity2.Activities.Add(this.handleExternalEventActivity3); this.eventDrivenActivity2.Activities.Add(this.ifElseActivity5); this.eventDrivenActivity2.Name = "eventDrivenActivity2"; // // stateInitializationActivity3 // this.stateInitializationActivity3.Activities.Add(this.callExternalMethodActivity6); this.stateInitializationActivity3.Name = "stateInitializationActivity3"; // // eventDrivenActivity1 // this.eventDrivenActivity1.Activities.Add(this.handleExternalEventActivity2); this.eventDrivenActivity1.Activities.Add(this.ifElseActivity4); this.eventDrivenActivity1.Name = "eventDrivenActivity1"; // // stateInitializationActivity2 // this.stateInitializationActivity2.Activities.Add(this.callExternalMethodActivity4); this.stateInitializationActivity2.Name = "stateInitializationActivity2"; // // handleExternalEventActivity5 // this.handleExternalEventActivity5.EventName = "GetNewNum"; this.handleExternalEventActivity5.InterfaceType = typeof(Interfaces.IFormService); this.handleExternalEventActivity5.Name = "handleExternalEventActivity5"; // // handleExternalEventActivity6 // this.handleExternalEventActivity6.EventName = "GetNewAction"; this.handleExternalEventActivity6.InterfaceType = typeof(Interfaces.IFormService); this.handleExternalEventActivity6.Name = "handleExternalEventActivity6"; // // stateInitializationActivity7 // this.stateInitializationActivity7.Activities.Add(this.callExternalMethodActivity10); this.stateInitializationActivity7.Name = "stateInitializationActivity7"; // // stateInitializationActivity5 // this.stateInitializationActivity5.Activities.Add(this.callExternalMethodActivity8); this.stateInitializationActivity5.Name = "stateInitializationActivity5"; // // EnterCardEvent // this.EnterCardEvent.Activities.Add(this.ReadCardNumber); this.EnterCardEvent.Activities.Add(this.ReadCardIfElse); this.EnterCardEvent.Name = "EnterCardEvent"; // // Init // this.Init.Activities.Add(this.InitCode); this.Init.Activities.Add(this.DisplayWelcomeMessage); this.Init.Name = "Init"; // // MenuOrExit // this.MenuOrExit.Activities.Add(this.handleExternalEventActivity1); this.MenuOrExit.Activities.Add(this.ifElseActivity3); this.MenuOrExit.Name = "MenuOrExit"; // // InitBalace // this.InitBalace.Activities.Add(this.callExternalMethodActivity9); this.InitBalace.Name = "InitBalace"; // // GetPin // this.GetPin.Activities.Add(this.GetPinHandle); this.GetPin.Activities.Add(this.ifElseActivity2); this.GetPin.Name = "GetPin"; // // InitAuth // this.InitAuth.Activities.Add(this.callExternalMethodActivity1); this.InitAuth.Name = "InitAuth"; // // stateInitializationActivity1 // this.stateInitializationActivity1.Activities.Add(this.setStateActivity2); this.stateInitializationActivity1.Name = "stateInitializationActivity1"; // // SelectActionToDo // this.SelectActionToDo.Activities.Add(this.GetActionToDo); this.SelectActionToDo.Activities.Add(this.conditionedActivityGroup1); this.SelectActionToDo.Name = "SelectActionToDo"; // // InitMenu // this.InitMenu.Activities.Add(this.ViewMenuText); this.InitMenu.Name = "InitMenu"; // // GetLanguage // this.GetLanguage.Activities.Add(this.GetLanguageHandle); this.GetLanguage.Activities.Add(this.SetAuthState); this.GetLanguage.Name = "GetLanguage"; // // InitLanguage // this.InitLanguage.Activities.Add(this.ViewLanguageMenu); this.InitLanguage.Name = "InitLanguage"; // // EnterNewPin // this.EnterNewPin.Activities.Add(this.stateInitializationActivity3); this.EnterNewPin.Activities.Add(this.eventDrivenActivity2); this.EnterNewPin.Name = "EnterNewPin"; // // EnterOldPin // this.EnterOldPin.Activities.Add(this.stateInitializationActivity2); this.EnterOldPin.Activities.Add(this.eventDrivenActivity1); this.EnterOldPin.Name = "EnterOldPin"; // // NumHandler // this.NumHandler.Activities.Add(this.handleExternalEventActivity5); this.NumHandler.Name = "NumHandler"; // // ActionHandler // this.ActionHandler.Activities.Add(this.handleExternalEventActivity6); this.ActionHandler.Name = "ActionHandler"; // // Deposit // this.Deposit.Activities.Add(this.stateInitializationActivity7); this.Deposit.Name = "Deposit"; // // Withdrawal // this.Withdrawal.Activities.Add(this.stateInitializationActivity5); this.Withdrawal.Name = "Withdrawal"; // // EnterCard // this.EnterCard.Activities.Add(this.Init); this.EnterCard.Activities.Add(this.EnterCardEvent); this.EnterCard.Name = "EnterCard"; // // ViewBalance // this.ViewBalance.Activities.Add(this.InitBalace); this.ViewBalance.Activities.Add(this.MenuOrExit); this.ViewBalance.Name = "ViewBalance"; // // Authenticate // this.Authenticate.Activities.Add(this.InitAuth); this.Authenticate.Activities.Add(this.GetPin); this.Authenticate.Name = "Authenticate"; // // Final // this.Final.Activities.Add(this.stateInitializationActivity1); this.Final.Name = "Final"; // // Menu // this.Menu.Activities.Add(this.InitMenu); this.Menu.Activities.Add(this.SelectActionToDo); this.Menu.Name = "Menu"; // // SelectLanguage // this.SelectLanguage.Activities.Add(this.InitLanguage); this.SelectLanguage.Activities.Add(this.GetLanguage); this.SelectLanguage.Name = "SelectLanguage"; // // BankomatsWorkflow // this.Activities.Add(this.SelectLanguage); this.Activities.Add(this.Menu); this.Activities.Add(this.Final); this.Activities.Add(this.Authenticate); this.Activities.Add(this.ViewBalance); this.Activities.Add(this.EnterCard); this.Activities.Add(this.Withdrawal); this.Activities.Add(this.Deposit); this.Activities.Add(this.ActionHandler); this.Activities.Add(this.NumHandler); this.Activities.Add(this.EnterOldPin); this.Activities.Add(this.EnterNewPin); this.CompletedStateName = null; this.DynamicUpdateCondition = null; this.InitialStateName = "EnterCard"; this.Name = "BankomatsWorkflow"; this.CanModifyActivities = false; }
private void InitializeComponent () { CanModifyActivities = true; CodeCondition codecondition1 = new CodeCondition (); ProofReadSetStateQualityNotOK = new SetStateActivity (); ProofReadSetStateQualityOK = new SetStateActivity (); ProofReadElseBranchActivity2 = new IfElseBranchActivity (); ProofReadElseBranch = new IfElseBranchActivity (); PrintFinalizationCode = new CodeActivity (); PrintSetState = new SetStateActivity (); PrintCode = new CodeActivity (); PrintDelay = new DelayActivity (); ProofReadIfElse = new IfElseActivity (); ProofReadDelay = new DelayActivity (); CreateInitCode = new CodeActivity (); DocumentSetState = new SetStateActivity (); CodeDocument = new CodeActivity (); CreateDelay = new DelayActivity (); PrintFinalization = new StateFinalizationActivity (); PrintEventDriven = new EventDrivenActivity (); ProofReadEventDriven = new EventDrivenActivity (); CreateInitialization = new StateInitializationActivity (); CreateDriven = new EventDrivenActivity (); End = new StateActivity (); Print = new StateActivity (); ProofRead = new StateActivity (); Create = new StateActivity (); // ProofReadSetStateQualityNotOK ProofReadSetStateQualityNotOK.Name = "ProofReadSetStateQualityNotOK"; ProofReadSetStateQualityNotOK.TargetStateName = "Print"; // ProofReadSetStateQualityOK ProofReadSetStateQualityOK.Name = "ProofReadSetStateQualityOK"; ProofReadSetStateQualityOK.TargetStateName = "End"; // ProofReadElseBranchActivity2 ProofReadElseBranchActivity2.Activities.Add (ProofReadSetStateQualityNotOK); ProofReadElseBranchActivity2.Name = "ProofReadElseBranchActivity2"; // ProofReadElseBranch ProofReadElseBranch.Activities.Add (ProofReadSetStateQualityOK); codecondition1.Condition += new EventHandler <ConditionalEventArgs> (ProofReadIfElseConditionFunction); ProofReadElseBranch.Condition = codecondition1; ProofReadElseBranch.Name = "ProofReadElseBranch"; // PrintFinalizationCode PrintFinalizationCode.Name = "PrintFinalizationCode"; PrintFinalizationCode.ExecuteCode += new EventHandler (PrintFinalizationCodeFunction); // PrintSetState PrintSetState.Name = "PrintSetState"; PrintSetState.TargetStateName = "End"; // PrintCode PrintCode.Name = "PrintCode"; PrintCode.ExecuteCode += new EventHandler (PrintCodeFunction); // PrintDelay PrintDelay.Name = "PrintDelay"; PrintDelay.TimeoutDuration = TimeSpan.Parse ("00:00:02"); // ProofReadIfElse ProofReadIfElse.Activities.Add (ProofReadElseBranch); ProofReadIfElse.Activities.Add (ProofReadElseBranchActivity2); ProofReadIfElse.Description = "Quality is OK?"; ProofReadIfElse.Name = "ProofReadIfElse"; // ProofReadDelay ProofReadDelay.Name = "ProofReadDelay"; ProofReadDelay.TimeoutDuration = TimeSpan.Parse ("00:00:01"); // CreateInitCode CreateInitCode.Name = "CreateInitCode"; CreateInitCode.ExecuteCode += new EventHandler (CreateInitCodeFunction); // DocumentSetState DocumentSetState.Name = "DocumentSetState"; DocumentSetState.TargetStateName = "ProofRead"; // CodeDocument CodeDocument.Name = "CodeDocument"; CodeDocument.ExecuteCode += new EventHandler (CodeDocumentFunction); // CreateDelay CreateDelay.Name = "CreateDelay"; CreateDelay.TimeoutDuration = TimeSpan.Parse ("00:00:01"); // PrintFinalization PrintFinalization.Activities.Add (PrintFinalizationCode); PrintFinalization.Name = "PrintFinalization"; // PrintEventDriven PrintEventDriven.Activities.Add (PrintDelay); PrintEventDriven.Activities.Add (PrintCode); PrintEventDriven.Activities.Add (PrintSetState); PrintEventDriven.Name = "PrintEventDriven"; // ProofReadEventDriven ProofReadEventDriven.Activities.Add (ProofReadDelay); ProofReadEventDriven.Activities.Add (ProofReadIfElse); ProofReadEventDriven.Name = "ProofReadEventDriven"; // CreateInitialization CreateInitialization.Activities.Add (CreateInitCode); CreateInitialization.Name = "CreateInitialization"; // CreateDriven CreateDriven.Activities.Add (CreateDelay); CreateDriven.Activities.Add (CodeDocument); CreateDriven.Activities.Add (DocumentSetState); CreateDriven.Name = "CreateDriven"; // End End.Name = "End"; // Print Print.Activities.Add (PrintEventDriven); Print.Activities.Add (PrintFinalization); Print.Name = "Print"; // ProofRead ProofRead.Activities.Add (ProofReadEventDriven); ProofRead.Name = "ProofRead"; // Create Create.Activities.Add (CreateDriven); Create.Activities.Add (CreateInitialization); Create.Name = "Create"; // DocumentCreation Activities.Add (Create); Activities.Add (ProofRead); Activities.Add (Print); Activities.Add (End); CompletedStateName = "End"; InitialStateName = "Create"; Name = "DocumentCreation"; CanModifyActivities = false; }