Exemplo n.º 1
0
        public static WorkflowResults CreateCompletedWorkflowResults(WorkflowCompletedEventArgs args)
        {
            WorkflowResults results = new WorkflowResults(args);

            results.Status = WorkflowStatus.Completed;
            return(results);
        }
Exemplo n.º 2
0
 private WorkflowResults(WorkflowCompletedEventArgs args)
 {
     Check.ArgumentIsNotNull(args, "args");
     OutputParameters   = args.OutputParameters;
     InstanceId         = args.WorkflowInstance.InstanceId;
     WorkflowDefinition = args.WorkflowDefinition;
 }
Exemplo n.º 3
0
 void WorkflowFinished(object sender, WorkflowCompletedEventArgs e)
 {
     if (WorkflowCompleted != null)
     {
         WorkflowCompleted(sender, e);
     }
 }
Exemplo n.º 4
0
 public void OnWorkflowCompelte(WorkflowCompletedEventArgs Args)
 {
     if (WorkflowComplete != null)
     {
         WorkflowComplete(null, Args);
     }
 }
Exemplo n.º 5
0
        static void workflowRuntime_WorkflowCompleted(object sender, WorkflowCompletedEventArgs e)
        {
            Console.WriteLine("Workflow completed");
            string returnValue = (string)e.OutputParameters["ReturnValue"];

            Console.WriteLine("The ReturnValue for this workflow was {0}", returnValue);
            waitHandle.Set();
        }
Exemplo n.º 6
0
        // This method is called when a workflow instance is completed; because only a single
        // thread can continue instance is started, the event arguments are ignored and the waitHandle
        // is signaled so the main and exit the program.
        static void OnWorkflowCompleted(object sender, WorkflowCompletedEventArgs e)
        {
            //The order status is stored in the "status" "out" parameter.
            string orderStatus = e.OutputParameters["Status"].ToString();

            Console.WriteLine("Order was " + orderStatus);
            waitHandle.Set();
        }
Exemplo n.º 7
0
        void wfRuntime_WorkflowCompleted(object sender, WorkflowCompletedEventArgs e)
        {
            string v = string.Format("{0},{1},{2},{3}", e.WorkflowInstance.InstanceId.ToString(), "WorkflowCompleted", System.DateTime.Now.ToString(), "-");

            lsWFEvent.Add(v);
            this.Invoke(RefreshWFEvent);
            this.Invoke(setSubmitEnabled);
        }
Exemplo n.º 8
0
        static void OnWorkflowCompleted(object sender, WorkflowCompletedEventArgs e)
        {
            ThreadMonitor.WriteToConsole(Thread.CurrentThread, "Host", "Host: Processed WorkflowCompleted Event");

            waitHandle.Set();

            Console.WriteLine("\n--- Workflow Done ---\n");
        }
        void OnWorkflowCompleted(object sender, WorkflowCompletedEventArgs args)
        {
            if (args == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("args");
            }

            CancelTimer(args.WorkflowInstance.InstanceId, true);
        }
Exemplo n.º 10
0
 public void OnWorkflowCompleted(object sender, WorkflowCompletedEventArgs e)
 {
     if (_instance.InstanceId == e.WorkflowInstance.InstanceId)
     {
         this._eC = e;
         _waitForResponse.Set();
         _localservice.WorkflowRuntime.WorkflowCompleted -= new EventHandler <WorkflowCompletedEventArgs>(OnWorkflowCompleted);
     }
 }
Exemplo n.º 11
0
        /// <summary>
        /// Initializes a new instance of the <see cref="WorkflowResults"/> class.
        /// </summary>
        /// <param name="args">The <see cref="System.Workflow.Runtime.WorkflowCompletedEventArgs"/> instance containing the event data.</param>
        private WorkflowResults(WorkflowCompletedEventArgs args)
        {
            Check.ArgumentIsNotNull(args, "args");
            _outputs    = args.OutputParameters;
            _instanceId = args.WorkflowInstance.InstanceId;

            // Getting definition is expensive and should be avoided
            //_definition = args.WorkflowDefinition;
        }
Exemplo n.º 12
0
 private static void workflowRuntime_WorkflowCompleted(Object sender, WorkflowCompletedEventArgs e)
 {
     Trace.WriteLine(string.Format("Workflow {0}: Completed", e.WorkflowInstance.InstanceId));
     foreach (string parameterName in e.OutputParameters.Keys)
     {
         Trace.WriteLine(string.Format(
                             "Workflow {0} Output Parameter Name: {0}, Value: {1}", parameterName,
                             e.OutputParameters[parameterName]));
     }
 }
Exemplo n.º 13
0
 /// <summary>
 /// The workflow has completed
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void workflowRuntime_WorkflowCompleted(
     object sender, WorkflowCompletedEventArgs e)
 {
     //get the result from the workflow
     if (e.OutputParameters.ContainsKey("Quotient"))
     {
         Double quotientValue
                       = (Double)e.OutputParameters["Quotient"];
         quotient.Text = quotientValue.ToString();
     }
 }
