Thursday, April 17, 2014

Number One Vendor in Japan!!!!

Red Hat JBoss BRMS is number one BRMS vendor on Japan (Reported by ITR 2014)



Drools Decision Tables in OptaPlanner: Put the user in control of the score function

Wondering how to use Drools decision tables in OptaPlanner?
Take a look at this OptaPlanner blog post: Put the user in control of the score function.

Sunday, April 13, 2014

Come meet us at Red Hat Summit in SFO

This week, Red Hat Summit is taking place in San Francisco, and a lot of us (engineer, product management, solution architects, etc.) will be there at the Moscone Conference Center.  If you are attending Summit or DevNation (the developer-oriented conference co-located with Summit), feel free to come and see Mark Proctor's presentations on Drools / JBoss BRMS and/or my presentation on jBPM / JBoss BPM Suite.
There will be plenty of opportunities to meet us as well, like for example the DevNation hacknight on Wednesday, but should you want to meet up but can't find us, try reaching out to us on twitter, @markproctor or @KrisVerlaenen.
There will also be plenty of opportunity to go and watch one of the demos at the JBoss booth, and the Usability Team has set up booth as well where you can go and check out JBoss BPM Suite 6 and provide feedback, so definitely go take a look.
Hope to see you all there, hopping in my flight now !

Friday, April 11, 2014

Deploying kie-drools-wb on Tomcat

There have been a few emails recently to the Drools User mailing list stating problems deploying KIE Drools Workbench to Tomcat. We had a run of them shortly after the initial release of 6.0.1 too.

Suspecting there might be an issue I thought there be no better way to spend a Friday afternoon than to take a look and give it a try. In short I was able to deploy both 6.0.1 and 6.1.0-SNAPSHOT to Tomcat 7 with little problem.

Most of what I type below is already included in the Tomcat WAR's README.txt. This is tucked away inside the WAR and hence not blatantly obvious to some.

6.0.1

Starting with a clean install of Tomcat 7.

1. Copy "kie-tomcat-integration" JAR into TOMCAT_HOME/lib (org.kie:kie-tomcat-integration)
2. Copy "JACC" JAR into TOMCAT_HOME/lib (javax.security.jacc:artifactId=javax.security.jacc-api in JBoss Maven Repository)
3. Copy "slf4j-api" JAR into TOMCAT_HOME/lib (org.slf4j:artifactId=slf4j-api in JBoss Maven Repository)
4. Add valve configuration into TOMCAT_HOME/conf/server.xml inside <Host> element as last valve definition:

   <Valve className="org.kie.integration.tomcat.JACCValve" />

5. Edit TOMCAT_HOME/conf/tomcat-users.xml to include roles and users, make sure there will be 'analyst' or 'admin' roles defined as it's required to be authorized to use kie-drools-wb
6. Delete org.uberfire.security.auth.AuthenticationSource inside WEB-INF/classes/META-INF/services
7. Rename org.uberfire.security.auth.AuthenticationSource-TOMCAT-JEE-SECURITY to org.uberfire.security.auth.AuthenticationSource inside WEB-INF/classes/META-INF/services
8. Increase Java's PermGen space by adding file TOMCAT_HOME/bin/setenv.sh containing export JAVA_OPTS="-Xmx1024m -XX:MaxPermSize=256m"
9. Start Tomcat with TOMCAT_HOME/bin/startup.sh
10. Go to Management Console, http://localhost:8080/management
11. Deploy modified WAR

If you do not complete these steps the WAR works "out of the box" but you'll need to define Users in WEB-INF/classes/users.properties

6.1.0-SNAPSHOT

Starting with a clean install of Tomcat 7.

1. Copy "kie-tomcat-integration" JAR into TOMCAT_HOME/lib (org.kie:kie-tomcat-integration)
2. Copy "JACC" JAR into TOMCAT_HOME/lib (javax.security.jacc:artifactId=javax.security.jacc-api in JBoss Maven Repository)
3. Copy "slf4j-api" JAR into TOMCAT_HOME/lib (org.slf4j:artifactId=slf4j-api in JBoss Maven Repository)
4. Add valve configuration into TOMCAT_HOME/conf/server.xml inside Host element as last valve definition:

   <Valve className="org.kie.integration.tomcat.JACCValve" />

