示例#1
0
        public ResponseResult <List <NodeView> > GetNextStepInfo([FromBody] WfAppRunner runner)
        {
            var result = ResponseResult <List <NodeView> > .Default();

            try
            {
                var wfService    = new WorkflowService();
                var nextStepInfo = wfService.GetNextStepInfo(runner, runner.Conditions);

                //从下一步预选步骤人员中追加用户到步骤列表中去
                var nextStepTree           = nextStepInfo.NextActivityRoleUserTree.ToList();
                var nextActivityPerformers = nextStepInfo.NextActivityPerformers;

                if (nextActivityPerformers != null)
                {
                    //加载预选用户
                    nextStepTree = ProcessModelMimic.AppendPremilinaryUser(nextStepTree, nextActivityPerformers, true);
                }
                else
                {
                    //追加模拟用户
                    nextStepTree = ProcessModelMimic.AppendMimicUser(nextStepTree, runner).ToList();
                }
                result = ResponseResult <List <NodeView> > .Success(nextStepTree);
            }
            catch (System.Exception ex)
            {
                result = ResponseResult <List <NodeView> > .Error(ex.Message);
            }
            return(result);
        }
示例#2
0
        public ResponseResult <List <NodeView> > GetPrevActivityUserTree([FromBody] WfAppRunner runner)
        {
            var result = ResponseResult <List <NodeView> > .Default();

            try
            {
                var wfService = new WorkflowService();
                var prevSteps = wfService.GetPreviousActivityTree(runner).ToList();

                //追加模拟用户
                prevSteps = ProcessModelMimic.AppendMimicUser(prevSteps, runner).ToList();
                result    = ResponseResult <List <NodeView> > .Success(prevSteps);
            }
            catch (System.Exception ex)
            {
                result = ResponseResult <List <NodeView> > .Error(ex.Message);
            }
            return(result);
        }