/// <summary> /// 在每一个分支流程启动之前,刚刚准备好分支流程的参数 /// </summary> /// <param name="group"></param> /// <param name="branchParams"></param> internal void FirePrepareBranchProcessParams(IWfBranchProcessGroup group, WfBranchProcessStartupParamsCollection branchParams) { if (this.PrepareBranchProcessParams != null) { this.PrepareBranchProcessParams(group, branchParams); } }
public void BranchProcessPersistTest() { IWfProcess process = WfProcessTestCommon.StartupSimpleProcessWithAssignee(); WfTransferParams tp = ProcessTestHelper.GetInstanceOfWfTransferParams(process, WfBranchProcessExecuteSequence.Parallel, WfBranchProcessBlockingType.WaitAllBranchProcessesComplete); process.MoveTo(tp); Assert.AreEqual(1, process.CurrentActivity.BranchProcessGroups.Count); IWfBranchProcessGroup group = process.CurrentActivity.BranchProcessGroups[0]; AssertBranchProcessesInfo(group, tp.BranchTransferParams[0].Template.BranchProcessKey); WfRuntime.PersistWorkflows(); process = WfRuntime.GetProcessByProcessID(process.ID); group = process.CurrentActivity.BranchProcessGroups[0]; AssertBranchProcessesInfo(group, tp.BranchTransferParams[0].Template.BranchProcessKey); string subProcessID = process.CurrentActivity.BranchProcessGroups[0].Branches[0].ID; WfRuntime.ClearCache(); //构造子流程,反向查找主流程信息 IWfProcess subProcess = WfRuntime.GetProcessByProcessID(subProcessID); AssertBranchProcessesInfo(subProcess.EntryInfo.OwnerActivity.BranchProcessGroups[0], tp.BranchTransferParams[0].Template.BranchProcessKey); }
/// <summary> /// 内部启动分支流程 /// </summary> /// <param name="branchTransferParams">分支流程启动参数</param> /// <param name="addToOwnerBranches"></param> /// <returns></returns> internal WfProcessCollection InternalStartupBranchProcesses(WfBranchProcessTransferParams branchTransferParams, bool addToOwnerBranches) { WfProcessCollection processes = null; if (CanStartBranchProcessFromTemplate(branchTransferParams.Template)) { IWfBranchProcessGroup group = this.BranchProcessGroups[branchTransferParams.Template.Key]; //以模版Key为分支流程实例的分组标准 if (group == null) { group = new WfBranchProcessGroup(this, branchTransferParams.Template); this.BranchProcessGroups.Add(group); } WfRuntime.ProcessContext.FirePrepareBranchProcessParams(group, branchTransferParams.BranchParams); ProcessProgress.Current.MaxStep += branchTransferParams.BranchParams.Count; ProcessProgress.Current.Response(); //根据模板内的分支流程参数,逐一启动具体流程 for (int i = 0; i < branchTransferParams.BranchParams.Count; i++) { //processes = StartupBranchProcess(branchTransferParams, group, group.BranchProcessStatistics.MaxSequence++); processes = StartupBranchProcess(branchTransferParams, group, i); processes.ForEach(p => { if (addToOwnerBranches) { if (group.Branches.Contains(p) == false) { group.Branches.Add(p); } } WfRuntime.ProcessContext.FireAfterStartupBranchProcess(p); }); ProcessProgress.Current.MaxStep = Math.Max(ProcessProgress.Current.MaxStep, ProcessProgress.Current.CurrentStep + processes.Count); ProcessProgress.Current.IncrementBy(processes.Count); ProcessProgress.Current.Response(); } WfRuntime.ProcessContext.AffectedProcesses.AddOrReplace(this.Process); } if (processes == null) { processes = new WfProcessCollection(); } return(processes); }
private static void AssertBranchProcessesInfo(IWfBranchProcessGroup group, string expectedProcessKey) { Assert.AreEqual(group.OwnerActivity, group.Branches[0].EntryInfo.OwnerActivity); Assert.AreEqual(group.OwnerActivity, group.Branches[1].EntryInfo.OwnerActivity); Assert.AreEqual(expectedProcessKey, group.ProcessTemplate.BranchProcessKey); Assert.AreEqual(2, group.Branches.Count); Assert.AreEqual(expectedProcessKey, group.Branches[0].Descriptor.Key); Assert.AreEqual(expectedProcessKey, group.Branches[1].Descriptor.Key); Assert.AreEqual(WfProcessStatus.Running, group.Branches[0].Status); Assert.AreEqual(WfProcessStatus.Running, group.Branches[1].Status); //以下的断言二次执行会出错,因为再次加载的时候其分支流程会存在顺序关系 Assert.AreEqual(OguObjectSettings.GetConfig().Objects["approver1"].Object.ID, group.Branches[0].InitialActivity.Assignees[0].User.ID); Assert.AreEqual(OguObjectSettings.GetConfig().Objects["approver2"].Object.ID, group.Branches[1].InitialActivity.Assignees[0].User.ID); }
public void BranchProcessStartTest() { IWfProcess process = WfProcessTestCommon.StartupSimpleProcessWithAssignee(); WfTransferParams tp = ProcessTestHelper.GetInstanceOfWfTransferParams(process, WfBranchProcessExecuteSequence.Parallel, WfBranchProcessBlockingType.WaitAllBranchProcessesComplete); process.MoveTo(tp); Assert.AreEqual(1, process.CurrentActivity.BranchProcessGroups.Count); IWfBranchProcessGroup group = process.CurrentActivity.BranchProcessGroups[0]; Assert.AreEqual(tp.BranchTransferParams[0].Template.BranchProcessKey, group.ProcessTemplate.BranchProcessKey); Assert.AreEqual(2, group.Branches.Count); Assert.AreEqual(tp.BranchTransferParams[0].Template.BranchProcessKey, group.Branches[0].Descriptor.Key); Assert.AreEqual(tp.BranchTransferParams[0].Template.BranchProcessKey, group.Branches[1].Descriptor.Key); Assert.AreEqual(WfProcessStatus.Running, group.Branches[0].Status); Assert.AreEqual(WfProcessStatus.Running, group.Branches[1].Status); Assert.AreEqual(OguObjectSettings.GetConfig().Objects["approver1"].Object.ID, group.Branches[0].InitialActivity.Assignees[0].User.ID); Assert.AreEqual(OguObjectSettings.GetConfig().Objects["approver2"].Object.ID, group.Branches[1].InitialActivity.Assignees[0].User.ID); }
public void BranchProcessUserTasksTest() { //启支流程及其子流程 IWfProcess process = WfProcessTestCommon.StartupSimpleProcessWithAssignee(); WfTransferParams tp = ProcessTestHelper.GetInstanceOfWfTransferParams(process, WfBranchProcessExecuteSequence.Parallel, WfBranchProcessBlockingType.WaitAllBranchProcessesComplete); process.MoveTo(tp); WfRuntime.PersistWorkflows(); process = WfRuntime.GetProcessByProcessID(process.ID); IWfBranchProcessGroup group = process.CurrentActivity.BranchProcessGroups[0]; AssertBranchProcessesInfo(group, tp.BranchTransferParams[0].Template.BranchProcessKey); UserTaskCollection currentActTasks = UserTaskAdapter.Instance.LoadUserTasks(builder => { builder.LogicOperator = Data.Builder.LogicOperatorDefine.Or; foreach (IWfProcess subProcess in group.Branches) { builder.AppendItem("ACTIVITY_ID", subProcess.CurrentActivity.ID); } }); foreach (IWfProcess subProcess in group.Branches) { bool containsTask = false; group.Branches.ForEach(p => { containsTask = currentActTasks.Exists(u => u.ActivityID == p.CurrentActivity.ID); Assert.IsTrue(containsTask); }); } }
/// <summary> /// 在每一个分支流程启动之前,刚刚准备好分支流程的参数 /// </summary> /// <param name="group"></param> /// <param name="branchParams"></param> internal void FirePrepareBranchProcessParams(IWfBranchProcessGroup group, WfBranchProcessStartupParamsCollection branchParams) { if (this.PrepareBranchProcessParams != null) this.PrepareBranchProcessParams(group, branchParams); }
private WfServiceStartupProcessParams PrepareOneServiceStartupProcessParams(WfBranchProcessTransferParams branchParams, IWfBranchProcessGroup group, int index) { IWfBranchProcessTemplateDescriptor template = branchParams.Template; WfBranchProcessStartupParams branchStartupParams = branchParams.BranchParams[index]; WfServiceStartupProcessParams startupParams = new WfServiceStartupProcessParams(); startupParams.Creator = this.Process.Creator; if (branchStartupParams.Department == null) { startupParams.Department = this.Process.OwnerDepartment; } else { startupParams.Department = branchStartupParams.Department; } startupParams.Assignees = branchStartupParams.Assignees.ToUsers(); if (branchStartupParams.DefaultTaskTitle.IsNullOrEmpty()) { if (startupParams.DefaultTaskTitle.IsNullOrEmpty()) { startupParams.DefaultTaskTitle = this.Process.Descriptor.DefaultTaskTitle; } else { startupParams.DefaultTaskTitle = this.Descriptor.TaskTitle; } } else { startupParams.DefaultTaskTitle = branchStartupParams.DefaultTaskTitle; } if (branchStartupParams.ResourceID.IsNullOrEmpty()) { WfSubProcessResourceMode mode = template.Properties.GetValue("CreateResourceMode", WfSubProcessResourceMode.DependsOnProcess); switch (mode) { //这里的规则是什么? case WfSubProcessResourceMode.DependsOnProcess: startupParams.ResourceID = this.Process.ResourceID; break; case WfSubProcessResourceMode.SameWithRoot: startupParams.ResourceID = this.Process.ResourceID; break; case WfSubProcessResourceMode.NewCreate: startupParams.ResourceID = UuidHelper.NewUuidString(); break; } } else { startupParams.ResourceID = branchStartupParams.ResourceID; } startupParams.OwnerActivityID = this.ID; startupParams.OwnerTemplateKey = template.Key; startupParams.Sequence = index; startupParams.RelativeParams = new Dictionary <object, object>(); foreach (var strpar in branchStartupParams.RelativeParams.AllKeys) { startupParams.RelativeParams.Add(strpar, this.Process.ApplicationRuntimeParameters[branchStartupParams.RelativeParams[strpar]]); } if (!string.IsNullOrEmpty(template.DefaultUrl)) { startupParams.DefaultURL = template.DefaultUrl; } else if (!string.IsNullOrEmpty(this.Descriptor.Url)) { startupParams.DefaultURL = this.Descriptor.Url; } else { startupParams.DefaultURL = this.Process.Descriptor.Url; } //如果是串行执行,且不是第一个流程,则不启动第一个活动,子流程处于未启动状态 if (template.ExecuteSequence == WfBranchProcessExecuteSequence.Serial && index > 0) { startupParams.AutoStartInitialActivity = false; } return(startupParams); }
private WfProcessStartupParams PrepareOneBranchProcessStartupParams(WfBranchProcessTransferParams branchTransferParams, IWfBranchProcessGroup group, int index) { IWfBranchProcessTemplateDescriptor template = branchTransferParams.Template; WfBranchProcessStartupParams branchStartupParams = branchTransferParams.BranchParams[index]; //准备启动子流程的参数 //先检查有没有预定义好的分支流程 IWfProcessDescriptor subProcessDesp = null; using (WfApplicationParametersContext apContext = WfApplicationParametersContext.CreateContext(branchStartupParams.ApplicationRuntimeParameters)) { subProcessDesp = template.GetBranchProcessDescriptor(); } if (template.DefaultProcessName.IsNotEmpty()) { string runtimeProcessName = this.Process.ApplicationRuntimeParameters.GetMatchedString(template.DefaultProcessName); if (runtimeProcessName.IsNullOrEmpty()) { runtimeProcessName = template.DefaultProcessName; } if (runtimeProcessName.IsNullOrEmpty()) { ((WfProcessDescriptor)subProcessDesp).Name = runtimeProcessName; } if (subProcessDesp.InitialActivity != null && subProcessDesp.InitialActivity.Name.IsNullOrEmpty()) { ((WfActivityDescriptor)subProcessDesp.InitialActivity).Name = runtimeProcessName; } } if (template.DefaultTaskTitle.IsNotEmpty()) { subProcessDesp.DefaultTaskTitle = template.DefaultTaskTitle; } if (template.DefaultUrl.IsNotEmpty()) { subProcessDesp.Url = template.DefaultUrl; } if (subProcessDesp.Url.IsNullOrEmpty()) { subProcessDesp.Url = this.Descriptor.Url.IsNotEmpty() ? this.Descriptor.Url : this.Descriptor.Process.Url; } WfProcessStartupParams startupParams = new WfProcessStartupParams(); startupParams.Creator = this.Operator; if (branchStartupParams.Department == null) { startupParams.Department = this.Process.OwnerDepartment; } else { startupParams.Department = branchStartupParams.Department; } startupParams.Assignees.CopyFrom(branchStartupParams.Assignees); startupParams.ProcessDescriptor = subProcessDesp; if (branchStartupParams.DefaultTaskTitle.IsNullOrEmpty()) { if (startupParams.DefaultTaskTitle.IsNullOrEmpty()) { if (subProcessDesp.DefaultTaskTitle.IsNotEmpty()) { startupParams.DefaultTaskTitle = subProcessDesp.DefaultTaskTitle; } else { startupParams.DefaultTaskTitle = this.Process.Descriptor.DefaultTaskTitle; } } else { startupParams.DefaultTaskTitle = this.Descriptor.TaskTitle; } } else { startupParams.DefaultTaskTitle = branchStartupParams.DefaultTaskTitle; } if (branchStartupParams.ResourceID.IsNullOrEmpty()) { WfSubProcessResourceMode mode = template.Properties.GetValue("CreateResourceMode", WfSubProcessResourceMode.DependsOnProcess); switch (mode) { case WfSubProcessResourceMode.DependsOnProcess: if (subProcessDesp.Properties.GetValue("Independent", false)) { startupParams.ResourceID = UuidHelper.NewUuidString(); } else { startupParams.ResourceID = this.Process.ResourceID; } break; case WfSubProcessResourceMode.SameWithRoot: startupParams.ResourceID = this.Process.ResourceID; break; case WfSubProcessResourceMode.NewCreate: startupParams.ResourceID = UuidHelper.NewUuidString(); break; } } else { startupParams.ResourceID = branchStartupParams.ResourceID; } if (branchStartupParams.RelativeParams.Count == 0) { startupParams.RelativeParams.CopyFrom(this.Process.RelativeParams); } else { startupParams.RelativeParams.CopyFrom(branchStartupParams.RelativeParams); } startupParams.BranchStartupParams = branchStartupParams; startupParams.Group = group; startupParams.OwnerActivityID = this.ID; startupParams.OwnerTemplateKey = template.Key; startupParams.Sequence = index; startupParams.AutoCommit = this.Process.Committed; //子流程的提交属性默认等于主流程的 branchStartupParams.ApplicationRuntimeParameters.ForEach(kp => startupParams.ApplicationRuntimeParameters.Add(kp.Key, kp.Value)); //如果是串行执行,且不是第一个流程,则不启动第一个活动,子流程处于未启动状态 if (template.ExecuteSequence == WfBranchProcessExecuteSequence.Serial && index > 0) { startupParams.AutoStartInitialActivity = false; } return(startupParams); }
/// <summary> /// 启动一个模版(组)下的一组分支流程,在服务模式下,可能返回多个流程。其它情况返回单个流程 /// </summary> /// <param name="branchTransferParams"></param> /// <param name="group"></param> /// <param name="index"></param> /// <returns></returns> private WfProcessCollection StartupBranchProcess(WfBranchProcessTransferParams branchTransferParams, IWfBranchProcessGroup group, int index) { WfProcessCollection processes = null; if (branchTransferParams.Template.OperationDefinition == null) { WfProcessStartupParams startupParams = PrepareOneBranchProcessStartupParams(branchTransferParams, group, index); startupParams.CheckStartProcessUserPermission = false; processes = new WfProcessCollection(); processes.Add(WfRuntime.StartWorkflow(startupParams)); } else { if (WfRuntime.ProcessContext.EnableServiceCall) { WfServiceStartupProcessParams startupParams = PrepareOneServiceStartupProcessParams(branchTransferParams, group, index); processes = InvokeBranchProcess(startupParams, branchTransferParams.Template); } else processes = new WfProcessCollection(); } return processes; }
/// <summary> /// 执行group中下一个需要顺序执行的流程 /// </summary> /// <param name="group"></param> private static void ExecuteNextSerialProcess(IWfBranchProcessGroup group) { if (group != null && group.ProcessTemplate.ExecuteSequence == WfBranchProcessExecuteSequence.Serial) { IWfProcess process = group.Branches.Find(p => p.Status == WfProcessStatus.NotRunning); if (process != null && process.BranchStartupParams != null) { WfTransferParams transferParams = new WfTransferParams(process.Descriptor.InitialActivity); transferParams.Assignees.CopyFrom(process.BranchStartupParams.Assignees); process.MoveTo(transferParams); } } }
private WfServiceStartupProcessParams PrepareOneServiceStartupProcessParams(WfBranchProcessTransferParams branchParams, IWfBranchProcessGroup group, int index) { IWfBranchProcessTemplateDescriptor template = branchParams.Template; WfBranchProcessStartupParams branchStartupParams = branchParams.BranchParams[index]; WfServiceStartupProcessParams startupParams = new WfServiceStartupProcessParams(); startupParams.Creator = this.Process.Creator; if (branchStartupParams.Department == null) startupParams.Department = this.Process.OwnerDepartment; else startupParams.Department = branchStartupParams.Department; startupParams.Assignees = branchStartupParams.Assignees.ToUsers(); if (branchStartupParams.DefaultTaskTitle.IsNullOrEmpty()) { if (startupParams.DefaultTaskTitle.IsNullOrEmpty()) startupParams.DefaultTaskTitle = this.Process.Descriptor.DefaultTaskTitle; else startupParams.DefaultTaskTitle = this.Descriptor.TaskTitle; } else startupParams.DefaultTaskTitle = branchStartupParams.DefaultTaskTitle; if (branchStartupParams.ResourceID.IsNullOrEmpty()) { WfSubProcessResourceMode mode = template.Properties.GetValue("CreateResourceMode", WfSubProcessResourceMode.DependsOnProcess); switch (mode) { //这里的规则是什么? case WfSubProcessResourceMode.DependsOnProcess: startupParams.ResourceID = this.Process.ResourceID; break; case WfSubProcessResourceMode.SameWithRoot: startupParams.ResourceID = this.Process.ResourceID; break; case WfSubProcessResourceMode.NewCreate: startupParams.ResourceID = UuidHelper.NewUuidString(); break; } } else startupParams.ResourceID = branchStartupParams.ResourceID; startupParams.OwnerActivityID = this.ID; startupParams.OwnerTemplateKey = template.Key; startupParams.Sequence = index; startupParams.RelativeParams = new Dictionary<object, object>(); foreach (var strpar in branchStartupParams.RelativeParams.AllKeys) { startupParams.RelativeParams.Add(strpar, this.Process.ApplicationRuntimeParameters[branchStartupParams.RelativeParams[strpar]]); } if (!string.IsNullOrEmpty(template.DefaultUrl)) startupParams.DefaultURL = template.DefaultUrl; else if (!string.IsNullOrEmpty(this.Descriptor.Url)) startupParams.DefaultURL = this.Descriptor.Url; else startupParams.DefaultURL = this.Process.Descriptor.Url; //如果是串行执行,且不是第一个流程,则不启动第一个活动,子流程处于未启动状态 if (template.ExecuteSequence == WfBranchProcessExecuteSequence.Serial && index > 0) startupParams.AutoStartInitialActivity = false; return startupParams; }
private WfProcessStartupParams PrepareOneBranchProcessStartupParams(WfBranchProcessTransferParams branchTransferParams, IWfBranchProcessGroup group, int index) { IWfBranchProcessTemplateDescriptor template = branchTransferParams.Template; WfBranchProcessStartupParams branchStartupParams = branchTransferParams.BranchParams[index]; //准备启动子流程的参数 //先检查有没有预定义好的分支流程 IWfProcessDescriptor subProcessDesp = null; using (WfApplicationParametersContext apContext = WfApplicationParametersContext.CreateContext(branchStartupParams.ApplicationRuntimeParameters)) { subProcessDesp = template.GetBranchProcessDescriptor(); } if (template.DefaultProcessName.IsNotEmpty()) { string runtimeProcessName = this.Process.ApplicationRuntimeParameters.GetMatchedString(template.DefaultProcessName); if (runtimeProcessName.IsNullOrEmpty()) runtimeProcessName = template.DefaultProcessName; if (runtimeProcessName.IsNullOrEmpty()) ((WfProcessDescriptor)subProcessDesp).Name = runtimeProcessName; if (subProcessDesp.InitialActivity != null && subProcessDesp.InitialActivity.Name.IsNullOrEmpty()) ((WfActivityDescriptor)subProcessDesp.InitialActivity).Name = runtimeProcessName; } if (template.DefaultTaskTitle.IsNotEmpty()) subProcessDesp.DefaultTaskTitle = template.DefaultTaskTitle; if (template.DefaultUrl.IsNotEmpty()) subProcessDesp.Url = template.DefaultUrl; if (subProcessDesp.Url.IsNullOrEmpty()) subProcessDesp.Url = this.Descriptor.Url.IsNotEmpty() ? this.Descriptor.Url : this.Descriptor.Process.Url; WfProcessStartupParams startupParams = new WfProcessStartupParams(); startupParams.Creator = this.Operator; if (branchStartupParams.Department == null) startupParams.Department = this.Process.OwnerDepartment; else startupParams.Department = branchStartupParams.Department; startupParams.Assignees.CopyFrom(branchStartupParams.Assignees); startupParams.ProcessDescriptor = subProcessDesp; if (branchStartupParams.DefaultTaskTitle.IsNullOrEmpty()) { if (startupParams.DefaultTaskTitle.IsNullOrEmpty()) { if (subProcessDesp.DefaultTaskTitle.IsNotEmpty()) startupParams.DefaultTaskTitle = subProcessDesp.DefaultTaskTitle; else startupParams.DefaultTaskTitle = this.Process.Descriptor.DefaultTaskTitle; } else startupParams.DefaultTaskTitle = this.Descriptor.TaskTitle; } else startupParams.DefaultTaskTitle = branchStartupParams.DefaultTaskTitle; if (branchStartupParams.ResourceID.IsNullOrEmpty()) { WfSubProcessResourceMode mode = template.Properties.GetValue("CreateResourceMode", WfSubProcessResourceMode.DependsOnProcess); switch (mode) { case WfSubProcessResourceMode.DependsOnProcess: if (subProcessDesp.Properties.GetValue("Independent", false)) startupParams.ResourceID = UuidHelper.NewUuidString(); else startupParams.ResourceID = this.Process.ResourceID; break; case WfSubProcessResourceMode.SameWithRoot: startupParams.ResourceID = this.Process.ResourceID; break; case WfSubProcessResourceMode.NewCreate: startupParams.ResourceID = UuidHelper.NewUuidString(); break; } } else startupParams.ResourceID = branchStartupParams.ResourceID; if (branchStartupParams.RelativeParams.Count == 0) startupParams.RelativeParams.CopyFrom(this.Process.RelativeParams); else startupParams.RelativeParams.CopyFrom(branchStartupParams.RelativeParams); startupParams.BranchStartupParams = branchStartupParams; startupParams.Group = group; startupParams.OwnerActivityID = this.ID; startupParams.OwnerTemplateKey = template.Key; startupParams.Sequence = index; startupParams.AutoCommit = this.Process.Committed; //子流程的提交属性默认等于主流程的 branchStartupParams.ApplicationRuntimeParameters.ForEach(kp => startupParams.ApplicationRuntimeParameters.Add(kp.Key, kp.Value)); //如果是串行执行,且不是第一个流程,则不启动第一个活动,子流程处于未启动状态 if (template.ExecuteSequence == WfBranchProcessExecuteSequence.Serial && index > 0) startupParams.AutoStartInitialActivity = false; return startupParams; }
void ProcessContext_PrepareBranchProcessParams(IWfBranchProcessGroup group, WfBranchProcessStartupParamsCollection branchParams) { }
/// <summary> /// 启动一个模版(组)下的一组分支流程,在服务模式下,可能返回多个流程。其它情况返回单个流程 /// </summary> /// <param name="branchTransferParams"></param> /// <param name="group"></param> /// <param name="index"></param> /// <returns></returns> private WfProcessCollection StartupBranchProcess(WfBranchProcessTransferParams branchTransferParams, IWfBranchProcessGroup group, int index) { WfProcessCollection processes = null; if (branchTransferParams.Template.OperationDefinition == null) { WfProcessStartupParams startupParams = PrepareOneBranchProcessStartupParams(branchTransferParams, group, index); startupParams.CheckStartProcessUserPermission = false; processes = new WfProcessCollection(); processes.Add(WfRuntime.StartWorkflow(startupParams)); } else { if (WfRuntime.ProcessContext.EnableServiceCall) { WfServiceStartupProcessParams startupParams = PrepareOneServiceStartupProcessParams(branchTransferParams, group, index); processes = InvokeBranchProcess(startupParams, branchTransferParams.Template); } else { processes = new WfProcessCollection(); } } return(processes); }
private static WfProcessCollection LoadBranches(string ownerActID, string templateKey, IWfBranchProcessGroup group) { WfProcessCollection branches = WfRuntime.GetProcessByOwnerActivityID(ownerActID, templateKey); foreach (WfProcess process in branches) { process.EntryInfo = group; } branches.Sort((p1, p2) => p1.Sequence - p2.Sequence); return(branches); }