5. Edit TOMCAT_HOME/conf/tomcat-users.xml to include roles and users, make sure there will be 'analyst' or 'admin' roles defined as it's required to be authorized to use kie-drools-wb
6. Start Tomcat with TOMCAT_HOME/bin/startup.sh
7. Go to Management Console, http://localhost:8080/management
8. Deploy modified WAR

The differences between 6.0.1 and 6.1.0 are caused by where we've cleared up some of the code committed to the release branch in between releases.

Wednesday, April 09, 2014

Webinar (April 10th): Business Process Simulation

Get More Value out of BPM with BPSim Simulation

BPSim

Thursday, April 10th, 11:00AM Eastern

Business process design with BPMN2 can be complex, with many feasible options for implementing a business strategy. How can process designers evaluate alternative approaches before committing to a costly rollout of an untried process design?
Recently, there have been great strides in new process simulation tools, intended to answer this question and help analysts optimize their process designs before any real data is available to test them against. The BPSim standard is now emerging to provide a common framework for defining and exchanging simulation data in conjunction with BPMN2 models.
Join BPM.com's Nathaniel Palmer with guest Kris Verlaenen to learn how BPSim compatible tools can help you understand how business process designs will perform in practice, and where to look to improve and optimize them.
As part of the presentation we will see a live demonstration of Red Hat's new process simulation tool, included with JBoss BPM Suite. Attendees will also receive access to the developer version of BPM Suite, and the exclusive demonstration models used in the presentation.
Why You Should Attend:
  • Learn How to Use Business Process Simulation for Data-Driven Process Excellence
  • Gain Both Actionable Ideas and a Complete Working BPM Suite with Process Simulation Capabilities
  • Jumpstart Your BPM Programs With Pre-built and Ready-to-Run Simulation Models
Who Should Attend:
  • Business Architects and BPM Practitioners Looking to Get Started with Process Simulation
  • Business Analysts Seeking to Leverage BPM and Simulation for Data-Driven Process Optimization
  • Anyone Looking to Get Started with BPM, BPMN2 Process Modeling, or Process Simulation
Register Now

Nathaniel Palmer
CTO & VP, Business Process Management, Inc.
A best-selling author, practitioner, and rated as the #1 most influential thought leader in BPM by independent research, Nathaniel is co-author of a dozen books on innovation and knowledge work, including “Intelligent BPM” (FSI 2013), “How Knowledge Workers Get Things Done” (FSI 2012), “Social BPM” (Future Strategies), “Mastering the Unpredictable” (MK Press, 2008), “Excellence in Practice (FSI 2007), as well as the “Encyclopedia of Database Systems” (Springer Reference, 2007) and “The X-Economy” (Texere, 2001). Nathaniel has been the Chief Architect for projects involving investments of $200 Million or more, and frequently tops the lists of the most recognized names in his field. He was the first individual named as Laureate in Workflow.

Kris VerlaenenKris Verlaenen
jBPM Project Lead, Red Hat
Kris is the JBoss jBPM project lead and the lead technical architect behind the Red Hat JBoss BPM Suite 6. After finishing his Ph.D. in computer science in 2008, he joined JBoss. In 2010, he became the jBPM project lead. He also has a keen interest in the healthcare domain, one of the areas that has shown a great need for a flexible processes and advanced rule and event-processing integration.

Tuesday, April 08, 2014

Drools - Bayesian Belief Network Integration P2

A while back I mentioned I was working on Bayesian Belief Network integration, and I outlined the work I was doing around Junction Tree building, and ensuring we had good unit testing.
http://blog.athico.com/2014/02/drools-bayesian-belief-network.html

Today I finally got everything working end to end, including the the addition of hard evidence. The next stage is to integrate this into our Pluggable Belief System. One of the things we hope to do is use Defeasible style superiority rules as a way to resolving conflicting evidence.

For those interested, here is the fruits of my labours, showing end to end unit testing of the Eathquake example, as covered here.



Graph<BayesVariable> graph = new BayesNetwork();

