public Statements.WorkflowActivity Parse(string key, string workflowDefinition, IEnumerable <ActivitySetting> activitySettings) { var settings = GetActivitySettings(); var flow = new Statements.WorkflowActivity(); var v1 = new Variable <string>("v1"); flow.Variables.Add(v1); var third = WorkflowBuilder.CreateServer(settings.ElementAt(2), "节点3", "'1'", null, v1, flow.CustomActivityResult, null, null); var second = WorkflowBuilder.CreateSubProcess(settings.ElementAt(1) , "子流程-节点2" , new Dictionary <string, string>() { { "error", this._finishRule } } , null, null , third); SequenceWorkflowParser.Second = second.Action as SubProcess; flow.Body.StartNode = WorkflowBuilder.CreateHuman(settings.ElementAt(0) , "节点1" , new GetUsers(this._actionerRule) , flow.CustomActivityResult , null , second); SequenceWorkflowParser.First = (flow.Body.StartNode as FlowStep).Action as Human; return(flow); }
public Statements.WorkflowActivity Parse(string key, string workflowDefinition, IEnumerable <ActivitySetting> activitySettings) { var settings = GetActivitySettings(); var flow = new Statements.WorkflowActivity(); ParallelWorkflowParser.Human = WorkflowBuilder.CreateHuman(settings.ElementAt(1) , "并行子节点1" , new GetUsers(this._actionerRule) , null); ParallelWorkflowParser.SubProcess = WorkflowBuilder.CreateSubProcess(settings.ElementAt(2) , "并行子节点2" , new Dictionary <string, string>() { { "error", this._finishRule } } , null); flow.Body.StartNode = WorkflowBuilder.CreateParallel(settings.ElementAt(0) , "并行节点" , this._completion , null , ParallelWorkflowParser.Human , ParallelWorkflowParser.SubProcess); Parallel = (flow.Body.StartNode as FlowStep).Action as Parallel; return(flow); }
public virtual Statements.WorkflowActivity Parse(string key, string workflowDefinition, IEnumerable<ActivitySetting> activitySettings) { //是否是子流程测试模式 var isSubMode = key.Contains(BaseTest.SubFlag); var settings = isSubMode ? GetSubProcessActivitySettings() : GetActivitySettings(); var flow = new Statements.WorkflowActivity(); var v1 = new Variable<string>("v1"); flow.Variables.Add(v1); //0 节点1 同意|否决 //2 节点2 完成 startRule 10s //4 节点3 完成 OneAtOnce slot=2 发起人->主管->username1 //6 节点4 Server //8 并行节点 子节点1完成则完成 //8 并行子节点1 发起人 startRule 无限期延迟 需要提前唤醒 //8 并行子节点2 主管 //9 节点6 完成 AllAtOnce slot=2 发起人 同意|否决 //11 节点7 完成 AllAtOnce slot=1 发起人|主管 同意|否决 //根据参数追加一个子流程节点 //13 节点8 子流程节点 var eighth = isSubMode ? WorkflowBuilder.CreateSubProcess(settings.ElementAt(9), BaseTest.SubProcessNode, null, null, null, null) : null; var seventh = WorkflowBuilder.CreateHuman(settings.ElementAt(8) , "节点7" , new GetUsers("originator", "getSuperior()") , flow.CustomActivityResult , null , isSubMode ? eighth : null); var sixth = WorkflowBuilder.CreateHuman(settings.ElementAt(7) , "节点6" , new GetUsers("originator") , flow.CustomActivityResult , null , seventh); var parallel_1 = WorkflowBuilder.CreateHuman(settings.ElementAt(5), "并行子节点1", new GetUsers("originator"), null); var parallel_2 = WorkflowBuilder.CreateHuman(settings.ElementAt(6), "并行子节点2", new GetUsers("getSuperior()"), null); //true var parallel = WorkflowBuilder.CreateParallel(settings.ElementAt(4), "并行节点", "true", sixth, parallel_1, parallel_2); var forth = WorkflowBuilder.CreateServer(settings.ElementAt(3) , "节点4", "'1'", null, v1, flow.CustomActivityResult, null, parallel); var third = WorkflowBuilder.CreateHuman(settings.ElementAt(2) , "节点3" , new GetUsers("originator", "getSuperior()", BaseTest.VariableUser) , flow.CustomActivityResult , null , forth); var second = WorkflowBuilder.CreateHuman(settings.ElementAt(1) , "节点2" , new GetUsers("originator") , flow.CustomActivityResult , null , third); flow.Body.StartNode = WorkflowBuilder.CreateHuman(settings.ElementAt(0) , "节点1" , new GetUsers("originator") , flow.CustomActivityResult , new Dictionary<string, FlowNode>() { { "同意", second } } , null); //有需要可在此初始化元数据 //Taobao.Activities.ActivityUtilities.InitializeActivity(flow); return flow; }
public Statements.WorkflowActivity Parse(string key, string workflowDefinition, IEnumerable<ActivitySetting> activitySettings) { var settings = GetActivitySettings(); var flow = new Statements.WorkflowActivity(); var v1 = new Variable<string>("v1"); flow.Variables.Add(v1); var third = WorkflowBuilder.CreateServer(settings.ElementAt(2), "节点3", "'1'", null, v1, flow.CustomActivityResult, null, null); var second = WorkflowBuilder.CreateSubProcess(settings.ElementAt(1) , "子流程-节点2" , new Dictionary<string, string>() { { "error", this._finishRule } } , null, null , third); SequenceWorkflowParser.Second = second.Action as SubProcess; flow.Body.StartNode = WorkflowBuilder.CreateHuman(settings.ElementAt(0) , "节点1" , new GetUsers(this._actionerRule) , flow.CustomActivityResult , null , second); SequenceWorkflowParser.First = (flow.Body.StartNode as FlowStep).Action as Human; return flow; }
public WorkflowActivity Parse(string key, string workflowDefinition, IEnumerable <ActivitySetting> activitySettings) { //本测试工程的大部分测试均基于此工作流定义,需谨慎变更 禁止修改 var flow = new Statements.WorkflowActivity(); IEnumerable <ActivitySetting> settings; if (key.IndexOf("SubProcess") >= 0) { //0 节点1 同意|否决 //1 节点2 完成 //2 节点3 完成 settings = GetSubProcessActivitySettings(); var third = WorkflowBuilder.CreateServer(settings.ElementAt(2) , "节点3" , "'1'" , null , null , flow.CustomActivityResult , null , null); var second = WorkflowBuilder.CreateHuman(settings.ElementAt(1) , "节点2" , new GetUsers("originator") , flow.CustomActivityResult , new Dictionary <string, FlowNode>() { { "同意", third } } , null); flow.Body.StartNode = WorkflowBuilder.CreateHuman(settings.ElementAt(0) , "节点1" , new GetUsers("originator") , flow.CustomActivityResult , new Dictionary <string, FlowNode>() { { "同意", second } } , null); } else if (key.IndexOf("ParentProcess") >= 0) { //0 节点1 同意|否决 //1 节点2 完成 //2 节点3 完成 //3 节点4 完成 settings = GetParentProcessActivitySettings(); var forth = WorkflowBuilder.CreateServer(settings.ElementAt(3) , "节点4" , "'1'" , null , null , flow.CustomActivityResult , null , null); var third = WorkflowBuilder.CreateHuman(settings.ElementAt(2) , "节点3" , new GetUsers("originator") , flow.CustomActivityResult , new Dictionary <string, FlowNode>() { { "同意", forth } } , null); var second = WorkflowBuilder.CreateSubProcess(settings.ElementAt(1) , "节点2" , null , flow.CustomActivityResult , null , third); flow.Body.StartNode = WorkflowBuilder.CreateHuman(settings.ElementAt(0) , "节点1" , new GetUsers("originator") , flow.CustomActivityResult , new Dictionary <string, FlowNode>() { { "同意", second } } , null); } else { settings = GetTemplateProcessActivitySettings(); var forth = WorkflowBuilder.CreateServer(settings.ElementAt(3) , "节点4" , "'1'" , null , null , flow.CustomActivityResult , null , null); var third = WorkflowBuilder.CreateHuman(settings.ElementAt(2) , "节点3" , new GetUsers("originator") , flow.CustomActivityResult , new Dictionary <string, FlowNode>() { { "同意", forth } } , null); var second = WorkflowBuilder.CreateHuman(settings.ElementAt(1) , "节点2" , new GetUsers("originator") , flow.CustomActivityResult , new Dictionary <string, FlowNode>() { { "同意", third } } , null); flow.Body.StartNode = WorkflowBuilder.CreateHuman(settings.ElementAt(0) , "节点1" , new GetUsers("originator") , flow.CustomActivityResult , new Dictionary <string, FlowNode>() { { "同意", second } } , null); } return(flow); }
public string Parse(Statements.WorkflowActivity workflowActivity, string originalWorkflowDefinition) { throw new NotImplementedException(); }
public virtual Statements.WorkflowActivity Parse(string key, string workflowDefinition, IEnumerable <ActivitySetting> activitySettings) { //是否是子流程测试模式 var isSubMode = key.Contains(BaseTest.SubFlag); var settings = isSubMode ? GetSubProcessActivitySettings() : GetActivitySettings(); var flow = new Statements.WorkflowActivity(); var v1 = new Variable <string>("v1"); flow.Variables.Add(v1); //0 节点1 同意|否决 //2 节点2 完成 startRule 10s //4 节点3 完成 OneAtOnce slot=2 发起人->主管->username1 //6 节点4 Server //8 并行节点 子节点1完成则完成 //8 并行子节点1 发起人 startRule 无限期延迟 需要提前唤醒 //8 并行子节点2 主管 //9 节点6 完成 AllAtOnce slot=2 发起人 同意|否决 //11 节点7 完成 AllAtOnce slot=1 发起人|主管 同意|否决 //根据参数追加一个子流程节点 //13 节点8 子流程节点 var eighth = isSubMode ? WorkflowBuilder.CreateSubProcess(settings.ElementAt(9), BaseTest.SubProcessNode, null, null, null, null) : null; var seventh = WorkflowBuilder.CreateHuman(settings.ElementAt(8) , "节点7" , new GetUsers("originator", "getSuperior()") , flow.CustomActivityResult , null , isSubMode ? eighth : null); var sixth = WorkflowBuilder.CreateHuman(settings.ElementAt(7) , "节点6" , new GetUsers("originator") , flow.CustomActivityResult , null , seventh); var parallel_1 = WorkflowBuilder.CreateHuman(settings.ElementAt(5), "并行子节点1", new GetUsers("originator"), null); var parallel_2 = WorkflowBuilder.CreateHuman(settings.ElementAt(6), "并行子节点2", new GetUsers("getSuperior()"), null); //true var parallel = WorkflowBuilder.CreateParallel(settings.ElementAt(4), "并行节点", "true", sixth, parallel_1, parallel_2); var forth = WorkflowBuilder.CreateServer(settings.ElementAt(3) , "节点4", "'1'", null, v1, flow.CustomActivityResult, null, parallel); var third = WorkflowBuilder.CreateHuman(settings.ElementAt(2) , "节点3" , new GetUsers("originator", "getSuperior()", BaseTest.VariableUser) , flow.CustomActivityResult , null , forth); var second = WorkflowBuilder.CreateHuman(settings.ElementAt(1) , "节点2" , new GetUsers("originator") , flow.CustomActivityResult , null , third); flow.Body.StartNode = WorkflowBuilder.CreateHuman(settings.ElementAt(0) , "节点1" , new GetUsers("originator") , flow.CustomActivityResult , new Dictionary <string, FlowNode>() { { "同意", second } } , null); //有需要可在此初始化元数据 //Taobao.Activities.ActivityUtilities.InitializeActivity(flow); return(flow); }
public Statements.WorkflowActivity Parse(string key, string workflowDefinition, IEnumerable<ActivitySetting> activitySettings) { var settings = GetActivitySettings(); var flow = new Statements.WorkflowActivity(); ParallelWorkflowParser.Human = WorkflowBuilder.CreateHuman(settings.ElementAt(1) , "并行子节点1" , new GetUsers(this._actionerRule) , null); ParallelWorkflowParser.SubProcess = WorkflowBuilder.CreateSubProcess(settings.ElementAt(2) , "并行子节点2" , new Dictionary<string, string>() { { "error", this._finishRule } } , null); flow.Body.StartNode = WorkflowBuilder.CreateParallel(settings.ElementAt(0) , "并行节点" , this._completion , null , ParallelWorkflowParser.Human , ParallelWorkflowParser.SubProcess); Parallel = (flow.Body.StartNode as FlowStep).Action as Parallel; return flow; }
public WorkflowActivity Parse(string key, string workflowDefinition, IEnumerable<ActivitySetting> activitySettings) { //本测试工程的大部分测试均基于此工作流定义,需谨慎变更 禁止修改 var flow = new Statements.WorkflowActivity(); IEnumerable<ActivitySetting> settings; if (key.IndexOf("SubProcess") >= 0) { //0 节点1 同意|否决 //1 节点2 完成 //2 节点3 完成 settings = GetSubProcessActivitySettings(); var third = WorkflowBuilder.CreateServer(settings.ElementAt(2) , "节点3" , "'1'" , null , null , flow.CustomActivityResult , null , null); var second = WorkflowBuilder.CreateHuman(settings.ElementAt(1) , "节点2" , new GetUsers("originator") , flow.CustomActivityResult , new Dictionary<string, FlowNode>() { { "同意", third } } , null); flow.Body.StartNode = WorkflowBuilder.CreateHuman(settings.ElementAt(0) , "节点1" , new GetUsers("originator") , flow.CustomActivityResult , new Dictionary<string, FlowNode>() { { "同意", second } } , null); } else if (key.IndexOf("ParentProcess") >= 0) { //0 节点1 同意|否决 //1 节点2 完成 //2 节点3 完成 //3 节点4 完成 settings = GetParentProcessActivitySettings(); var forth = WorkflowBuilder.CreateServer(settings.ElementAt(3) , "节点4" , "'1'" , null , null , flow.CustomActivityResult , null , null); var third = WorkflowBuilder.CreateHuman(settings.ElementAt(2) , "节点3" , new GetUsers("originator") , flow.CustomActivityResult , new Dictionary<string, FlowNode>() { { "同意", forth } } , null); var second = WorkflowBuilder.CreateSubProcess(settings.ElementAt(1) , "节点2" , null , flow.CustomActivityResult , null , third); flow.Body.StartNode = WorkflowBuilder.CreateHuman(settings.ElementAt(0) , "节点1" , new GetUsers("originator") , flow.CustomActivityResult , new Dictionary<string, FlowNode>() { { "同意", second } } , null); } else { settings = GetTemplateProcessActivitySettings(); var forth = WorkflowBuilder.CreateServer(settings.ElementAt(3) , "节点4" , "'1'" , null , null , flow.CustomActivityResult , null , null); var third = WorkflowBuilder.CreateHuman(settings.ElementAt(2) , "节点3" , new GetUsers("originator") , flow.CustomActivityResult , new Dictionary<string, FlowNode>() { { "同意", forth } } , null); var second = WorkflowBuilder.CreateHuman(settings.ElementAt(1) , "节点2" , new GetUsers("originator") , flow.CustomActivityResult , new Dictionary<string, FlowNode>() { { "同意", third } } , null); flow.Body.StartNode = WorkflowBuilder.CreateHuman(settings.ElementAt(0) , "节点1" , new GetUsers("originator") , flow.CustomActivityResult , new Dictionary<string, FlowNode>() { { "同意", second } } , null); } return flow; }