public EditPicture() { InitializeComponent(); _historyIterator = new HistoryIterator(0, 0); trackBar1.Value = trackBar1.Maximum / maxZoom; _factor = FormsHelper.GetFactor(ref trackBar1, maxZoom); }
public override List<Decision> Decide(DecisionTask task) { var decisions = new List<Decision>(); List<ActivityState> activityStates; string startingInput; //ProcessHistory(task, out startingInput, out activityStates); HistoryIterator iterator = new HistoryIterator(this.Client, task); foreach (var evnt in iterator) { if (evnt.EventType == EventType.WorkflowExecutionStarted) { //startingInput = evnt.WorkflowExecutionStartedEventAttributes.Input; //this.Deserialize<WorkFlowExecutionInput>(evnt.WorkflowExecutionStartedEventAttributes.Input); decisions.Add(new Decision() { DecisionType = DecisionType.ScheduleActivityTask, ScheduleActivityTaskDecisionAttributes = new ScheduleActivityTaskDecisionAttributes() { ActivityType = new ActivityType() { Name = Constants.ActivityName, Version = Constants.ActivityVersion }, ActivityId = Constants.ActivityIdPrefix + DateTime.Now.TimeOfDay, Input = evnt.WorkflowExecutionStartedEventAttributes.Input } }); } if (evnt.EventType == EventType.ActivityTaskCompleted) { //ActivityState state = this.Deserialize<ActivityState>(evnt.ActivityTaskCompletedEventAttributes.Result); //activityStates.Add(state); decisions.Add(new Decision() { DecisionType = DecisionType.CompleteWorkflowExecution, CompleteWorkflowExecutionDecisionAttributes = new CompleteWorkflowExecutionDecisionAttributes { Result = "We are done" } }); } } //if (decisions.Count == 0) //{ // decisions.Add(new Decision() // { // DecisionType = DecisionType.CompleteWorkflowExecution, // CompleteWorkflowExecutionDecisionAttributes = new CompleteWorkflowExecutionDecisionAttributes // { // Result = "We are done" // } // }); //} return decisions; }
void ProcessHistory(DecisionTask task, out string startingInput, out List<ActivityState> activityStates) { startingInput = null; activityStates = new List<ActivityState>(); HistoryIterator iterator = new HistoryIterator(this.Client, task); foreach (var evnt in iterator) { if (evnt.EventType == EventType.WorkflowExecutionStarted) { startingInput = evnt.WorkflowExecutionStartedEventAttributes.Input; //this.Deserialize<WorkFlowExecutionInput>(evnt.WorkflowExecutionStartedEventAttributes.Input); } if (evnt.EventType == EventType.ActivityTaskCompleted) { ActivityState state = this.Deserialize<ActivityState>(evnt.ActivityTaskCompletedEventAttributes.Result); activityStates.Add(state); } } }