GraphNode<BayesVariable> burglaryNode    = graph.addNode();
GraphNode<BayesVariable> earthquakeNode = graph.addNode();
GraphNode<BayesVariable> alarmNode      = graph.addNode();
GraphNode<BayesVariable> johnCallsNode  = graph.addNode();
GraphNode<BayesVariable> maryCallsNode  = graph.addNode();

BayesVariable burglary    = new BayesVariable<String>("Burglary", burglaryNode.getId(), new String[]{"true", "false"}, new double[][]{{0.001, 0.999}});
BayesVariable earthquake = new BayesVariable<String>("Earthquake", earthquakeNode.getId(), new String[]{"true", "false"}, new double[][]{{0.002, 0.998}});
BayesVariable alarm      = new BayesVariable<String>("Alarm", alarmNode.getId(), new String[]{"true", "false"}, new double[][]{{0.95, 0.05}, {0.94, 0.06}, {0.29, 0.71}, {0.001, 0.999}});
BayesVariable johnCalls  = new BayesVariable<String>("JohnCalls", johnCallsNode.getId(), new String[]{"true", "false"}, new double[][]{{0.90, 0.1}, {0.05, 0.95}});
BayesVariable maryCalls  = new BayesVariable<String>("MaryCalls", maryCallsNode.getId(), new String[]{"true", "false"}, new double[][]{{0.7, 0.3}, {0.01, 0.99}});

JunctionTree jTree;

@Before
public void setUp() {
    connectParentToChildren( burglaryNode, alarmNode);
    connectParentToChildren( earthquakeNode, alarmNode);
    connectParentToChildren( alarmNode, johnCallsNode, maryCallsNode);

    burglaryNode.setContent(burglary);
    earthquakeNode.setContent(earthquake);
    alarmNode.setContent( alarm );
    johnCallsNode.setContent( johnCalls );
    maryCallsNode.setContent( maryCalls );

    JunctionTreeBuilder jtBuilder = new JunctionTreeBuilder( graph );
    jTree = jtBuilder.build();
    jTree.initialize();
}

@Test
public void testInitialize() {
    JunctionTreeNode jtNode = jTree.getRoot();

    // johnCalls
    assertArray(new double[]{0.90, 0.1, 0.05, 0.95}, scaleDouble( 3, jtNode.getPotentials() ));


    // burglary, earthquake, alarm
    jtNode = jTree.getRoot().getChildren().get(0).getChild();
    assertArray( new double[]{0.0000019, 0.0000001, 0.0009381, 0.0000599, 0.0005794, 0.0014186, 0.0009970, 0.9960050 },
                 scaleDouble( 7, jtNode.getPotentials() ));

    // maryCalls
    jtNode = jTree.getRoot().getChildren().get(1).getChild();
    assertArray( new double[]{ 0.7, 0.3, 0.01, 0.99 }, scaleDouble( 3, jtNode.getPotentials() ));
}

@Test
public void testNoEvidence() {
    NetworkUpdateEngine nue = new NetworkUpdateEngine(graph, jTree);
    nue.globalUpdate();

    JunctionTreeNode jtNode = jTree.getRoot();
    marginalize(johnCalls, jtNode);
    assertArray( new double[]{0.052139, 0.947861},  scaleDouble( 6, johnCalls.getDistribution() ) );

    jtNode = jTree.getRoot().getChildren().get(0).getChild();
    marginalize(burglary, jtNode);
    assertArray( new double[]{0.001, 0.999},  scaleDouble( 3, burglary.getDistribution() ) );

    marginalize(earthquake, jtNode);
    assertArray( new double[]{ 0.002, 0.998},  scaleDouble( 3, earthquake.getDistribution() ) );

    marginalize(alarm, jtNode);
    assertArray( new double[]{0.002516, 0.997484},  scaleDouble( 6, alarm.getDistribution() ) );

    jtNode = jTree.getRoot().getChildren().get(1).getChild();
    marginalize(maryCalls, jtNode);
    assertArray( new double[]{0.011736, 0.988264 },  scaleDouble( 6, maryCalls.getDistribution() ) );
}

