Register   Login   About   Study   Enterprise   Share
AI / Internet Technology University (AITU)
Fast Login - available after registration







|

Top Links: >> 80. Technology >> Internet Technology Summit Program >> 7. Enterprise, Knowledge Architecture, IoT, AI and ML >> 7.2. Rules and Knowledge-Driven Applications >> 7.2.4. DRools Basics
Current Topic: 7.2.4.3. JBoss Business Rules Management System - jBRMS
You have a privilege to create a quiz (QnA) related to this subject and obtain creativity score...
JBoss Business Rules Management System - jBRMS

Original graphical user interface for DRools was Guvnor.

Over time Guvnor became more mature, filled with more features, and changed the name.
Today this is a web-based JBoss Business Rules Management System or jBRMS.

BRMS provides a secure access and serves as a rules editor and versioning system.

BRMS allows to search rules by name and by content as displayed below.

brms5-search

Companies actively use BRMS 5 and some moved to BRMS 6.

Here are the main differences brought by BRMS 6.

BRMS 6 is more consistent with the current enterprise environment.
BRMS 6 started using GIT and Maven.

Including GIT
GIT is consistently used for source version control in BRMS 6.

JBoss BRMS 6 Repository is backed by a GIT based repository. 

JBoss BRMS 6 uses GIT cloning into the Business Central component in the Administration perspective.
The option to use JBDS is also available as in version 5 but by using the GIT repository.

Including Maven
JBoss BRMS 6 uses Maven as the deployment and dependency management. Business Central project will have a POM file for managing dependencies, including a data model (fact) dependences.

JBoss BRMS 6 is connected to the maven build, using a 'Build&Deploy' button in the Project Authoring to generate a JAR file, referred to as a knowledge archive KJAR. This KJAR is then deployed by default into the local maven repository where it is available for any development project that has access to that local maven repository.

Collaboration with JBoss BPM
JBoss BPM Suite product is used for rules, events, and processes. JBRMS and JBPM can work together to create your own domain specific tasks.

JBoss BRMS 6 allows to develop rule flows, which are processes that contain only rule tasks.

BRMS 6 can work with JBoss BPM for complex event processing and to model and handle business processes

Kie API
Rules integration is facilitated in JBoss BRMS 5 by the Knowledge Base (KB) and Knowledge Session (KS). This has been moved to a KIE Base and KIE Session in JBoss BRMS 6.

There is backwards compatibility for users that wish to remain on the deprecated KB/KS facilitated by adding in the knowledge-api dependency from the product to your projects.

This will be removed at some future time so plans should be made to migrate to the newer KIE API.

The knowledge agent has been replaced with a KIE Scanner, for an example of how to use this see the Cool Store demo where a web application has been created that uses the KIE Scanner to watch for new releases of a project from Business Center by scanning the maven repository for the latest builds.

You can find an example of how to setup the KIE Scanner in the github project. As mentioned above, JBDS integration continues to facilitate round trip development. The major difference is only in the backends for the products having been JCR for JBoss BRMS 5 and now GIT for JBoss BRMS 6.

Here is a typical code with DRools 5 (BRMS 5) API:


KnowledgeBuilder -

KnowledgeBuilderFactory.newKnowledgeBuilder();

kbuilder.add( ResourceFactory.newUrlResource( url ), ResourceType.DRL );

if ( kbuilder.hasErrors() ) {
System.err.println( builder.getErrors().toString() );
}
KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase(); kbase.addKnowledgePackages( builder.getKnowledgePackages() ); StatefulKnowledgeSession ksession = knowledgeBase.newStatefulKnowledgeSession();
ksession.insert( new Fibonacci( 10 ) );
ksession.fireAllRules();
ksession.dispose();
Was it clear so far?


In the DRools 6 (BRMS 6) this API is replaced with the KIE API as you can see in the example below:

KieServices kieServices = KieServices.Factory.get();
KieFileSystem kfs = kieServices.newKieFileSystem();
FileInputStream fis = new FileInputStream( pathToSomeDrl );
kfs.write( "src/main/resources/simple.drl",
kieServices.getResources().newInputStreamResource( fis ) );
KieBuilder kieBuilder = kieServices.newKieBuilder( kfs ).buildAll();
Results results = kieBuilder.getResults();
if( results.hasMessages( Message.Level.ERROR ) ){
System.out.println( results.getMessages() );
throw new IllegalStateException( "### errors ###" );
}
KieContainer kieContainer = kieServices.newKieContainer(
kieServices.getRepository().getDefaultReleaseId() );
KieBase kieBase = kieContainer.getKieBase();
KieSession kieSession = kieContainer.newKieSession();


You can find a very close mapping of the main classes in both APIs:

KnowledgeBuilder - KieBuilder


KnowledgeBase - KieBase


KnowledgeSession - KieSession

Drools Workbench
BRMS 6 introduced a new instrument for Authoring Assets, Drools Workbench.

droolsWorkbench

Assets, such as Rules and Models live in a package, which serves like a folder in Drools Workbench.
You can Copy and Rename a Package in the Drools Workbench.
droolsWorkbench2

Drools Guided Editor
BRMS 6 introduced a Guided Rule Editor, which is more convenient for business users.

The Guided Rule Editor is composed of three sections: WHEN, THEN and OPTIONS and allows users easily compose and edit rules.
guidedEditor

Assignments:
1. Answer QnAs.
2. Create at least one QnA and send to dean@ituniversity.us

References:
https://access.redhat.com/documentation/en-US/Red_Hat_JBoss_BRMS/6.2/pdf/User_Guide/Red_Hat_JBoss_BRMS-6.2-User_Guide-en-US.pdf
| Check Your Progress | Propose QnA | Have a question or comments for open discussion?
<br/>KnowledgeBuilder - 
<br/>
<br/>KnowledgeBuilderFactory.newKnowledgeBuilder(); 
<br/>
<br/>kbuilder.add( ResourceFactory.newUrlResource( url ), ResourceType.DRL ); 
<br/>
<br/>if ( kbuilder.hasErrors() ) { 
<br/> System.err.println( builder.getErrors().toString() ); 
<br/>} 
<br/>KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase(); kbase.addKnowledgePackages( builder.getKnowledgePackages() ); StatefulKnowledgeSession ksession = knowledgeBase.newStatefulKnowledgeSession(); 
<br/>ksession.insert( new Fibonacci( 10 ) ); 
<br/>ksession.fireAllRules(); 
<br/>ksession.dispose();
<br/>






Was it clear so far?



In the DRools 6 (BRMS 6) this API is replaced with the KIE API as you can see in the example below:
<br/>KieServices kieServices = KieServices.Factory.get();
<br/>KieFileSystem kfs = kieServices.newKieFileSystem();
<br/>FileInputStream fis = new FileInputStream( pathToSomeDrl );
<br/>kfs.write( "src/main/resources/simple.drl",
<br/>                kieServices.getResources().newInputStreamResource( fis ) );
<br/>KieBuilder kieBuilder = kieServices.newKieBuilder( kfs ).buildAll();
<br/>Results results = kieBuilder.getResults();
<br/>if( results.hasMessages( Message.Level.ERROR ) ){
<br/>        System.out.println( results.getMessages() );
<br/>        throw new IllegalStateException( "### errors ###" );
<br/>}
<br/>KieContainer kieContainer = kieServices.newKieContainer(  
<br/>    kieServices.getRepository().getDefaultReleaseId() );
<br/>KieBase kieBase = kieContainer.getKieBase();
<br/>KieSession kieSession = kieContainer.newKieSession();
<br/>


You can find a very close mapping of the main classes in both APIs:

KnowledgeBuilder - KieBuilder


KnowledgeBase - KieBase


KnowledgeSession - KieSession

Drools Workbench
BRMS 6 introduced a new instrument for Authoring Assets, Drools Workbench.

droolsWorkbench

Assets, such as Rules and Models live in a package, which serves like a folder in Drools Workbench.
You can Copy and Rename a Package in the Drools Workbench.
droolsWorkbench2

Drools Guided Editor
BRMS 6 introduced a Guided Rule Editor, which is more convenient for business users.

The Guided Rule Editor is composed of three sections: WHEN, THEN and OPTIONS and allows users easily compose and edit rules.
guidedEditor

Assignments:
1. Answer QnAs.
2. Create at least one QnA and send to dean@ituniversity.us

References:
https://access.redhat.com/documentation/en-US/Red_Hat_JBoss_BRMS/6.2/pdf/User_Guide/Red_Hat_JBoss_BRMS-6.2-User_Guide-en-US.pdf

| Check Your Progress | Propose QnA | Have a question or comments for open discussion?

Have a suggestion? - shoot an email
Looking for something special? - Talk to me
Read: IT of the future: AI and Semantic Cloud Architecture | Fixing Education
Do you want to move from theory to practice and become a magician? Learn and work with us at Internet Technology University (ITU) - JavaSchool.com.

Technology that we offer and How this works: English | Spanish | Russian | French

Internet Technology University | JavaSchool.com | Copyrights © Since 1997 | All Rights Reserved
Patents: US10956676, US7032006, US7774751, US7966093, US8051026, US8863234
Including conversational semantic decision support systems (CSDS) and bringing us closer to The message from 2040
Privacy Policy