// 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(); }
private WorkflowResults(WorkflowCompletedEventArgs args) { Check.ArgumentIsNotNull(args, "args"); OutputParameters = args.OutputParameters; InstanceId = args.WorkflowInstance.InstanceId; WorkflowDefinition = args.WorkflowDefinition; }
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(); }
//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; } }
static void Runtime_WorkflowCompleted(object sender, WorkflowCompletedEventArgs e) { //CurrentResultsInContext = // WorkflowResults.CreateCompletedWorkflowResults(e); }
private static void OnWorkflowCompleted(object sender, WorkflowCompletedEventArgs instance) { Console.WriteLine("\nYour transaction has finished. Thank you for your service."); waitHandle.Set(); }
static void OnWorkflowCompleted(object sender, WorkflowCompletedEventArgs e) { Console.WriteLine("Ending workflow..."); waitHandle.Set(); }
static void OnWorkflowCompletion(object sender, WorkflowCompletedEventArgs instance) { Console.WriteLine("\r\nWorkflow Instance Completed"); waitHandle.Set(); }
static void OnWorkflowCompleted(object sender, WorkflowCompletedEventArgs e) { // Signal the waitHandle because workflow completed waitHandle.Set(); }
static void OnWorkflowCompleted(object sender, WorkflowCompletedEventArgs e) { Console.WriteLine("\r\nWorkflow completed"); waitHandle.Set(); }
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(); //} }
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); }
private void OnWorkflowCompleted(object sender, WorkflowCompletedEventArgs e) { MessageBox.Show("The Workflow Completed"); }
public static WorkflowResults CreateCompletedWorkflowResults(WorkflowCompletedEventArgs args) { WorkflowResults results = new WorkflowResults(args); results.Status= WorkflowStatus.Completed; return results; }
private static void OnWorkflowCompleted(object sender, WorkflowCompletedEventArgs e) { Console.WriteLine("Workflow has completed."); waitHandle.Set(); }
// 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)); }
/// <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); }
static void OnWorkflowCompleted(object sender, WorkflowCompletedEventArgs e) { Console.WriteLine(" Workflow instance " + e.WorkflowInstance.InstanceId + " completed\n"); waitHandle.Set(); }
static void OnWorkflowCompleted(object sender, WorkflowCompletedEventArgs e) { ThreadMonitor.WriteToConsole(Thread.CurrentThread, "Host", "Host: Processed WorkflowCompleted Event"); waitHandle.Set(); Console.WriteLine("\n--- Workflow Done ---\n"); }
static void wr_WorkflowCompleted(object sender, WorkflowCompletedEventArgs e) { Console.ForegroundColor = ConsoleColor.DarkYellow; Console.WriteLine("Completed:\t{0}", e.WorkflowInstance.InstanceId); Console.ResetColor(); }
// 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(); }
void WorkflowRuntime_WorkflowCompleted(object sender, WorkflowCompletedEventArgs e) { }
/// <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"; }
void Runtime_WorkflowCompleted(object sender, WorkflowCompletedEventArgs e) { this.UpdateListItem(e.WorkflowInstance, "", "Completed"); }
//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 }); } }
static void OnWorkflowCompleted(object sender, WorkflowCompletedEventArgs e) { waitHandle.Set(); }
static void OnWorkflowCompleted(object sender, WorkflowCompletedEventArgs e) { Console.WriteLine("Workflow completed; back to Form"); }