@Test
public void testAlarmEvidence() {
    NetworkUpdateEngine nue = new NetworkUpdateEngine(graph, jTree);

    JunctionTreeNode jtNode = jTree.getJunctionTreeNodes( )[alarm.getFamily()];
    nue.setLikelyhood( new BayesLikelyhood( graph, jtNode,  alarmNode, new double[] { 1.0, 0.0 }) );

    nue.globalUpdate();

    jtNode = jTree.getRoot();
    marginalize(johnCalls, jtNode);
    assertArray( new double[]{0.9, 0.1},  scaleDouble( 6, johnCalls.getDistribution() ) );

    jtNode = jTree.getRoot().getChildren().get(0).getChild();
    marginalize(burglary, jtNode);
    assertArray( new double[]{.374, 0.626},  scaleDouble( 3, burglary.getDistribution() ) );

    marginalize(earthquake, jtNode);
    assertArray( new double[]{ 0.231, 0.769},  scaleDouble( 3, earthquake.getDistribution() ) );

    marginalize(alarm, jtNode);
    assertArray( new double[]{1.0, 0.0},  scaleDouble( 6, alarm.getDistribution() ) );

    jtNode = jTree.getRoot().getChildren().get(1).getChild();
    marginalize(maryCalls, jtNode);
    assertArray( new double[]{0.7, 0.3 },  scaleDouble( 6, maryCalls.getDistribution() ) );
}

@Test
public void testEathQuakeEvidence() {
    NetworkUpdateEngine nue = new NetworkUpdateEngine(graph, jTree);

    JunctionTreeNode jtNode = jTree.getJunctionTreeNodes( )[earthquake.getFamily()];
    nue.setLikelyhood( new BayesLikelyhood( graph, jtNode,  earthquakeNode, new double[] { 1.0, 0.0 }) );
    nue.globalUpdate();

    jtNode = jTree.getRoot();
    marginalize(johnCalls, jtNode);
    assertArray( new double[]{0.297, 0.703},  scaleDouble( 3, johnCalls.getDistribution() ) );

    jtNode = jTree.getRoot().getChildren().get(0).getChild();
    marginalize(burglary, jtNode);
    assertArray( new double[]{.001, 0.999},  scaleDouble( 3, burglary.getDistribution() ) );

    marginalize(earthquake, jtNode);
    assertArray( new double[]{ 1.0, 0.0},  scaleDouble( 3, earthquake.getDistribution() ) );

    marginalize(alarm, jtNode);
    assertArray( new double[]{0.291, 0.709},  scaleDouble( 3, alarm.getDistribution() ) );

    jtNode = jTree.getRoot().getChildren().get(1).getChild();
    marginalize(maryCalls, jtNode);
    assertArray( new double[]{0.211, 0.789 },  scaleDouble( 3, maryCalls.getDistribution() ) );
}

@Test
public void testJoinCallsEvidence() {
    NetworkUpdateEngine nue = new NetworkUpdateEngine(graph, jTree);

    JunctionTreeNode jtNode = jTree.getJunctionTreeNodes( )[johnCalls.getFamily()];
    nue.setLikelyhood( new BayesLikelyhood( graph, jtNode,  johnCallsNode, new double[] { 1.0, 0.0 }) );
    nue.globalUpdate();

    jtNode = jTree.getRoot();
    marginalize(johnCalls, jtNode);
    assertArray( new double[]{1.0, 0.0},  scaleDouble( 2, johnCalls.getDistribution() ) );

    jtNode = jTree.getRoot().getChildren().get(0).getChild();
    marginalize(burglary, jtNode);
    assertArray( new double[]{0.016, 0.984},  scaleDouble( 3, burglary.getDistribution() ) );

    marginalize(earthquake, jtNode);
    assertArray( new double[]{ 0.011, 0.989},  scaleDouble( 3, earthquake.getDistribution() ) );

    marginalize(alarm, jtNode);
    assertArray( new double[]{0.043, 0.957},  scaleDouble( 3, alarm.getDistribution() ) );

    jtNode = jTree.getRoot().getChildren().get(1).getChild();
    marginalize(maryCalls, jtNode);
    assertArray( new double[]{0.04, 0.96 },  scaleDouble( 3, maryCalls.getDistribution() ) );
}

