Package org.drools.process.instance.context.exception

Examples of org.drools.process.instance.context.exception.ExceptionScopeInstance


        if (!org.drools.workflow.core.Node.CONNECTION_DEFAULT_TYPE.equals(type)) {
            throw new IllegalArgumentException(
                "A FaultNode only accepts default incoming connections!");
        }
        String faultName = getFaultName();
        ExceptionScopeInstance exceptionScopeInstance = getExceptionScopeInstance(faultName);
        ((NodeInstanceContainer) getNodeInstanceContainer()).removeNodeInstance(this);
        if (exceptionScopeInstance != null) {
          handleException(faultName, exceptionScopeInstance);
        } else {
          ((ProcessInstance) getProcessInstance()).setState(ProcessInstance.STATE_ABORTED);
View Full Code Here


    context.setNodeInstance(this);
    try {
      action.execute(knowledgeHelper, ((ProcessInstance) getProcessInstance()).getWorkingMemory(), context);
    } catch (Exception exception) {
      String exceptionName = exception.getClass().getName();
      ExceptionScopeInstance exceptionScopeInstance = (ExceptionScopeInstance)
        resolveContextInstance(ExceptionScope.EXCEPTION_SCOPE, exceptionName);
      if (exceptionScopeInstance == null) {
        exception.printStackTrace();
        throw new IllegalArgumentException(
          "Could not find exception handler for " + exceptionName + " while executing node " + getNodeId());
      }
      exceptionScopeInstance.handleException(exceptionName, exception);
    }
  }
View Full Code Here

        if (!org.drools.workflow.core.Node.CONNECTION_DEFAULT_TYPE.equals(type)) {
            throw new IllegalArgumentException(
                "A FaultNode only accepts default incoming connections!");
        }
        String faultName = getFaultName();
        ExceptionScopeInstance exceptionScopeInstance = getExceptionScopeInstance(faultName);
        NodeInstanceContainer nodeInstanceContainer =  (NodeInstanceContainer) getNodeInstanceContainer();
        nodeInstanceContainer.removeNodeInstance(this);
        if (getFaultNode().isTerminateParent()) {
            if (nodeInstanceContainer instanceof CompositeNodeInstance) {
                ((CompositeNodeInstance) nodeInstanceContainer).cancel();
View Full Code Here

    try {
      action.execute(knowledgeHelper, ((ProcessInstance) getProcessInstance()).getWorkingMemory(), context);
    } catch (Exception exception) {
      exception.printStackTrace();
      String exceptionName = exception.getClass().getName();
      ExceptionScopeInstance exceptionScopeInstance = (ExceptionScopeInstance)
        resolveContextInstance(ExceptionScope.EXCEPTION_SCOPE, exceptionName);
      if (exceptionScopeInstance == null) {
        exception.printStackTrace();
        throw new IllegalArgumentException(
          "Could not find exception handler for " + exceptionName + " while executing node " + getNodeId());
      }
      exceptionScopeInstance.handleException(exceptionName, exception);
    }
  }
View Full Code Here

  }

  public void raiseException(Throwable exception) throws DelegationException {
    Class<?> clazz = exception.getClass();
    while (clazz != null) {
      ExceptionScopeInstance exceptionScopeInstance = (ExceptionScopeInstance)
        resolveContextInstance(ExceptionScope.EXCEPTION_SCOPE, clazz.getName());
      if (exceptionScopeInstance != null) {
        exceptionScopeInstance.handleException(clazz.getName(), exception);
        return;
      }
      clazz = clazz.getSuperclass();
    }
    if (exception instanceof JbpmException) {
View Full Code Here

    try {
      action.execute(knowledgeHelper, ((ProcessInstance) getProcessInstance()).getWorkingMemory(), context);
    } catch (Exception exception) {
      exception.printStackTrace();
      String exceptionName = exception.getClass().getName();
      ExceptionScopeInstance exceptionScopeInstance = (ExceptionScopeInstance)
        resolveContextInstance(ExceptionScope.EXCEPTION_SCOPE, exceptionName);
      if (exceptionScopeInstance == null) {
        exception.printStackTrace();
        throw new IllegalArgumentException(
          "Could not find exception handler for " + exceptionName + " while executing node " + getNodeId());
      }
      exceptionScopeInstance.handleException(exceptionName, exception);
    }
  }
View Full Code Here

        if (!org.drools.workflow.core.Node.CONNECTION_DEFAULT_TYPE.equals(type)) {
            throw new IllegalArgumentException(
                "A FaultNode only accepts default incoming connections!");
        }
        String faultName = getFaultName();
        ExceptionScopeInstance exceptionScopeInstance = getExceptionScopeInstance(faultName);
        NodeInstanceContainer nodeInstanceContainer =  (NodeInstanceContainer) getNodeInstanceContainer();
        nodeInstanceContainer.removeNodeInstance(this);
        if (getFaultNode().isTerminateParent()) {
            if (nodeInstanceContainer instanceof CompositeNodeInstance) {
                ((CompositeNodeInstance) nodeInstanceContainer).cancel();
View Full Code Here

TOP

Related Classes of org.drools.process.instance.context.exception.ExceptionScopeInstance

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.