예제 #1
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();
 }
예제 #2
0
 private WorkflowResults(WorkflowCompletedEventArgs args)
 {
     Check.ArgumentIsNotNull(args, "args");
     OutputParameters = args.OutputParameters;
     InstanceId = args.WorkflowInstance.InstanceId;
     WorkflowDefinition = args.WorkflowDefinition;
 }
예제 #3
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();
        }
예제 #4
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;
            }


        }
예제 #5
0
 static void Runtime_WorkflowCompleted(object sender, WorkflowCompletedEventArgs e)
 {
     //CurrentResultsInContext =
     //    WorkflowResults.CreateCompletedWorkflowResults(e);
 }
예제 #6
0
 private static void OnWorkflowCompleted(object sender, WorkflowCompletedEventArgs instance)
 {
     Console.WriteLine("\nYour transaction has finished. Thank you for your service.");
     waitHandle.Set();
 }
예제 #7
0
 static void OnWorkflowCompleted(object sender, WorkflowCompletedEventArgs e)
 {
     Console.WriteLine("Ending workflow...");
     waitHandle.Set();
 }
예제 #8
0
 static void OnWorkflowCompletion(object sender, WorkflowCompletedEventArgs instance)
 {
     Console.WriteLine("\r\nWorkflow Instance Completed");
     waitHandle.Set();
 }
예제 #9
0
파일: Program.cs 프로젝트: ssickles/archive
 static void OnWorkflowCompleted(object sender, WorkflowCompletedEventArgs e)
 {
     // Signal the waitHandle because workflow completed
     waitHandle.Set();
 }
예제 #10
0
 static void OnWorkflowCompleted(object sender, WorkflowCompletedEventArgs e)
 {
     Console.WriteLine("\r\nWorkflow completed");
     waitHandle.Set();
 }
예제 #11
0
 private void _runtime_WorkflowCompleted(object sender, WorkflowCompletedEventArgs e)
 {
     LogStatus(e.WorkflowInstance.InstanceId, "WorkflowCompleted");
     //ManagedWorkflowInstance managedInstance = FindWorkflow(e.WorkflowInstance.InstanceId);
     //if (managedInstance != null)
     //{
     //    managedInstance.Outputs = e.OutputParameters;
     //    managedInstance.StopWaiting();
     //}
 }
예제 #12
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);
 }
예제 #13
0
 private void OnWorkflowCompleted(object sender, WorkflowCompletedEventArgs e)
 {
     MessageBox.Show("The Workflow Completed");
 }
예제 #14
0
 public static WorkflowResults CreateCompletedWorkflowResults(WorkflowCompletedEventArgs args)
 {
     WorkflowResults results = new WorkflowResults(args);
     results.Status= WorkflowStatus.Completed;
     return results;
 }
예제 #15
0
파일: Program.cs 프로젝트: ssickles/archive
 private static void OnWorkflowCompleted(object sender, WorkflowCompletedEventArgs e)
 {
     Console.WriteLine("Workflow has completed.");
     waitHandle.Set();
 }
예제 #16
0
 // This method will be called when a workflow instance is completed; since we have started only a single
 // instance we are ignoring the event args and signaling the waitHandle so the main thread can continue
 private void theWorkflowRuntime_WorkflowCompleted(object sender, WorkflowCompletedEventArgs e)
 {
     Trace.TraceInformation(string.Format(
         "Workflow report: The instance {0} completed sucessfully.", e.WorkflowInstance.InstanceId));
 }
예제 #17
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);
        }
예제 #18
0
파일: Program.cs 프로젝트: ssickles/archive
 static void OnWorkflowCompleted(object sender, WorkflowCompletedEventArgs e)
 {
     Console.WriteLine("  Workflow instance " + e.WorkflowInstance.InstanceId + " completed\n");
     waitHandle.Set();
 }
예제 #19
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");
        }
예제 #20
0
 static void wr_WorkflowCompleted(object sender, WorkflowCompletedEventArgs e)
 {
     Console.ForegroundColor = ConsoleColor.DarkYellow;
     Console.WriteLine("Completed:\t{0}", e.WorkflowInstance.InstanceId);
     Console.ResetColor();
 }
예제 #21
0
          // This method will be called when a workflow instance is completed; since we have started only a single
        // instance we are ignoring the event args and signaling the waitHandle so the main thread can continue
        static void OnWorkflowCompleted(object sender, WorkflowCompletedEventArgs e)
        {

        	//Console.WriteLine ("-->{0}", Environment.StackTrace);
        	Console.WriteLine ("OnWorkflowCompleted");
            	waitHandle.Set();
        }
예제 #22
0
 void WorkflowRuntime_WorkflowCompleted(object sender, WorkflowCompletedEventArgs e)
 {
 }
예제 #23
0
 /// <summary>
 /// Evento que se ejecuta cada vez que se completa una instancia
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void workflowRuntime_WorkflowCompleted(object sender, WorkflowCompletedEventArgs e)
 {
     lblInstances .Text = (++instanceCounter).ToString() + " instancias procesadas";
 }