@Test
public void testEathquakeAndJohnCallsEvidence() {
    JunctionTreeBuilder jtBuilder = new JunctionTreeBuilder( graph );
    JunctionTree jTree = jtBuilder.build();
    jTree.initialize();

    NetworkUpdateEngine nue = new NetworkUpdateEngine(graph, jTree);

    JunctionTreeNode jtNode = jTree.getJunctionTreeNodes( )[johnCalls.getFamily()];
    nue.setLikelyhood( new BayesLikelyhood( graph, jtNode,  johnCallsNode, new double[] { 1.0, 0.0 }) );

    jtNode = jTree.getJunctionTreeNodes( )[earthquake.getFamily()];
    nue.setLikelyhood( new BayesLikelyhood( graph, jtNode,  earthquakeNode, new double[] { 1.0, 0.0 }) );
    nue.globalUpdate();

    jtNode = jTree.getRoot();
    marginalize(johnCalls, jtNode);
    assertArray( new double[]{1.0, 0.0},  scaleDouble( 2, johnCalls.getDistribution() ) );

    jtNode = jTree.getRoot().getChildren().get(0).getChild();
    marginalize(burglary, jtNode);
    assertArray( new double[]{0.003, 0.997},  scaleDouble( 3, burglary.getDistribution() ) );

    marginalize(earthquake, jtNode);
    assertArray( new double[]{ 1.0, 0.0},  scaleDouble( 3, earthquake.getDistribution() ) );

    marginalize(alarm, jtNode);
    assertArray( new double[]{0.881, 0.119},  scaleDouble( 3, alarm.getDistribution() ) );

    jtNode = jTree.getRoot().getChildren().get(1).getChild();
    marginalize(maryCalls, jtNode);
    assertArray( new double[]{0.618, 0.382 },  scaleDouble( 3, maryCalls.getDistribution() ) );
}


Sunday, April 06, 2014

Exercise 1: Public Training San Francisco 2014

In this opportunity we’ll go over one of the exercises you will be able to see in the Drools and jBPM Public Training. It involves rule execution for a particular case: 
 
We’re going to represent the scenario of a cat trapped on a limb, and all the things needed to provide solutions to the situation. For that, we will need:
  • Pet: with a name, a type and a position
  • Person: will have a pet assigned to him, and can call the pet down
  • Firefighter: Will be able to get the cat down from the tree as a last resort
Once we have a representation, we need to start defining rules to determine different types of situations and act accordingly: Rule “Call Cat when it is in a tree”
When my Cat is on a limb in a tree
  Then I will call my Cat
Rule “Call the Fire Department”
When my Cat is on a limb and it doesn’t come down when I call
  Then call the Fire Department Rule “Firefighter gets the cat down”
When the Firefighter can reach the Cat
  Then the Firefighter follows steps to retrieve the Cat
Each of these rules will have a specific DRL representation, based on the model we defined: rule "Call Cat when it is in a tree"
    when
        $p: Person($pet: pet, petCallCount == 0)
        $cat: Pet(this == $pet,
             position == "on a limb",
             type == PetType.CAT)
    then
        //$cat.getName() + " come down!"
        $p.setPetCallCount($p.getPetCallCount()+1);
        update($p); end rule "Call the fire department"
    when
        $p: Person($pet: pet, petCallCount > 0)
        $cat: Pet(this == $pet,
            position == "on a limb",
            type == PetType.CAT)
    then
        Firefighter firefighter = new Firefighter("Fred");
        insert(firefighter);
end rule "Firefighter gets the cat down"
    when
        $f: Firefighter()
        $p: Person($pet: pet, petCallCount > 0)
        $cat: Pet(this == $pet, position == "on a limb",
            type == PetType.CAT)
    then
        $cat.setPosition("on the street");
        update($cat);
        retract($f);
end
 


And then, some Java code to end up firing said rules:

KieServices kservices = KieServices.Factory.get(); KieSession ksession = kservices.getKieClasspathContainer().newKieSession();
Person person = new Person("John!");
Pet pet = new Pet("mittens", "on a limb",
Pet.PetType.CAT);
person.setPet(pet);
ksession.insert(person);
ksession.fireAllRules();


