예제 #1
0
파일: MainForm.cs 프로젝트: JuRogn/OA
 private void workflowRuntime_WorkflowTerminated(Object sender, WorkflowTerminatedEventArgs e)
 {
     if (e.Exception != null)
     {
         MessageBox.Show(String.Format("Workflow {0}:\r\n\r\n{1}",
             e.WorkflowInstance.InstanceId, e.Exception));
     }
 }
예제 #2
0
 static void OnWorkflowTerminated(object sender, WorkflowTerminatedEventArgs e)
 {
     waitHandle.Set();
 }
예제 #3
0
 private void _runtime_WorkflowTerminated(object sender, WorkflowTerminatedEventArgs e)
 {
     LogStatus(e.WorkflowInstance.InstanceId, "WorkflowTerminated");
     //ManagedWorkflowInstance managedInstance = FindWorkflow(e.WorkflowInstance.InstanceId);
     //if (managedInstance != null)
     //{
     //    managedInstance.Exception = e.Exception;
     //    managedInstance.StopWaiting();
     //}
 }
예제 #4
0
 void WorkflowRuntime_WorkflowTerminated(object sender, WorkflowTerminatedEventArgs e)
 {
     Console.WriteLine("The workflow has terminated");
 }
예제 #5
0
 static void OnWorkflowTerminate(object sender, WorkflowTerminatedEventArgs instance)
 {
     Console.WriteLine("\nWorkflow Terminated event raised");
     waitHandle.Set();
 }
예제 #6
0
 static void Runtime_WorkflowTerminated(object sender, WorkflowTerminatedEventArgs e)
 {
     //CurrentResultsInContext =
     //    WorkflowResults.CreateTerminatedWorkflowResults(e);
 }
예제 #7
0
 private WorkflowResults(WorkflowTerminatedEventArgs args)
 {
     Check.ArgumentIsNotNull(args, "args");
     InstanceId = args.WorkflowInstance.InstanceId;
     Exception = args.Exception;
 }
예제 #8
0
 void wfRuntime_WorkflowTerminated(object sender, WorkflowTerminatedEventArgs e)
 {
     string v = string.Format("{0},{1},{2},{3}", e.WorkflowInstance.InstanceId.ToString(), "WorkflowTerminated", System.DateTime.Now.ToString(), e.Exception.Message);
     lsWFEvent.Add(v);
     this.Invoke(setSubmitEnabled);
 }
예제 #9
0
파일: Program.cs 프로젝트: ssickles/archive
 static void OnWorkflowTerminated(object sender, WorkflowTerminatedEventArgs e)
 {
     Console.WriteLine("Workflow Terminated");
     waitHandle.Set();
 }
예제 #10
0
 public static WorkflowResults CreateTerminatedWorkflowResults(WorkflowTerminatedEventArgs args)
 {
     WorkflowResults results = new WorkflowResults(args);
     results.Status = WorkflowStatus.Terminated;
     return results;
 }
예제 #11
0
        // This method is called when the workflow terminates and does not complete
        // It is good practice to include a handler for this event
        // so the host application can manage workflows that are
        // unexpectedly terminated (e.g. unhandled workflow exception).
        // waitHandle is set so the main thread can continue
        private void theWorkflowRuntime_WorkflowTerminated(object sender, WorkflowTerminatedEventArgs e)
        {
            WorkWikiItem workitem = WorkWikiItem.Load(e.WorkflowInstance.InstanceId);

            if (workitem != null)
            {
                workitem.Messages = e.Exception.Message;
                workitem.Save();
            }

            Trace.TraceWarning(string.Format("Workflow report: The instance {0} was unexpectdly terminated. Message: {1}",
                e.WorkflowInstance.InstanceId, e.Exception.Message));
        }
예제 #12
0
        static void WorkflowRuntime_WorkflowTerminated(object sender, WorkflowTerminatedEventArgs e)
        {
            Trace.WriteLine("WorkflowTerminated", "GlobalWorkflowRuntime");

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

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

            if (e.Exception is CustomWorkflowTerminateException)
            {
                wf.ExecutionResult = (int)((CustomWorkflowTerminateException)e.Exception).ExecutionResult;
                wf.ActualFinishDate = dateTimeNow;
                wf.State = (int)BusinessProcessState.Closed;
            }
            else
            {
                wf.State = (int)BusinessProcessState.Closed;
                wf.ActualFinishDate = dateTimeNow;
                wf.ExecutionResult = (int)BusinessProcessExecutionResult.Canceled; // Calculate Result
            }

            // TODO: Save Exception
            //e.Exception

            BusinessManager.Update(wf);

            // Cancel All Active Assignments
            CancelAllAssignments(wf);
        }