예제 #24
0
 void Runtime_WorkflowCompleted(object sender, WorkflowCompletedEventArgs e)
 {
     this.UpdateListItem(e.WorkflowInstance, "", "Completed");
 }
예제 #25
0
        //public static event WorkflowsEvent Begin_workflowRuntime_WorkflowCompleted;
        //public static event WorkflowsEvent End_workflowRuntime_WorkflowCompleted;

        /// <summary>
        /// WorkflowCompleted事件的处理方法
        /// </summary>
        /// <param name="sender">事件发起对象</param>
        /// <param name="e">事件参数</param>
        private static void _workflowRuntime_WorkflowCompleted(object sender, WorkflowCompletedEventArgs e)
        {
            //if (Begin_workflowRuntime_WorkflowCompleted != null)
            //    Begin_workflowRuntime_WorkflowCompleted(MethodBase.GetCurrentMethod(), new object[] { sender, e.WorkflowInstance.GetWorkflowDefinition().Name, e.WorkflowInstance.InstanceId});
            //MethodBase curMethod=MethodBase.GetCurrentMethod();
            try
            {
                WorkflowRuntimeManagerMethodsBeginning(MethodWorkflowCompleted, new object[] { e.WorkflowInstance.InstanceId });
                BindCacheManager.RemoveByValue(e.WorkflowInstance.InstanceId.ToString());
                Session session = SessionManager.GetInstance.GetSessionByInstanceId(e.WorkflowInstance.InstanceId);
                if (session != null)
                {
                    //Console.WriteLine(String.Format("The workflow of session {0} completed. ", SessionManager.GetInstance.GetSessionKeyByInstanceId(e.WorkflowInstance.InstanceId)));
                    //int waitingCount = session.GetHostWaitingCount;
                    //int wfWaitingCount = session.GetWFWaitingCount;

                    if (logger.IsDebugEnabled)
                    {
                        logger.DebugFormat(MsgWFCompleted,
                                                        e.WorkflowDefinition == null ? string.Empty : e.WorkflowDefinition.Name,
                                                        session.Key,
                                                        session.Station ?? string.Empty,
                                                        session.Line ?? string.Empty,
                                                        session.Editor ?? string.Empty,
                                                        session.GetHostWaitingCount.ToString(),
                                                        session.GetWFWaitingCount.ToString());
                    }

                    if (session.GetHostWaitingCount > 1 || session.GetWFWaitingCount > 0)
                    {
                        logger.WarnFormat(MsgWFCompleted,
                                                           e.WorkflowDefinition == null ? string.Empty : e.WorkflowDefinition.Name,
                                                           session.Key,
                                                           session.Station ?? string.Empty,
                                                           session.Line ?? string.Empty,
                                                           session.Editor ?? string.Empty,
                                                          session.GetHostWaitingCount.ToString(),
                                                          session.GetWFWaitingCount.ToString());
                    }
                    //Remove session first
                    //Vincent 2014-07-10: Change to not terminate WF
                    //SessionManager.GetInstance.RemoveSession(session, false);
                    //Vincent 2014-11-15 Change to remove session and terminate wf & Host thread 
                    SessionManager.GetInstance.RemoveSession(session);
                    #region release wf&Host thread in terminateWF  function
                    //for (int i = 0; i < waitingCount; ++i)
                    //{
                    //    session.ResumeHost();
                    //}
                    //session.WaitHostHandle.Close();
                    ////SessionManager.GetInstance.RemoveSession(session, false);

                    ////after remove session then resume wf thread
                    //for (int i = 0; i < wfWaitingCount; ++i)
                    //{
                    //    session.ResumeWorkFlow();
                    //}
                    //session.WaitWorkflowHandle.Close();
                    #endregion
                }
                else
                {
                    logger.WarnFormat(MsgWFNoSessionCompleted,
                                                  e.WorkflowDefinition == null ? string.Empty: e.WorkflowDefinition.Name,
                                                   e.WorkflowInstance.InstanceId);
                }
            }
            catch (Exception ex)
            {
                //Console.WriteLine(ex.ToString());
                logger.Error(MethodWorkflowCompleted, ex);
            }
            finally
            {
                MakeSureTransactionDisposed();
                WorkflowRuntimeManagerMethodsEndding(MethodWorkflowCompleted, new object[] { e.WorkflowInstance.InstanceId });
                //if (End_workflowRuntime_WorkflowCompleted != null)
                //    End_workflowRuntime_WorkflowCompleted(MethodBase.GetCurrentMethod(), new object[] { sender, e.WorkflowInstance.GetWorkflowDefinition().Name, e.WorkflowInstance.InstanceId });
            }
        }
예제 #26
0
 static void OnWorkflowCompleted(object sender, WorkflowCompletedEventArgs e)
 {
     waitHandle.Set();
 }
예제 #27
0
파일: MainForm.cs 프로젝트: SiTox/07-SK-K-B
 static void OnWorkflowCompleted(object sender, WorkflowCompletedEventArgs e)
 {
     Console.WriteLine("Workflow completed; back to Form");
 }