public static void StartWorkflow(int workflowId) { WexflowEngine.StartWorkflow(workflowId); // Wait until the workflow finishes var workflow = WexflowEngine.GetWorkflow(workflowId); var isRunning = workflow.IsRunning; while (isRunning) { Thread.Sleep(100); workflow = WexflowEngine.GetWorkflow(workflowId); isRunning = workflow.IsRunning; } }
public static void StartWorkflow(int workflowId) { WexflowEngine.StartWorkflow(workflowId); // Wait until the workflow finishes Thread.Sleep(1000); var workflow = WexflowEngine.GetWorkflow(workflowId); var isRunning = workflow.IsRunning; var isWaitingForApproval = workflow.IsWaitingForApproval; while (isRunning && !isWaitingForApproval) { Thread.Sleep(100); workflow = WexflowEngine.GetWorkflow(workflowId); isRunning = workflow.IsRunning; isWaitingForApproval = workflow.IsWaitingForApproval; } }
public static System.Guid StartWorkflow(int workflowId) { var instanceId = WexflowEngine.StartWorkflow(WexflowEngine.SuperAdminUsername, workflowId); // Wait until the workflow finishes Thread.Sleep(1000); var workflow = WexflowEngine.GetWorkflow(workflowId); var isRunning = workflow.IsRunning; var isWaitingForApproval = workflow.IsWaitingForApproval; while (isRunning && !isWaitingForApproval) { Thread.Sleep(100); workflow = WexflowEngine.GetWorkflow(workflowId); isRunning = workflow.IsRunning; isWaitingForApproval = workflow.IsWaitingForApproval; } return(instanceId); }
public override void Session() { base.Session(); foreach (WeWatch ww in wfperiods) { if (ww.CalcWatch()) { Workflow wf = we.GetWorkflow(ww.ID); if (!wf.IsRunning) { wf.Start(); } } } Thread.Sleep(100); //Workflow wf = we.GetWorkflow (41); //WriteToLog(we.Workflows.Length.ToString()); }