예제 #13
0
파일: Program.cs 프로젝트: ssickles/archive
 private static void OnWorkflowTerminated(object sender, WorkflowTerminatedEventArgs e)
 {
     Console.WriteLine("Workflow has been terminated. Message: {0}", e.Exception.Message);
     waitHandle.Set();
 }
예제 #14
0
 void Runtime_WorkflowTerminated(object sender, WorkflowTerminatedEventArgs e)
 {
     this.UpdateListItem(e.WorkflowInstance, "", "Terminated");
 }
예제 #15
0
        //public static event WorkflowsEvent Begin_workflowRuntime_WorkflowTerminated;
        //public static event WorkflowsEvent End_workflowRuntime_WorkflowTerminated;

        /// <summary>
        /// WorkflowTerminated事件的处理方法
        /// </summary>
        /// <param name="sender">事件发起对象</param>
        /// <param name="e">事件参数</param>
        private static void _workflowRuntime_WorkflowTerminated(object sender, WorkflowTerminatedEventArgs e)
        {
            //if (Begin_workflowRuntime_WorkflowTerminated != null)
            //    Begin_workflowRuntime_WorkflowTerminated(MethodBase.GetCurrentMethod(), new object[] { sender,e.WorkflowInstance.GetWorkflowDefinition().Name, e.WorkflowInstance.InstanceId,e.Exception });
            //MethodBase curMethod = MethodBase.GetCurrentMethod();
            try
            {
                //RollBackTransWhenTerminated();
                WorkflowRuntimeManagerMethodsBeginning(MethodWorkflowTerminated, new object[] { e.WorkflowInstance.InstanceId, e.Exception });
                BindCacheManager.RemoveByValue(e.WorkflowInstance.InstanceId.ToString());
                Session session = SessionManager.GetInstance.GetSessionByInstanceId(e.WorkflowInstance.InstanceId);
                if (session != null)
                {
                    if (e.Exception is FisException)
                    {
                        session.Exception = (FisException)e.Exception;
                    }
                    else if (e.Exception.InnerException is FisException)
                    {
                        session.Exception = (FisException)e.Exception.InnerException;
                    }
                    else
                    {
                        session.Exception = e.Exception;
                    }

                    //Console.WriteLine(String.Format("The workflow of session {0} terminated: {1}. ", SessionManager.GetInstance.GetSessionKeyByInstanceId(e.WorkflowInstance.InstanceId), session.Exception.Message));
                    //int waitingCount = session.GetHostWaitingCount;
                    //int wfWaitingCount = session.GetWFWaitingCount;
                    if (session.GetHostWaitingCount > 1 || session.GetWFWaitingCount > 0)
                    {
                        logger.WarnFormat(MsgWFTerminated,
                                                     session.Key,
                                                     session.Station ?? string.Empty,
                                                     session.Line ?? string.Empty,
                                                     session.Editor ?? string.Empty,
                                                     session.GetHostWaitingCount.ToString(),
                                                      session.GetWFWaitingCount.ToString(),
                                                     session.Exception.Message);
                    }
                    session.AddValue(Session.SessionKeys.WFTerminated, true);
                    //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();

                    //////Vincent 2014-07-10: Change to not terminate WF
                    ////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(MsgWFNoSessionTerminated,
                                                   e.WorkflowInstance.InstanceId, e.Exception.ToString());
                }
            }
            catch (Exception ex)
            {
                //Console.WriteLine(ex.ToString());
                logger.Error(MethodWorkflowTerminated, ex);
            }
            finally
            {
                #region trash
                //try
                //{
                    //System.Threading.Monitor.Exit(SessionManager.GetInstance.SynObject_getMRP)
                //}
                //catch (Exception ex)
                //{
                //}
                #endregion

                MakeSureTransactionDisposed();
                WorkflowRuntimeManagerMethodsEndding(MethodWorkflowTerminated, new object[] { e.WorkflowInstance.InstanceId });
                //if (End_workflowRuntime_WorkflowTerminated != null)
                //    End_workflowRuntime_WorkflowTerminated(MethodBase.GetCurrentMethod(), new object[] { sender, e.WorkflowInstance.GetWorkflowDefinition().Name, e.WorkflowInstance.InstanceId, e.Exception });
            }
        }
예제 #16
0
 static void OnWorkflowTerminated(object sender, WorkflowTerminatedEventArgs e)
 {
     Console.WriteLine(e.Exception.Message);
     waitHandle.Set();
 }
예제 #17
0
파일: MainForm.cs 프로젝트: SiTox/07-SK-K-B
 void workflowRuntime_WorkflowTerminated(object sender, WorkflowTerminatedEventArgs e)
 {
     Console.WriteLine("Workflow terminated {0}", e.Exception);
 }