public ActionResult CriarWorkflowSteps([FromRoute] Guid IdWorkflow, [FromBody] List <WorkflowStep> workflowsteps)
        {
            try
            {
                _servWorkflowStep.CriarWorkflowSteps(IdWorkflow, workflowsteps);

                return(Ok());
            }
            catch (Exception ex)
            {
                return(BadRequest($"Ocorreu um erro ao criar um novo Workflow: {ex.Message}"));
            }
        }
예제 #2
0
        public Guid CriarWorkflow(Guid IdWorkflow)
        {
            var wf            = ConsultarWorkflow(IdWorkflow);
            var workflowSteps = _wfsServ.ConsultarStepsPorWorkflow(IdWorkflow);

            if (workflowSteps.Count == 0)
            {
                throw new Exception($"Não há nenhuma tarefa cadastrada para o modelo de workflow '{wf.Nome}'");
            }

            wf.IsModelo   = false;
            wf.IdWorkflow = CriarWorkflow(wf);

            _wfsServ.CriarWorkflowSteps(wf.IdWorkflow, workflowSteps);

            return(wf.IdWorkflow);
        }