Package org.drools.process.core.context.exception

Examples of org.drools.process.core.context.exception.ExceptionHandler


    public ExceptionScope getExceptionScope() {
        return (ExceptionScope) getContext();
    }
   
    public void handleException(String exception, Object params) {
        ExceptionHandler handler = getExceptionScope().getExceptionHandler(exception);
        if (handler == null) {
            throw new IllegalArgumentException(
                "Could not find ExceptionHandler for " + exception);
        }
        handleException(handler, exception, params);
View Full Code Here


    public ExceptionScope getExceptionScope() {
        return (ExceptionScope) getContext();
    }
   
    public void handleException(String exception, Object params) {
        ExceptionHandler handler = getExceptionScope().getExceptionHandler(exception);
        if (handler == null) {
            throw new IllegalArgumentException(
                "Could not find ExceptionHandler for " + exception);
        }
        handleException(handler, exception, params);
View Full Code Here

   
    public static void visitExceptionHandlers(Map<String, ExceptionHandler> exceptionHandlers, StringBuilder xmlDump) {
        if (exceptionHandlers != null && exceptionHandlers.size() > 0) {
            xmlDump.append("    <exceptionHandlers>" + EOL);
            for (Map.Entry<String, ExceptionHandler> entry: exceptionHandlers.entrySet()) {
              ExceptionHandler exceptionHandler = entry.getValue();
              if (exceptionHandler instanceof ActionExceptionHandler) {
                ActionExceptionHandler actionExceptionHandler = (ActionExceptionHandler) exceptionHandler;
                xmlDump.append("      <exceptionHandler faultName=\"" + entry.getKey() + "\" type=\"action\" ");
                String faultVariable = exceptionHandler.getFaultVariable();
                if (faultVariable != null && faultVariable.length() > 0) {
                  xmlDump.append("faultVariable=\"" + faultVariable + "\" ");
                }
              xmlDump.append(">" + EOL);
              DroolsAction action = actionExceptionHandler.getAction();
View Full Code Here

    final String faultName = element.getAttribute("faultName");
    emptyAttributeCheck(localName, "faultName", type, parser);
   
    final String faultVariable = element.getAttribute("faultVariable");
   
    ExceptionHandler exceptionHandler = null;
    if ("action".equals(type)) {
      exceptionHandler = new ActionExceptionHandler();
      org.w3c.dom.Node xmlNode = element.getFirstChild();
          if (xmlNode instanceof Element) {
          Element actionXml = (Element) xmlNode;
          DroolsAction action = ActionNodeHandler.extractAction(actionXml);
          ((ActionExceptionHandler) exceptionHandler).setAction(action);
          }
    } else {
      throw new SAXParseException("Unknown exception handler type " + type, parser.getLocator());
    }
   
    if (faultVariable != null && faultVariable.length() > 0) {
      exceptionHandler.setFaultVariable(faultVariable);
    }
   
    ExceptionScope exceptionScope = (ExceptionScope)
      contextContainer.getDefaultContext(ExceptionScope.EXCEPTION_SCOPE);
    if (exceptionScope == null) {
View Full Code Here

   
    public static void visitExceptionHandlers(Map<String, ExceptionHandler> exceptionHandlers, StringBuffer xmlDump) {
        if (exceptionHandlers != null && exceptionHandlers.size() > 0) {
            xmlDump.append("    <exceptionHandlers>" + EOL);
            for (Map.Entry<String, ExceptionHandler> entry: exceptionHandlers.entrySet()) {
              ExceptionHandler exceptionHandler = entry.getValue();
              if (exceptionHandler instanceof ActionExceptionHandler) {
                ActionExceptionHandler actionExceptionHandler = (ActionExceptionHandler) exceptionHandler;
                xmlDump.append("      <exceptionHandler faultName=\"" + entry.getKey() + "\" type=\"action\" ");
                String faultVariable = exceptionHandler.getFaultVariable();
                if (faultVariable != null && faultVariable.length() > 0) {
                  xmlDump.append("faultVariable=\"" + faultVariable + "\" ");
                }
              xmlDump.append(">" + EOL);
              DroolsAction action = actionExceptionHandler.getAction();
View Full Code Here

   
    public static void visitExceptionHandlers(Map<String, ExceptionHandler> exceptionHandlers, StringBuilder xmlDump) {
        if (exceptionHandlers != null && exceptionHandlers.size() > 0) {
            xmlDump.append("    <exceptionHandlers>" + EOL);
            for (Map.Entry<String, ExceptionHandler> entry: exceptionHandlers.entrySet()) {
              ExceptionHandler exceptionHandler = entry.getValue();
              if (exceptionHandler instanceof ActionExceptionHandler) {
                ActionExceptionHandler actionExceptionHandler = (ActionExceptionHandler) exceptionHandler;
                xmlDump.append("      <exceptionHandler faultName=\"" + entry.getKey() + "\" type=\"action\" ");
                String faultVariable = exceptionHandler.getFaultVariable();
                if (faultVariable != null && faultVariable.length() > 0) {
                  xmlDump.append("faultVariable=\"" + faultVariable + "\" ");
                }
              xmlDump.append(">" + EOL);
              DroolsAction action = actionExceptionHandler.getAction();
View Full Code Here

   
    public static void visitExceptionHandlers(Map<String, ExceptionHandler> exceptionHandlers, StringBuffer xmlDump) {
        if (exceptionHandlers != null && exceptionHandlers.size() > 0) {
            xmlDump.append("    <exceptionHandlers>" + EOL);
            for (Map.Entry<String, ExceptionHandler> entry: exceptionHandlers.entrySet()) {
              ExceptionHandler exceptionHandler = entry.getValue();
              if (exceptionHandler instanceof ActionExceptionHandler) {
                ActionExceptionHandler actionExceptionHandler = (ActionExceptionHandler) exceptionHandler;
                xmlDump.append("      <exceptionHandler faultName=\"" + entry.getKey() + "\" type=\"action\" ");
                String faultVariable = exceptionHandler.getFaultVariable();
                if (faultVariable != null && faultVariable.length() > 0) {
                  xmlDump.append("faultVariable=\"" + faultVariable + "\" ");
                }
              xmlDump.append(">" + EOL);
              DroolsAction action = actionExceptionHandler.getAction();
View Full Code Here

    final String faultName = element.getAttribute("faultName");
    emptyAttributeCheck(localName, "faultName", type, parser);
   
    final String faultVariable = element.getAttribute("faultVariable");
   
    ExceptionHandler exceptionHandler = null;
    if ("action".equals(type)) {
      exceptionHandler = new ActionExceptionHandler();
      org.w3c.dom.Node xmlNode = element.getFirstChild();
          if (xmlNode instanceof Element) {
          Element actionXml = (Element) xmlNode;
          DroolsAction action = ActionNodeHandler.extractAction(actionXml);
          ((ActionExceptionHandler) exceptionHandler).setAction(action);
          }
    } else {
      throw new SAXParseException("Unknown exception handler type " + type, parser.getLocator());
    }
   
    if (faultVariable != null && faultVariable.length() > 0) {
      exceptionHandler.setFaultVariable(faultVariable);
    }
   
    ExceptionScope exceptionScope = (ExceptionScope)
      contextContainer.getDefaultContext(ExceptionScope.EXCEPTION_SCOPE);
    if (exceptionScope == null) {
View Full Code Here

   
    public static void visitExceptionHandlers(Map<String, ExceptionHandler> exceptionHandlers, StringBuilder xmlDump) {
        if (exceptionHandlers != null && exceptionHandlers.size() > 0) {
            xmlDump.append("    <exceptionHandlers>" + EOL);
            for (Map.Entry<String, ExceptionHandler> entry: exceptionHandlers.entrySet()) {
              ExceptionHandler exceptionHandler = entry.getValue();
              if (exceptionHandler instanceof ActionExceptionHandler) {
                ActionExceptionHandler actionExceptionHandler = (ActionExceptionHandler) exceptionHandler;
                xmlDump.append("      <exceptionHandler faultName=\"" + entry.getKey() + "\" type=\"action\" ");
                String faultVariable = exceptionHandler.getFaultVariable();
                if (faultVariable != null && faultVariable.length() > 0) {
                  xmlDump.append("faultVariable=\"" + faultVariable + "\" ");
                }
              xmlDump.append(">" + EOL);
              DroolsAction action = actionExceptionHandler.getAction();
View Full Code Here

TOP

Related Classes of org.drools.process.core.context.exception.ExceptionHandler

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.