Package org.drools

Examples of org.drools.CheckedDroolsException


        RuleBaseLoader.engineType = type;
    }

    private RuleBase makeRuleBase(final PackageBuilder builder) throws CheckedDroolsException {
        if ( builder.hasErrors() ) {
            throw new CheckedDroolsException( "There were errors in the rule source: " + builder.getErrors().toString() );
        }
        final Package binaryPackage = builder.getPackage();

        final RuleBase rb = RuleBaseFactory.newRuleBase( RuleBaseLoader.engineType );
        try {
            rb.addPackage( binaryPackage );
        } catch ( final Exception e ) {
            throw new CheckedDroolsException( "Unable to add compiled package to rulebase. Nested error is: " + e.getMessage() );
        }
        return rb;
    }
View Full Code Here


            }

            ServiceRegistryImpl.getInstance().addDefault(BusinessRuleProvider.class, className);
            return ServiceRegistryImpl.getInstance().get(BusinessRuleProvider.class);
        } catch (IOException e) {
            throw new CheckedDroolsException("Error obtaining " + interfaceName, e);
        }
    }
View Full Code Here

            throw new CheckedDroolsException("Error obtaining " + interfaceName, e);
        }
    }

    private void throwNoImplementationFound() throws CheckedDroolsException {
        throw new CheckedDroolsException("Unable to find implementation for BusinessRuleProvider");
    }
View Full Code Here

  public String executeCommand(String cmd) throws CheckedDroolsException {
    String lookup = getLookup(cmd);
    if (lookup==null || lookup.length()==0) {
      LOG.error("Unable to get command lookup attribute: " + lookup);
      throw new CheckedDroolsException("Unable to get command lookup attribute: " + lookup);
    }
    KnowledgeServiceConfiguration serviceConfiguration = configurations.get(lookup);
    if (serviceConfiguration==null) {
      LOG.error("Unable to lookup session: " + lookup);
      throw new CheckedDroolsException("Unable to lookup session: " + lookup);
    }
    if ("JAXB".equals(serviceConfiguration.getMarshaller())) {
      JAXBContext jaxbContext = serviceConfiguration.getContext();
      return new String((byte[])template.requestBodyAndHeader("direct:with-session-jaxb", cmd, "jaxb-context", jaxbContext));
    }
View Full Code Here

    InputSource source = new InputSource(new StringReader(xml));
    Document d = null;
    try {
      d = factory.newDocumentBuilder().parse(source);
    } catch (Exception e) {
      throw new CheckedDroolsException("Error getting lookup: " + e.getMessage(), e);
    }
    return d.getDocumentElement().getAttribute("lookup");
  }
View Full Code Here

      }

          ServiceRegistryImpl.getInstance().addDefault(BusinessRuleProvider.class, className);
      return ServiceRegistryImpl.getInstance().get(BusinessRuleProvider.class);
        } catch (IOException e) {
      throw new CheckedDroolsException("Error obtaining " + interfaceName, e);
        }
  }
View Full Code Here

      throw new CheckedDroolsException("Error obtaining " + interfaceName, e);
        }
  }

  private void throwNoImplementationFound() throws CheckedDroolsException {
    throw new CheckedDroolsException("Unable to find implementation for BusinessRuleProvider");
  }
View Full Code Here

        RuleBaseLoader.engineType = type;
    }

    private RuleBase makeRuleBase(final PackageBuilder builder) throws CheckedDroolsException {
        if ( builder.hasErrors() ) {
            throw new CheckedDroolsException( "There were errors in the rule source: " + builder.getErrors().toString() );
        }
        final Package binaryPackage = builder.getPackage();

        final RuleBase rb = RuleBaseFactory.newRuleBase( RuleBaseLoader.engineType );
        try {
            rb.addPackage( binaryPackage );
        } catch ( final Exception e ) {
            throw new CheckedDroolsException( "Unable to add compiled package to rulebase. Nested error is: " + e.getMessage() );
        }
        return rb;
    }
View Full Code Here

TOP

Related Classes of org.drools.CheckedDroolsException

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.