How to programmatically load rules from a Kie jar lying in the classpath of an application like a WAR ?

Solution Unverified - Updated -

Issue

  • In Red Hat JBoss BRMS 5.x rule assets (archived in a jar) could be loaded from the classpath of an application (like WAR) using KnowledgeBuilder as shown below.
KnowledgeBuilder kBuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
kBuilder.add(ResourceFactory.newClassPathResource("sample.drl"),ResourceType.DRL); 
KnowledgeBase kBase = KnowledgeBaseFactory.newKnowledgeBase();
kBase.addKnowledgePackages( kBuilder.getKnowledgePackages());
...

Are there similar ways to do the same in Red Hat JBoss BRMS 6.x as well, where rules can be programmatically loaded from a Kie jar lying in the classpath of an application like WAR ?

  • Will it work in an environment of Websphere Application Server 8.5.x as well where the WAR containing the code and the rule jar (i.e. a Kie jar built in Business Central) is in exploded form ?

Environment

  • Red Hat JBoss BRMS (BRMS)
    • 6.0.0
  • Websphere Application Server (WAS)
    • 8.5.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.