Beispiel #1
0
        public virtual void bpmnError(string errorCode, string errorMessage, IDictionary <string, object> variables)
        {
            ensureActive();
            ActivityExecution activityExecution = Execution;
            BpmnError         bpmnError         = null;

            if (!string.ReferenceEquals(errorMessage, null))
            {
                bpmnError = new BpmnError(errorCode, errorMessage);
            }
            else
            {
                bpmnError = new BpmnError(errorCode);
            }
            try
            {
                ExternalTaskActivityBehavior behavior = ((ExternalTaskActivityBehavior)activityExecution.Activity.ActivityBehavior);
                if (variables != null && variables.Count > 0)
                {
                    activityExecution.Variables = variables;
                }
                behavior.propagateBpmnError(bpmnError, activityExecution);
            }
            catch (Exception ex)
            {
                throw ProcessEngineLogger.CMD_LOGGER.exceptionBpmnErrorPropagationFailed(errorCode, ex);
            }
        }
Beispiel #2
0
        public virtual void BpmnError(string errorCode)
        {
            EnsureActive();
            IActivityExecution activityExecution = GetExecution();
            BpmnError          bpmnError         = new BpmnError(errorCode);

            try
            {
                ExternalTaskActivityBehavior behavior = ((ExternalTaskActivityBehavior)activityExecution.Activity.ActivityBehavior);
                behavior.PropagateBpmnError(bpmnError, activityExecution);
            }
            catch (System.Exception ex)
            {
                throw ProcessEngineLogger.CmdLogger.ExceptionBpmnErrorPropagationFailed(errorCode, ex);
            }
        }