示例#1
0
        public virtual Task <bool> CompleteTask([FromBody] CompleteTaskCmd completeTaskCmd)
        {
            Http400 http400 = null;

            try
            {
                processEngine.CompleteTask(completeTaskCmd);
            }
            catch (Exception ex)
            {
                if (http400 is null)
                {
                    http400 = new Http400();
                }
                http400.Code    = "completeTask[]";
                http400.Message = ex.Message;
                http400.Details.Add(new HttpException
                {
                    Message = ex.Message
                });
            }

            if (http400 is null == false)
            {
                throw new Http400Exception(http400, null);
            }

            return(Task.FromResult(true));
        }
示例#2
0
        /// <summary>
        ///
        /// </summary>
        public virtual void CompleteApprovalTask(CompleteTaskCmd completeTaskCmd)
        {
            IDictionary <string, object> variables = new Dictionary <string, object>(completeTaskCmd.OutputVariables);

            variables.TryGetValue(WorkflowVariable.GLOBAL_APPROVALED_COMMENTS, out var comment);

            taskService.Complete(completeTaskCmd.TaskId, comment?.ToString(), variables, completeTaskCmd.LocalScope);
        }
示例#3
0
            public override Void execute(CommandContext commandContext)
            {
                foreach (Task task in tasks)
                {
                    CompleteTaskCmd completeTaskCmd = new CompleteTaskCmd(task.Id, null);
                    completeTaskCmd.execute(commandContext);
                }

                monitor.sync();

                return(null);
            }
            public override object Execute(CommandContext commandContext)
            {
                foreach (ITask task in tasks)
                {
                    CompleteTaskCmd completeTaskCmd = new CompleteTaskCmd(task.Id, null);
                    completeTaskCmd.Execute(commandContext);
                }

                Monitor.Sync();

                return(null);
            }
示例#5
0
        /// <summary>
        ///
        /// </summary>
        public virtual void CompleteTask(CompleteTaskCmd cmd)
        {
            if (cmd != null)
            {
                IDictionary <string, object> variables = new Dictionary <string, object>(cmd.OutputVariables);
                if (cmd.RuntimeAssigneeUser != null && (cmd.RuntimeAssigneeUser.Users?.Length).GetValueOrDefault() > 0)
                {
                    variables.Add(BpmnXMLConstants.RUNTIME_ASSIGNEE_USER_VARIABLE_NAME, cmd.RuntimeAssigneeUser);
                }

                if (string.IsNullOrWhiteSpace(cmd.TaskId) == false)
                {
                    taskService.Complete(cmd.TaskId, variables, cmd.LocalScope, cmd.NotFoundThrowError);
                }
                else if (string.IsNullOrWhiteSpace(cmd.BusinessKey) == false && string.IsNullOrWhiteSpace(cmd.Assignee) == false)
                {
                    taskService.Complete(cmd.BusinessKey, cmd.TaskName, cmd.Assignee, cmd.Comment, variables, cmd.LocalScope, notFoundThrowError: cmd.NotFoundThrowError);
                }
            }
        }
        public virtual Task <bool> CompleteTask([FromBody] CompleteTaskCmd completeTaskCmd)
        {
            processEngine.CompleteTask(completeTaskCmd);

            return(Task.FromResult(true));
        }
示例#7
0
        public virtual Task <ActionResult> CompleteTask([FromBody] CompleteTaskCmd completeTaskCmd)
        {
            processEngine.CompleteTask(completeTaskCmd);

            return(Task.FromResult <ActionResult>(Ok()));
        }
示例#8
0
 /// <inheritdoc />
 public async Task <bool> CompleteTask(CompleteTaskCmd completeTaskCmd)
 {
     return(await httpProxy.PostAsync <bool>($"{serviceUrl}/complete", completeTaskCmd).ConfigureAwait(false));
 }