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); }
public void Run(IList <IWorkflowChoice> userChoice = null) { Validate(); var context = GetWorkflowContext(); if (userChoice != null) { context.UserChoice = userChoice; } CurrentWorkflow.Run(context); }
public void DeleteWorkflow() { Validate(); using (var tran = new TransactionScope()) { FlowInstance.DeleteWorkItem(); CurrentWorkflow.DeleteInstance(FlowInstance); tran.Complete(); } Log("删除了流程实例(包括相关联的工作项及流程参数)"); }
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(); } }