Package org.camunda.bpm.engine.delegate

Examples of org.camunda.bpm.engine.delegate.BpmnError


    executions++;
    if (executionsBeforeError == null || executionsBeforeError < executions) {
      if (exceptionType != null && exceptionType) {
        throw new MyBusinessException("This is a business exception, which can be caught by a BPMN Error Event.")
      } else {
        throw new BpmnError("23", "This is a business fault, which can be caught by a BPMN Error Event.");
      }
    } else {
      execution.setVariable("executions", executions);
    }
  }
View Full Code Here


  protected void handle(ActivityExecution execution, String action) throws Exception {
    execution.setVariable(action, true);
    String type = (String) execution.getVariable("type");
    if ("error".equalsIgnoreCase(type)) {
      throw new BpmnError("MyError");
    }
    else if ("exception".equalsIgnoreCase(type)) {
      throw new MyBusinessException("MyException");
    }
    else if ("leave".equalsIgnoreCase(type)) {
View Full Code Here

public class BpmnErrorBean implements Serializable {

  private static final long serialVersionUID = 1L;

  public void throwBpmnError() {
    throw new BpmnError("23", "This is a business fault, which can be caught by a BPMN Error Event.");
  }
View Full Code Here

  protected void handle(ActivityExecution execution, String action) throws Exception {
    execution.setVariable(action, true);
    String type = (String) execution.getVariable("type");
    if ("error".equalsIgnoreCase(type)) {
      throw new BpmnError("MyError");
    }
    else if ("exception".equalsIgnoreCase(type)) {
      throw new MyBusinessException("MyException");
    }
    else if ("leave".equalsIgnoreCase(type)) {
View Full Code Here

    if (executions == null) {
      executions = 0;
    }
    executions++;
    if (executionsBeforeError == null || executionsBeforeError < executions) {
      throw new BpmnError("23", "This is a business fault, which can be caught by a BPMN Error Event.");
    } else {
      execution.setVariable("executions", executions);
    }
  }
View Full Code Here

    }
    leave(execution);
    } catch (Exception exc) {

      Throwable cause = exc;
      BpmnError error = null;
      while (cause != null) {
        if (cause instanceof BpmnError) {
          error = (BpmnError) cause;
          break;
        }
View Full Code Here

      ActivityExecution superSuperExecution = getSuperExecution(superExecution);
      if (superSuperExecution != null) {
        executeCatchInSuperProcess(errorCode, origException, superSuperExecution);
      } else {
        if (origException == null) {
          throw new BpmnError(errorCode, "No catching boundary event found for error with errorCode '"
                  + errorCode + "', neither in same process nor in parent process");
        } else {
          // throw original exception
          throw origException;
        }
View Full Code Here

                + " nor " + JavaDelegate.class);
      }
    } catch (Exception exc) {

      Throwable cause = exc;
      BpmnError error = null;
      while (cause != null) {
        if (cause instanceof BpmnError) {
          error = (BpmnError) cause;
          break;
        }
View Full Code Here

public class AsyncThrowErrorService implements JavaDelegate {

  public void execute(DelegateExecution execution) throws Exception {
    Object shouldThrowError = execution.getVariable("shouldThrowError");
    if (shouldThrowError != null) {
      throw  new BpmnError("error");
    }
  }
View Full Code Here

                + " nor " + JavaDelegate.class);
      }
    } catch (Exception exc) {

      Throwable cause = exc;
      BpmnError error = null;
      while (cause != null) {
        if (cause instanceof BpmnError) {
          error = (BpmnError) cause;
          break;
        }
View Full Code Here

TOP

Related Classes of org.camunda.bpm.engine.delegate.BpmnError

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.