Wednesday, April 30, 2014

Decision Camp 2014 : Call for Speakers : Oct 13-15, San Jose



Decision Camp is on again for 2014, registration is now open.

Picture

Who Should Attend

Practitioners are Business Analysts or Business Experts, Developers or Architects that
use or consider using Decision Management technologies such as Business Rules, Predictive Analytics, Business Intelligence
and Decision Optimization

Join practitioners like you as well as the renowned experts from industry, coming from consulting companies and technology vendors
Picture

Why Attend

Decision CAMP is the
first event for Decision Management practitioners.

It is filled with hands-on activities and insightful experience-sharing sessions.​

If you are new to Business Rules or Predictive Analytics, join us to speed up your learning curve and get more out of those technologies

The Call for speakers is now also open:

Who should submit an abstract

We are looking for keynotes, case studies, general sessions, and technical workshops. We are particularly looking for case studies.If you are a Business Analyst, Rules Writer, Rules Analyst or Rules Architect, and your job function includes harvesting, eliciting, capturing business rules, or more generally speaking decision logic, 
then you are the perfect speaker for the event!

If you are an Enterprise Architect, head of Software Development, or Software Architect, and your job function includes the integration of business rules / decision management technologies in your systems,
then you are a wonderful speaker too!

We are looking for practitioners from both sides.


Submissions will not be selected if they appear to directly promote any products or services, or are of a commercial nature.

Wednesday, April 23, 2014

jBPM accepted on Google Summer of Code 2014!

I'm thrilled to share with the whole Drools & jBPM community that once again a student has being accepted in the Google Summer Of Code Program to work in the projects for the Summer. This year Google will be funding  Nicolas Gomes (from Argentina) to work on the jBPM project. Nicolas task will be to work towards the integration of the KIE Workbench with a Content Management System such as Magnolia.
GSoC 2013
The integration will involve the backend services and front end screens to work with documents from end to end.
Here you can find all the accepted projects this year (2014):
Nicolas has also started a blog where he will sharing the integration progress,
You can also follow him on twitter:
twitter: @nicolasegomez
As I will be mentoring the work, I will be also sharing some updates and videos about how the work is being done. So stay tuned and feel free to leave comments in Nicolas' blog regarding his proposals for the work that needs to be done. If you are looking to do something similar please get in touch with Nicolas or with myself so we can coordinate the work.



Tuesday, April 22, 2014

New feature overview : PMML

Today, I'll introduce a new 6.1 experimental feature, just being released from our incubator: Drools-PMML.

I'll spend the next days trying to describe this new module from the pages of this blog. Some of you, early adopters of Drools-Scorecards, will probably have heard the name. Thanks to the great work done by Vinod Kiran, PMML was already living inside that module. However, the Predictive Model Markup Language (www.dmg.org) is much more than that. It is a standard that can be used to encode and interchange classification and regression models such as neural networks or decision trees. These quantitative models complement nicely the qualitative nature of business rules.

So, how does it work? Exactly like with all other KIE assets such as processes, rules or decision tables. First, you have to create the model: there are plenty of statistical/data mining softwares that generate or consume PMML. In the future, even Drools might be able to do that!
Once you have your model, just deploy it in your Kie Module and let it become part of your Kie Base. Betting you are now familiar with the kmodule.xml configuration, let me show an example using the programmatic APIs:
String pmmlSource = // ... path to your PMML file
KieServices ks = KieServices.Factory.get(); KieFileSystem kfs = ks.newKieFileSystem(); kfs.write( ResourceFactory.newClassPathResource( pmmlSource ) .setResourceType( ResourceType.PMML ) ); ks.newKieBuilder( kfs ).buildAll().getResults(); KieSession kSession = ks.newKieContainer( ks.getRepository().getDefaultReleaseId() ) .newKieSession();
Let's imagine that you have a predictive model called "MockColdPredictor". It is used to predict the probability of catching a cold given the environmental conditions. It has one input called "temperature" and one output "coldProbability". The most basic way to invoke the model is to insert the input value(s) using a generated entry-point:

ksession.getEntryPoint( "in_Temperature" ) // "in_" + input name (capitalized)
        .insert( 32.0 );                   // the actual value
ksession.fireAllRules();

The result will be generated and can be extracted, e.g., using a drools query:

QueryResults qrs = kSession.getQueryResults(
                       "ColdProbability",   // the name of the output (capitalized)
                       "MockColdPredictor", // the name of the model
                       Variable.v );        // the Variable to retrieve the result
Double probability = (Double) qrs.iterator().next().get( "$result" );

In the future posts, we'll discuss in detail how PMML defines models, input and output fields. Based on this, we'll see how to integrate models and which options are available.

At the moment, these model types are supported:
  • Clustering
  • Simple Regression
  • Naive Bayes
  • Neural Networks
  • Scorecards
  • Decision Trees
  • Support Vector Machines
The version of the standard is 4.1. The support for these models is being consolidated, and more will be added soon. 

Behind the scenes: the models are interpreted: that is, they are converted to an appropriate combination of rules and facts that emulate the calculations. A compiled version, where the models are evaluated directly, is possible and will be added in the future. So, the evaluation is slower than a "native" engine. The  goal is not to prove that production rules can outperform matrix operations at... doing matrix math :) Rather, the idea is to provide a uniform abstraction of a hybrid knowledge base, making it easier to integrate rule and non-rule based reasoning.

So, my next post will describe the structure of a PMML model.
Stay tuned!
-- Davide

Disclaimer: as a new feature, it is likely to suffer from bugs and issues. Feedback will be welcome.

Acknowledgments :
Thanks to the University of Bologna (Bologna, Italy), the KMR2 Project and Arizona State University (Scottsdale, AZ) which, over time, have supported this project.

Publications (more to follow) :
- D. Sottara, P. Mello, C. Sartori, and E. Fry. 2011. Enhancing a Production Rule Engine with Predictive Models using PMML. In Proceedings of the 2011 workshop on Predictive markup language modeling (PMML '11). ACM, New York, NY, USA, 39-47. DOI=10.1145/2023598.2023604 http://doi.acm.org/10.1145/2023598.2023604

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 Part 2

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.