/// <summary> /// 当前用户代办任务列表(一次加载所有数据) /// </summary> /// <returns></returns> public ActionResult FlowList() { IWorkflowService service = new WorkflowService(); TaskQueryEntity en = new TaskQueryEntity { UserID = User.Identity.GetUserId() }; IList<TaskViewEntity> taskViewList = service.GetReadyTasks(en); return View(taskViewList); }
/// <summary> /// 获取当前用户待办任务列表 /// </summary> private void GetReadyTasks() { IWorkflowService wfService = new WorkflowService(); TaskQueryEntity en = new TaskQueryEntity { UserID = LoginUserID.ToString() }; IList<TaskViewEntity> taskViewList = wfService.GetReadyTasks(en); if (taskViewList != null) { Repeater2.DataSource = taskViewList; Repeater2.DataBind(); } }
/// <summary> /// 运行流程 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnRun_Click(object sender, EventArgs e) { WfAppRunner appRunner = new WfAppRunner(); appRunner.ProcessGUID = process_guid; appRunner.AppInstanceID = application_instance_id; //第一步任务承担者,登录后要找到自己的任务 appRunner.AppName = "officeIn"; appRunner.UserID = "1"; appRunner.UserName = "******"; IWorkflowService wfService = new WorkflowService(); TaskQueryEntity en = new TaskQueryEntity { UserID = "1" }; IList<TaskViewEntity> taskViewList = wfService.GetReadyTasks(en); if (taskViewList != null) { dataGridView1.DataSource = taskViewList; } ////下一步执行人 //PerformerList list = new PerformerList(); //Performer p = new Performer("3", "user3"); //下一步人ID,Name 注意有角色区分 //list.Add(p); //Dictionary<string, string> dictCondition = new Dictionary<string, string>(); //dictCondition.Add("IsHavingWeight", "true"); //dictCondition.Add("CanUseStock", "false"); //appRunner.Conditions = dictCondition; //NodeView nv = wfService.GetNextActivity(appRunner);//, dictCondition //Dictionary<String, PerformerList> dictPerformer = new Dictionary<String, PerformerList>(); //dictPerformer.Add(nv.ActivityGUID, list); //appRunner.NextActivityPerformers = dictPerformer; var result = wfService.RunProcessApp(appRunner); var msg = string.Format("流程运行结果:{0}\r\n", result.Status); textBox1.Text += msg; }
public IEnumerable<QueryResult> GetReadyTasks([FromODataUri]QueryEntity query) { IWorkflowService service = new WorkflowService(); Mapper.CreateMap<TaskViewEntity, QueryResult>(); Mapper.CreateMap<QueryEntity, TaskQueryEntity>(); var que = Mapper.Map<TaskQueryEntity>(query); try { var result = service.GetReadyTasks(que); if (result == null) { return new List<QueryResult>().AsEnumerable(); } else { var aa = Mapper.Map<IList<QueryResult>>(result); return aa.AsEnumerable(); } } catch { return new List<QueryResult>().AsEnumerable(); } }
public ResponseResult GetReadyTasks(TaskQueryEntity query) { IWorkflowService service = new WorkflowService(); var result = service.GetReadyTasks(query); return ResponseResult.Success(); }
public ResponseResult<List<TaskViewEntity>> QueryReadyTasks(TaskQueryEntity query) { var result = ResponseResult<List<TaskViewEntity>>.Default(); try { var taskList = new List<TaskViewEntity>(); var wfService = new WorkflowService(); var itemList = wfService.GetReadyTasks(query); if (itemList != null) { taskList = itemList.ToList(); } result = ResponseResult<List<TaskViewEntity>>.Success(taskList); } catch (System.Exception ex) { result = ResponseResult<List<TaskViewEntity>>.Error(string.Format( "获取待办任务数据失败, 异常信息:{0}", ex.Message)); } return result; }
private void btn综合部签字_Click(object sender, EventArgs e) { WfAppRunner appRunner = new WfAppRunner(); appRunner.ProcessGUID = process_guid; appRunner.AppInstanceID = application_instance_id; //第一步任务承担者,登录后要找到自己的任务 appRunner.AppName = "officeIn"; appRunner.UserID = "3"; appRunner.UserName = "******"; IWorkflowService wfService = new WorkflowService(); TaskQueryEntity en = new TaskQueryEntity { UserID = "3" }; IList<TaskViewEntity> taskViewList = wfService.GetReadyTasks(en); appRunner.TaskID = taskViewList[0].TaskID; PerformerList list = new PerformerList(); list.Add(new Performer("5", "user5")); NodeView nv = wfService.GetNextActivity(appRunner); Dictionary<String, PerformerList> dictPerformer = new Dictionary<String, PerformerList>(); dictPerformer.Add(nv.ActivityGUID, list); appRunner.NextActivityPerformers = dictPerformer; var result = wfService.RunProcessApp(appRunner); var msg = string.Format("流程运行结果:{0}\r\n{1}\r\n", result.Status, result.Message); tBoxResult.Text += msg; }