示例#1
0
        public JsonResult RunProcess(int idprocess)
        {
            HttpStatusCode status = HttpStatusCode.OK;
            string         message;
            object         response;
            Process        findprocess = processService.findProcess(idprocess);
            List <Step>    liststep    = stepService.findStepsOfProcess(idprocess);

            processService.addrunprocess(findprocess);
            StepRun            runstep        = stepService.addstartstep(idprocess);
            Step               idsteprunstart = liststep.Where(x => x.Key == runstep.Key && x.StartStep == true).FirstOrDefault();
            List <TaskProcess> listtaskrun    = taskService.findTaskOfStep(idsteprunstart.Id);

            taskService.addlistruntask(listtaskrun, runstep);
            message  = "Created ProcessRun Successfully";
            response = new { message = message, status = status };
            SetFlash(FlashType.success, "Create Run Process");
            return(Json(response, JsonRequestBehavior.AllowGet));
        }