Exemplo n.º 1
0
        protected override void PerformExecution(IActivityExecution execution)
        {
            TaskEntity task = TaskEntity.CreateAndInsert(execution);

            _taskDecorator.Decorate(task, execution);

            Context.CommandContext.HistoricTaskInstanceManager.CreateHistoricTask(task);

            // All properties set, now firing 'create' event
            task.FireEvent(TaskListenerFields.EventnameCreate);
        }
Exemplo n.º 2
0
        public virtual object Execute(CommandContext commandContext)
        {
            EnsureUtil.EnsureNotNull("Task", Task);

            string operation = string.Empty;

            if (Task.Revision == 0)
            {
                try
                {
                    CheckCreateTask(Task, commandContext);
                    Task.SaveTask(null);
                    Task.Update();
                    commandContext.HistoricTaskInstanceManager.CreateHistoricTask(Task);
                    operation = UserOperationLogEntryFields.OperationTypeCreate;
                    Task.ExecuteMetrics(ESS.FW.Bpm.Engine.Management.Metrics.ActivtyInstanceStart);
                }
                catch (NullValueException e)
                {
                    throw new NotValidException(e.Message, e);
                }
            }
            else
            {
                CheckTaskAssign(Task, commandContext);
                Task.Update();
                operation = UserOperationLogEntryFields.OperationTypeUpdate;
            }


            Task.FireAuthorizationProvider();
            Task.FireEvent();
            Task.CreateHistoricTaskDetails(operation);

            return(null);
        }