Exemplo n.º 14
0
 //when the workflow returns call CompleteWorkflow
 void OnWorkflowCompleted(object sender, WorkflowCompletedEventArgs e)
 {
     try
     {
         CompleteWorkflow(e.OutputParameters["ResultData"].ToString(), false);
     }
     catch (Exception ex)
     {
         base.Complete(false, ex);
     }
 }
Exemplo n.º 15
0
        /// <summary>
        /// Handles the WorkflowCompleted event of the WorkflowRuntime control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.Workflow.Runtime.WorkflowCompletedEventArgs"/> instance containing the event data.</param>
        void WorkflowRuntime_WorkflowCompleted(object sender, WorkflowCompletedEventArgs e)
        {
            //_WorkflowWaitHandle.Set();
            _WorkflowResults = WorkflowResults.CreateCompletedWorkflowResults(e);

            // Either pass the event to the custom handler or generate the exception
            if (WorkflowCompleted != null)
            {
                WorkflowCompleted(sender, e);
            }
        }
Exemplo n.º 16
0
        void workflowRuntime_WorkflowCompleted(object sender, WorkflowCompletedEventArgs e)
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendLine("Workflow completed");
            string returnValue = (string)e.OutputParameters["ReturnValue"];

            sb.AppendFormat("The ReturnValue for this workflow was {0}", returnValue);

            //workflow events will not be fired on the UI thread so we need to use the Dispatcher
            Dispatcher.Invoke(DispatcherPriority.Normal, new UpdateOutput(HandleUpdateOutput), sb.ToString());
        }
Exemplo n.º 17
0
        void runtime_WorkflowCompleted(object sender, WorkflowCompletedEventArgs e)
        {
            LogStatus(e.WorkflowInstance.InstanceId, "WorkflowCompleted");
            WorkflowInstanceWrapper wrapper
                = FindWorkflowInstance(e.WorkflowInstance.InstanceId);

            if (wrapper != null)
            {
                wrapper.OutputParameters = e.OutputParameters;
                wrapper.StopWaiting();
            }
        }
Exemplo n.º 18
0
        void runtime_WorkflowCompleted(object sender, WorkflowCompletedEventArgs e)
        {
            // Remove completed workflow from list view
            RemoveListViewItem remove = new RemoveListViewItem(RemoveListViewItemAsync);

            Invoke(remove, e.WorkflowInstance.InstanceId);

            // Remove completed workflow persistence file
            FileInfo file = new FileInfo(e.WorkflowInstance.InstanceId.ToString());

            file.Delete();
        }
Exemplo n.º 19
0
 void WorkflowCompleted(object o, WorkflowCompletedEventArgs e)
 {
     if (_childWorkflows.ContainsKey(e.WorkflowInstance.InstanceId)) //بعد از ایجاد زیر ورک فلو‌ها و بدون بسته شدن اپلیکیشن لیست کیو‌های زیر ورک فلو‌ها درون لیست باقی می‌ماند
     {
         Guid            parentWorkflowId = Enqueue(e.WorkflowInstance.InstanceId, _childWorkflows[e.WorkflowInstance.InstanceId], e.OutputParameters);
         SubWorkflowArgs arg = new SubWorkflowArgs(e.WorkflowInstance.InstanceId, e.WorkflowInstance.InstanceId, parentWorkflowId, null);
         this.OnSubWorkflowFinished(arg);
     }
     else
     {
         this.OnWorkflowCompelte(e);
     }
 }
Exemplo n.º 20
0
        public async Task Raise_workflow_completed_event_when_workflow_completed_decision_is_delivered_to_amazon_swf()
        {
            WorkflowCompletedEventArgs eventArgs = null;
            var workflow = new WorkflowCompleteOnSignal("result");

            workflow.Completed += (s, e) => { eventArgs = e; };

            await ExecuteWorkflowOnSignalEvent(workflow, "wid", "runid");

            Assert.That(eventArgs, Is.Not.Null);
            Assert.That(eventArgs.WorkflowId, Is.EqualTo("wid"));
            Assert.That(eventArgs.WorkflowRunId, Is.EqualTo("runid"));
            Assert.That(eventArgs.Result, Is.EqualTo("result"));
        }
Exemplo n.º 21
0
 //used to pass values back to the host application after the current WorkflowInstance has completed.
 void workflowRuntime_WorkflowCompleted(object sender, WorkflowCompletedEventArgs e)
 {
     if (this.result.InvokeRequired)
     {
         this.result.Invoke(new EventHandler <WorkflowCompletedEventArgs> (this.workflowRuntime_WorkflowCompleted), sender, e);
     }
     else
     {
         this.result.Text = e.OutputParameters["ReportResult"].ToString();
         //this.amount.Text = string.Empty;
         //this.approveButton.Enabled = false;
         //this.rejectButton.Enabled = false;
     }
 }
