コード例 #1
0
ファイル: FlowController.cs プロジェクト: ym1100/AceSaaS
        public IActionResult PostWf([FromBody] JObject data)
        {
            var action = (WfActionType)data.GetValue("action", 3);
            var runner = new WfRunner(AppCtx.AC)
            {
                AppInstanceId        = App.GetQuery <long>("appinstanceid"),
                TaskId               = App.GetQuery <long>("taskid"),
                Audit                = (WfAuditState)data.GetValue("audit", 1),
                Opinion              = data.GetValue("opinion", ""),
                LoadBackInstanceTask = action == WfActionType.Backward,
                LoadCanWithdraw      = action == WfActionType.Withdraw,
                LoadNextTasks        = action == WfActionType.Forward,
                LoadPrevInstanceTask = action == WfActionType.Withdraw
            };

            if (action == WfActionType.Forward)
            {
                return(Ok(wfService.Forward(runner)));
            }
            else if (action == WfActionType.Backward)
            {
                return(Ok(wfService.Backward(runner)));
            }
            else if (action == WfActionType.Fetch)
            {
                return(Ok(wfService.Fetch(runner)));
            }
            else if (action == WfActionType.Withdraw)
            {
                return(Ok(wfService.Withdraw(runner)));
            }
            else
            {
                return(Ok(wfService.Start(runner)));
            }
        }