When we have these components defined, we will take advantage of the course to start modifying it to see how rules interact with each other, by:
  • Creating rules that insert dogs
  • Creating rules that make dogs chase cats that are on the same place as they are
  • Handling a firefighter that doesn’t show up
  • Anything you can think of!
Stay tuned for more info!

Friday, April 04, 2014

Drools Presentation at Square (SFO) : 11th of April

Friday the 11th of April, 11am, I'll be presenting internally at Square. So if your there, and want to know what we are up to with Drools, or interested in rules and event processing, then come along.

Mark

Thursday, April 03, 2014

devnation-logo

This year, Red Hat is organizing DevNation for the first time (April 13-17, San Francisco),  a new open source, polyglot conference for application developers and maintainers.  It combines for example the old JUDCon and CamelOne conferences, but offers top notch keynotes, sessions, labs, hackfests, and panels geared for those who build (with) open source.  It is _the_ place for a developer to get excellent technical information from the experts directly, and/or hang out with pizza and beer !

http://www.prlog.org/12222784-red-hat-summit-2013.jpg

Co-located is Red Hat Summit (April 14-17, San Francisco),  meant for anyone looking to exponentially increase their understanding of open source technology and identify powerful solutions for their business needs (although typically at a slightly higher level compared to DevNation). From community enthusiasts and system administrators to enterprise architects and CxOs, there are sessions and tracks for each level of interest and need.

This year, I'll be doing a "BRMS 6" presentation (available for both DevNation and Red Hat Summit attendees), giving a quick overview of the BRMS 6.0 features, but also sharing a lot of technical information on some of the most important new features, such as the new convention and configuration approach to building and deploying.

But this is just one tiny part of the huge amount of interesting keynotes, presentations, workshops, etc. you'll be able to attend.  Looking forward to speaking to some of you, or maybe even touching some code during the hackfest (bring your laptop and we'll get you started)!

Drop in Clinic
There will also be another all day drop in clinic, where Dr Kris Verlaenen (jBPM project lead) and I will be hanging out and coding all day. So you can drop in an hang out with us. Either to code, or ask questions or just admire Kris' big brain.

Building and Deploying with Red Hat JBoss BRMS 6
Mark Proctor — BRMS and BPMS Platform Architect

Tue April 15th, 3:40pm - 4:40pm
Red Hat JBoss BRMS 6 introduces a large number of new features and changes, with a strong focus on methodologies around building and deploying. In this session, Mark Proctor will explain:
  • Convention- and configuration-based approaches to authoring rule projects.
  • Building and deployment that is now aligned with Maven best practices.
  • A powerful, new, flexible, and extensible workbench that delivers an integrated web-based system for authoring and management.


You’ll learn everything that’s new in Red Hat JBoss BRMS 6 and how it can make delivering your projects easier than ever.

Friday, March 28, 2014

Drools & jBPM Public Training @San Francisco

If you're going to the Red Hat Summit on April, take advantage of this opportunity:

Plugtree is organizing a public training on Drools and jBPM the week after Red Hat Summit in the San Francisco area for April 21st to the 25th in four different modalities:

  • Drools: April 21st to 23rd
  • jBPM: April 21st, 24th and 25th
  • Full (Drools + jBPM): April 21st to the 25th

This workshop introduces Business Process and Rules Management, preparing you to be immediately effective in using both Drools and jBPM to improve your applications. In the training, we will cover:
  • All the different syntax for defining rules
  • Drools runtime configuration tricks
  • Writing BPMN2 files and projects from scratch, to the point of having runnable modules.
  • jBPM configuration to gain full control of your process-based applications.
  • Kie Workbench user guides, including tips for integration with other systems.
  • Integration tips for architectural design of rule-based and process-based applications.
If you're interested in this training, you can download the full agenda, or click here to register. You can contact us at training@plugtree.com if you have any questions. Hope to see you there!
We offer options for Drools only (days 1 to 3), jBPM only (days 1, 4 and 5) and full training (days 1 to 5). Everyone can assist these trainings, regardless of their attendance to the Red Hat Summit