Exemplo n.º 22
0
        /// <summary>
        /// Handles the WorkflowCompleted event of the WorkflowRuntime control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.Workflow.Runtime.WorkflowCompletedEventArgs"/> instance containing the event data.</param>
        static void WorkflowRuntime_WorkflowCompleted(object sender, WorkflowCompletedEventArgs e)
        {
            Trace.WriteLine("WorkflowCompleted", "GlobalWorkflowRuntime");

            DateTime dateTimeNow = DataContext.Current.CurrentUserTimeZone.ToLocalTime(DateTime.UtcNow);

            WorkflowInstanceEntity wf = (WorkflowInstanceEntity)BusinessManager.Load(WorkflowInstanceEntity.ClassName, (PrimaryKeyId)e.WorkflowInstance.InstanceId);

            wf.State            = (int)BusinessProcessState.Closed;
            wf.ExecutionResult  = (int)BusinessProcessExecutionResult.Accepted;            // Calculate Result
            wf.ActualFinishDate = dateTimeNow;

            BusinessManager.Update(wf);

            // Cancel All Assignments
            CancelAllAssignments(wf);
        }
Exemplo n.º 23
0
 public void TestFixtureSetup()
 {
     _workflowRuntime = new WorkflowRuntime();
     _workflowRuntime.WorkflowCompleted
         += delegate(object sender, WorkflowCompletedEventArgs e)
         {
         //save the completed event args
         _completedArgs = e;
         _waitHandle.Set();
         };
     _workflowRuntime.WorkflowTerminated
         += delegate(object sender, WorkflowTerminatedEventArgs e)
         {
         Assert.Fail(
             "Workflow terminated: {0}", e.Exception.Message);
         _waitHandle.Set();
         };
 }
Exemplo n.º 24
0
        public void WorkflowCompleted(Object sender, WorkflowCompletedEventArgs eventArgs)
        {
            if (eventArgs.WorkflowInstance.InstanceId != workflowInstance.InstanceId)
            {
                return;
            }

            SetWorkflowStatus(WorkflowStatus.Completed);

            workflowResponse.WorkflowSteps = new List <WorkflowStep> ();

            if (eventArgs.OutputParameters.ContainsKey("WorkflowSteps"))
            {
                try {
                    workflowResponse.WorkflowSteps = (List <Server.Workflows.WorkflowStep>)eventArgs.OutputParameters ["WorkflowSteps"];

                    application.WorkQueueItemWorkflowStepsSave(workflowResponse.WorkQueueItemId, workflowResponse.WorkflowSteps);
                }

                catch { /* DO NOTHING */ }
            }


            if (eventArgs.OutputParameters.ContainsKey("ChainWorkQueueItemId"))
            {
                try {
                    workflowResponse.ChainWorkQueueItemId = (Int64)eventArgs.OutputParameters["ChainWorkQueueItemId"];
                }

                catch { /* DO NOTHING */ }
            }

            workflowResponse.OutputParameters = eventArgs.OutputParameters;


            canUnload = false;

            if (waitHandle != null)
            {
                waitHandle.Set();
            }
        }
Exemplo n.º 25
0
        // A Workflow 3.5 befejezésekor hívódik meg
        void workflowRuntime_WorkflowCompleted(object sender, WorkflowCompletedEventArgs e)
        {
            if (this.tbState.InvokeRequired)
            {
                this.tbState.Invoke(new EventHandler <WorkflowCompletedEventArgs>
                                        (this.workflowRuntime_WorkflowCompleted), sender, e);
            }
            else
            {
                if (e.OutputParameters["Result"].ToString().Length != 0)
                {
                    this.tbState.Text += e.OutputParameters["Result"].ToString();
                }
                this.tbState.Text += "\r\nMunkafolyamat befejezve";

                NewWindow.UpdateTables();
                btnOrder.Enabled = true;
                this.szerkesztőToolStripMenuItem.Enabled        = true;
                this.korábbiRendelésekToolStripMenuItem.Enabled = true;
            }
        }
Exemplo n.º 26
0
 private static void OnWorkflowCompleted(object sender, WorkflowCompletedEventArgs e)
 {
     Console.WriteLine("Workflow has completed.");
     waitHandle.Set();
 }
Exemplo n.º 27
0
 static void OnWorkflowCompletion(object sender, WorkflowCompletedEventArgs instance)
 {
     waitHandle.Set();
 }
Exemplo n.º 28
0
 void OnWorkflowCompleted(object sender, WorkflowCompletedEventArgs e)
 {
     waitHandle.Set();
 }
Exemplo n.º 29
0
 void OnWorkflowCompleted(object sender, WorkflowCompletedEventArgs e)
 {
     callback.EchoResponse(e.OutputParameters["ResultData"].ToString());
 }
Exemplo n.º 30
0
 static void wr_WorkflowCompleted(object sender, WorkflowCompletedEventArgs e)
 {
     Console.ForegroundColor = ConsoleColor.DarkYellow;
     Console.WriteLine("Completed:\t{0}", e.WorkflowInstance.InstanceId);
     Console.ResetColor();
 }