Ejemplo n.º 1
0
 public void UpdateInstance(string procName, string dataLocator, int impoLevel, int secret)
 {
     Validate();
     FlowInstance.InstanceName   = procName;
     FlowInstance.DataLocator    = dataLocator;
     FlowInstance.ImportantLevel = impoLevel;
     FlowInstance.SecretLevel    = secret;
     CurrentWorkflow.UpdateInstance(FlowInstance);
 }
Ejemplo n.º 2
0
        public void Run(IList <IWorkflowChoice> userChoice = null)
        {
            Validate();
            var context = GetWorkflowContext();

            if (userChoice != null)
            {
                context.UserChoice = userChoice;
            }
            CurrentWorkflow.Run(context);
        }
Ejemplo n.º 3
0
        public void DeleteWorkflow()
        {
            Validate();

            using (var tran = new TransactionScope())
            {
                FlowInstance.DeleteWorkItem();
                CurrentWorkflow.DeleteInstance(FlowInstance);
                tran.Complete();
            }
            Log("删除了流程实例(包括相关联的工作项及流程参数)");
        }
Ejemplo n.º 4
0
 public void StartWorkflow(string appCode, string procName, string dataLocator, int impoLevel = 0, int secret = 0)
 {
     CurrentWorkflow = Build(appCode);
     FlowInstance    = GetNewInstance(appCode, procName, dataLocator, impoLevel, secret);
     using (TransactionScope tran = new TransactionScope())
     {
         CurrentWorkflow.AddInstance(FlowInstance);
         CurrentItem = GetNewWorkItem(CurrentWorkflow.Root, CurrentUser, appCode, FlowInstance.Id);
         FlowInstance.InsertWorkItem(CurrentItem);
         CurrentActivity = CurrentWorkflow.Root;
         tran.Complete();
     }
 }