public void startDevideVotingProcess(Dictionary <string, ArrayList> solutionTasks) { //创建输入参数 Dictionary <string, object> para = new Dictionary <string, object>(); para.Add("solutionTasks", solutionTasks); //创建实例对象 WorkflowApplication currentWorkflowInstance = new WorkflowApplication(new decomposeVoting(), para); //委托流程结束时候调用的方法 currentWorkflowInstance.Completed = new Action <WorkflowApplicationCompletedEventArgs>(DevideVotingWorkflowCompleted); //启动实例 currentWorkflowInstance.Run(); CrowdTaskService crowdTaskService = new CrowdTaskService(); //分解任务 CrowdTask divideTask = crowdTaskService.findCrowdTaskByWorkflowId(solutionTasks.First().Key); CrowdTask crowdTask = new CrowdTask(); crowdTask.taskName = divideTask.taskName; crowdTask.taskDescription = divideTask.taskDescription; crowdTask.taskType = TaskType.decomposeVotingTask; crowdTask.taskWorkflowId = currentWorkflowInstance.Id.ToString(); crowdTask.taskParentWorkflowId = crowdTaskService.findCrowdTaskByWorkflowId(solutionTasks.Keys.First().ToString()).taskParentWorkflowId; int result = crowdTaskService.insert(crowdTask); //更新每个实例的主工作流Id crowdTaskService.updateCrowdTaskMainTaskIdByWorkflowId(currentWorkflowInstance.Id.ToString()); if (result == 1) { //将当前实例加入到分解任务集合中 MyWorkflowInstance.setDecomposeVotingWorkflowApplication(currentWorkflowInstance.Id.ToString(), currentWorkflowInstance); } }
public void startSubDivideProcess(Guid parentWorkflowId, CrowdTask task) { //创建输入参数 Dictionary <string, object> para = new Dictionary <string, object>(); CrowdTask crowdTask = new CrowdTask(); crowdTask.taskName = task.taskName; crowdTask.taskDescription = task.taskDescription; crowdTask.taskParentWorkflowId = parentWorkflowId.ToString(); crowdTask.taskType = TaskType.decomposeTask; para.Add("parentWorkflowId", parentWorkflowId); para.Add("task", crowdTask); //创建实例对象 WorkflowApplication currentWorkflowInstance = new WorkflowApplication(new decompose(), para); //委托流程结束时候调用的方法 currentWorkflowInstance.Completed = new Action <WorkflowApplicationCompletedEventArgs>(SubDivideWorkflowCompleted); //启动实例 currentWorkflowInstance.Run(); //继续绑定crowdTask 参数 crowdTask.taskWorkflowId = currentWorkflowInstance.Id.ToString(); //将这个任务插入到到数据库 CrowdTaskService crowdTaskService = new CrowdTaskService(); int result = crowdTaskService.insert(crowdTask); //更新每个实例的主工作流Id crowdTaskService.updateCrowdTaskMainTaskIdByWorkflowId(currentWorkflowInstance.Id.ToString()); if (result == 1) { //将当前实例加入到分解任务集合中 MyWorkflowInstance.setDecomposeWorkflowApplication(currentWorkflowInstance.Id.ToString(), currentWorkflowInstance); } }
public void startSolveVoteProcess(Dictionary <string, SolveResult> solveResutDic) { //开启解决投票实例 //创建输入参数 Dictionary <string, object> para = new Dictionary <string, object>(); para.Add("sovleResultDic", solveResutDic); //创建实例对象 WorkflowApplication currentWorkflowInstance = new WorkflowApplication(new solveVoting(), para); //委托流程结束时候调用的方法 currentWorkflowInstance.Completed = new Action <WorkflowApplicationCompletedEventArgs>(solveVotingWorkflowCompleted); //启动实例 currentWorkflowInstance.Run(); CrowdTaskService crowdTaskService = new CrowdTaskService(); CrowdTask crowdTask = new CrowdTask(); crowdTask.taskName = solveResutDic.Values.First().taskName; crowdTask.taskDescription = solveResutDic.Values.First().taskDescription; crowdTask.taskType = TaskType.solveVotingTask; crowdTask.taskWorkflowId = currentWorkflowInstance.Id.ToString(); int result = crowdTaskService.insert(crowdTask); //更新每个实例的主工作流Id crowdTaskService.updateCrowdTaskMainTaskIdByWorkflowId(currentWorkflowInstance.Id.ToString()); if (result == 1) { //将当前实例加入到分解任务集合中 MyWorkflowInstance.setSolveVotingWorkflowApplication(currentWorkflowInstance.Id.ToString(), currentWorkflowInstance); } }
public void startSubDivideProcess(Guid parentWorkflowId,CrowdTask task) { //创建输入参数 Dictionary<string, object> para = new Dictionary<string, object>(); CrowdTask crowdTask = new CrowdTask(); crowdTask.taskName = task.taskName; crowdTask.taskDescription = task.taskDescription; crowdTask.taskParentWorkflowId=parentWorkflowId.ToString(); crowdTask.taskType = TaskType.decomposeTask; para.Add("parentWorkflowId", parentWorkflowId); para.Add("task", crowdTask); //创建实例对象 WorkflowApplication currentWorkflowInstance = new WorkflowApplication(new decompose(), para); //委托流程结束时候调用的方法 currentWorkflowInstance.Completed = new Action<WorkflowApplicationCompletedEventArgs>(SubDivideWorkflowCompleted); //启动实例 currentWorkflowInstance.Run(); //继续绑定crowdTask 参数 crowdTask.taskWorkflowId = currentWorkflowInstance.Id.ToString(); //将这个任务插入到到数据库 CrowdTaskService crowdTaskService = new CrowdTaskService(); int result = crowdTaskService.insert(crowdTask); //更新每个实例的主工作流Id crowdTaskService.updateCrowdTaskMainTaskIdByWorkflowId(currentWorkflowInstance.Id.ToString()); if (result == 1) { //将当前实例加入到分解任务集合中 MyWorkflowInstance.setDecomposeWorkflowApplication(currentWorkflowInstance.Id.ToString(), currentWorkflowInstance); } }
public void startSolveVoteProcess(Dictionary<string, SolveResult> solveResutDic) { //开启解决投票实例 //创建输入参数 Dictionary<string, object> para = new Dictionary<string, object>(); para.Add("sovleResultDic", solveResutDic); //创建实例对象 WorkflowApplication currentWorkflowInstance = new WorkflowApplication(new solveVoting(), para); //委托流程结束时候调用的方法 currentWorkflowInstance.Completed = new Action<WorkflowApplicationCompletedEventArgs>(solveVotingWorkflowCompleted); //启动实例 currentWorkflowInstance.Run(); CrowdTaskService crowdTaskService = new CrowdTaskService(); CrowdTask crowdTask = new CrowdTask(); crowdTask.taskName = solveResutDic.Values.First().taskName; crowdTask.taskDescription = solveResutDic.Values.First().taskDescription; crowdTask.taskType = TaskType.solveVotingTask; crowdTask.taskWorkflowId = currentWorkflowInstance.Id.ToString(); int result = crowdTaskService.insert(crowdTask); //更新每个实例的主工作流Id crowdTaskService.updateCrowdTaskMainTaskIdByWorkflowId(currentWorkflowInstance.Id.ToString()); if (result == 1) { //将当前实例加入到分解任务集合中 MyWorkflowInstance.setSolveVotingWorkflowApplication(currentWorkflowInstance.Id.ToString(), currentWorkflowInstance); } }
public void startDevideVotingProcess(Dictionary<string, ArrayList> solutionTasks) { //创建输入参数 Dictionary<string, object> para = new Dictionary<string, object>(); para.Add("solutionTasks", solutionTasks); //创建实例对象 WorkflowApplication currentWorkflowInstance = new WorkflowApplication(new decomposeVoting(), para); //委托流程结束时候调用的方法 currentWorkflowInstance.Completed = new Action<WorkflowApplicationCompletedEventArgs>(DevideVotingWorkflowCompleted); //启动实例 currentWorkflowInstance.Run(); CrowdTaskService crowdTaskService = new CrowdTaskService(); //分解任务 CrowdTask divideTask = crowdTaskService.findCrowdTaskByWorkflowId(solutionTasks.First().Key); CrowdTask crowdTask = new CrowdTask(); crowdTask.taskName = divideTask.taskName; crowdTask.taskDescription = divideTask.taskDescription; crowdTask.taskType = TaskType.decomposeVotingTask; crowdTask.taskWorkflowId = currentWorkflowInstance.Id.ToString(); crowdTask.taskParentWorkflowId = crowdTaskService.findCrowdTaskByWorkflowId(solutionTasks.Keys.First().ToString()).taskParentWorkflowId; int result = crowdTaskService.insert(crowdTask); //更新每个实例的主工作流Id crowdTaskService.updateCrowdTaskMainTaskIdByWorkflowId(currentWorkflowInstance.Id.ToString()); if (result == 1) { //将当前实例加入到分解任务集合中 MyWorkflowInstance.setDecomposeVotingWorkflowApplication(currentWorkflowInstance.Id.ToString(), currentWorkflowInstance); } }