Example #1
0
        public IHttpActionResult ResubmitWorkflowTask(TaskData model)
        {
            WorkflowInstancePoco instance = GetInstance(model.InstanceGuid);

            try
            {
                WorkflowApprovalProcess process = GetProcess(instance.Type);
                IUser currentUser = Utility.GetCurrentUser();

                instance = process.ResubmitWorkflow(
                    instance,
                    currentUser.Id,
                    model.Comment
                    );

                Log.Info($"{instance.TypeDescription} request for {instance.Node.Name} [{instance.NodeId}] was resubmitted by {currentUser.Name}");

                return(Json(new
                {
                    message = $"Changes resubmitted successfully. Page will be {instance.TypeDescriptionPastTense.ToLower()} following workflow completion.",
                    status = 200
                }, ViewHelpers.CamelCase));
            }
            catch (Exception ex)
            {
                string msg = $"An error occurred processing the approval on {instance.Node.Name} [{instance.NodeId}]";
                Log.Error(msg, ex);

                return(Content(HttpStatusCode.InternalServerError, ViewHelpers.ApiException(ex, msg)));
            }
        }
Example #2
0
        public IHttpActionResult ResubmitWorkflowTask(TaskData model)
        {
            WorkflowInstancePoco instance = GetInstance(model.InstanceGuid);

            try
            {
                WorkflowApprovalProcess process = GetProcess(instance.Type);

                instance = process.ResubmitWorkflow(
                    instance,
                    Utility.GetCurrentUser().Id,
                    model.Comment
                    );

                return(Json(new
                {
                    message = "Changes resubmitted successfully. Page will be " + instance.TypeDescriptionPastTense.ToLower() + " following workflow completion.",
                    status = 200
                }, ViewHelpers.CamelCase));
            }
            catch (Exception ex)
            {
                string msg = "An error occurred processing the approval: " + ex.Message + ex.StackTrace;
                Log.Error(msg + " for workflow " + instance.Id, ex);

                return(Json(new
                {
                    message = msg,
                    status = 500
                }, ViewHelpers.CamelCase));
            }
        }