Example #1
0
 public void AddChild(object obj)
 {
     Workflow wf = (Workflow)obj;
     if (_firstWorkflow == null)
         _firstWorkflow = wf;
     wf.BusinessProcess = this;
     _workflows.Add(wf.Name, wf);
 }
Example #2
0
        public void TerminateWorkflow(IApplicationContext ctx, Workflow wf, bool rollback = false)
        {
            if (rollback)
                ctx.DAL.CancelChanges();
            else
                ctx.DAL.SaveChanges();

            Workflow lastWorkflow = _workflowStack.Pop();
            lastWorkflow.Stop(ctx);

            if (_workflowStack.Count == 0)
                throw new Exception("Application terminated");
            else
            {
                Workflow.Start(ctx, rollback);
            }
        }