Beispiel #1
0
 protected internal override void eventNotificationsFailed(PvmExecutionImpl execution, Exception exception)
 {
     if (shouldHandleFailureAsBpmnError())
     {
         ActivityExecution activityExecution = (ActivityExecution)execution;
         try
         {
             resetListeners(execution);
             BpmnExceptionHandler.propagateException(activityExecution, exception);
         }
         catch (ErrorPropagationException)
         {
             // exception has been logged by thrower
             // re-throw the original exception so that it is logged
             // and set as cause of the failure
             base.eventNotificationsFailed(execution, exception);
         }
         catch (Exception e)
         {
             base.eventNotificationsFailed(execution, e);
         }
     }
     else
     {
         base.eventNotificationsFailed(execution, exception);
     }
 }
Beispiel #2
0
        /// <summary>
        /// Takes an <seealso cref="ActivityExecution"/> and an <seealso cref="Callable"/> and wraps
        /// the call to the Callable with the proper error propagation. This method
        /// also makes sure that exceptions not caught by following activities in the
        /// process will be thrown and not propagated.
        /// </summary>
        /// <param name="execution"> </param>
        /// <param name="toExecute"> </param>
        /// <exception cref="Exception"> </exception>
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: protected void executeWithErrorPropagation(org.camunda.bpm.engine.impl.pvm.delegate.ActivityExecution execution, java.util.concurrent.Callable<Void> toExecute) throws Exception
        protected internal virtual void executeWithErrorPropagation(ActivityExecution execution, Callable <Void> toExecute)
        {
            string activityInstanceId = execution.ActivityInstanceId;

            try
            {
                toExecute.call();
            }
            catch (Exception ex)
            {
                if (activityInstanceId.Equals(execution.ActivityInstanceId))
                {
                    try
                    {
                        BpmnExceptionHandler.propagateException(execution, ex);
                    }
                    catch (ErrorPropagationException)
                    {
                        // exception has been logged by thrower
                        // re-throw the original exception so that it is logged
                        // and set as cause of the failure
                        throw ex;
                    }
                }
                else
                {
                    throw ex;
                }
            }
        }