示例#1
0
        public IIncident Execute(CommandContext commandContext)
        {
            EnsureUtil.EnsureNotNull(typeof(BadUserRequestException), "Execution id cannot be null", "executionId", executionId);
            EnsureUtil.EnsureNotNull(typeof(BadUserRequestException), "incidentType", value: incidentType);

            ExecutionEntity execution = commandContext.ExecutionManager.FindExecutionById(executionId);

            EnsureUtil.EnsureNotNull(typeof(BadUserRequestException), "Cannot find an execution with executionId '" + executionId + "'", "execution", execution);
            EnsureUtil.EnsureNotNull(typeof(BadUserRequestException), "Execution must be related to an activity", "activity", execution.Activity);

            foreach (ICommandChecker checker in commandContext.ProcessEngineConfiguration.CommandCheckers)
            {
                checker.CheckUpdateProcessInstance(execution);
            }

            return(execution.CreateIncident(incidentType, configuration, message));
        }