People and Technology

May 13, 2007

Business Rules (Drools), Workflow (jBPM) and Seam - anybody want a training session?

Update: The presentation to the Irish Java Technologies Conference: Life and Death Workflow, using JBoss jBPM is partly based on this training session. (Link to Slides)

We’ve given Enterprise Java Training, Struts 2 Training (the most widely used Java-Web framework), and now it’s the turn of JBoss Rules (Drools) , Workflow (jBPM) and Seam. A lot of the material is coming from the forthcoming Masters Dissertation on Enterprise Web 2.0.

The course (summary below) is a private session. If there’s enough interest I’ll setup a public training session, or cut it back to 1 hour and do it as a ‘free’ intro session. If you can’t wait for that, Mark Proctor’s blog has a lot of useful rules information, and Tim Shadel has the pdf of a presentation that he gave in Phoenix Arizon on his blog.

Knowledge and Process Management

JBoss Rules, jBPM and Seam

Executive Briefing

Description: Success or failure in your business depends on dealing with information faster and better than your competitors. This briefing shows you how the JBoss Business Stack (Rules , jBPM and Seam) can do this and how to apply it to your organisation. Crucially, the briefing shows you when not to use these and details the alternative approaches.

The briefing will give delegates an overview of JBoss Rules within a web / enterprise development environment, how to architect an distribute rules within multi-tier applications and how to link these components with existing sources of information using Enterprise Application Integration (EAI).

Audience: This Briefing is suitable for IT Managers and Directors, IT project managers and technical staff who need an insight into the latest JBoss technologies and business processes, and business managers who need to be aware of the new application models and to give buy-in and commitment to applications developed within it.

Duration: Half-day

Objectives: On completion of this Briefing, delegates will:

  • Understand the benefits JBoss technologies offers your business and the key areas where it should be used.
  • Know how to successfully use JBoss Rules, jBPM and Seam with new and existing systems and technologies, including the use of Enterprise Application Integration (EAI).
  • Be able to boost projects using pre-built components and frameworks and be able to choose the right one for their needs.
  • Be aware of the main precepts of good application design within the Java component framework, as well as knowing the main Enterprise Java architecture components, terminology and acronyms and their interaction.
  • Understand how end-to-end applications are built using the JBoss frameworks (Rules, jBPM, Seam) and appreciate their organisational impact.

Presenter Biography

Paul Browne has 13 years experience delivering IT Projects in the Financial, IT/ Telecoms, Pharmaceutical and Public sectors. An author on JBoss Rules for O’Reilly Books, he has delivered courses for Limerick Institute of Technology, Siemens, Dell, Trigraph and IACT. Holding a Degree in Business from UUC, he is awaiting conferral of an Msc. in Advanced Software Engineering from UCD.

Briefing Content

Introduction and Problem Space

  • Delegate introduction
  • Trainer introduction
  • Course introduction
  • The problem we are trying to solve
  • Who is JBoss
  • 3 Tier Applications
  • What is a rule engine
  • Alternatives using Java
  • Alternatives to Rules
  • Alternative Rule Engines
  • Section Summary / Intro to next section

Rule Engine overview

    • Business Rules (examples)
    • Sample Business Uses
    • If then statements - can we do better?
    • Rete Algorithm
    • Forward and Backward Chaining
    • Domain Specific Languages (DSL)
    • Decision Tables (what the user sees)
    • Decision Tables (for the Developer)
    • Rule Editors
    • JBoss IDE (Red Hat Tools)
    • Advanced Rule Language
    • System Development Roles
    • Section Summary / Intro to next section

    Integration and Deployment

    • Web environment
    • 3 Tier system
    • Integration with Spring
    • Integration with EJB
    • What is workflow
    • What is jBPM
    • What is Seam
    • Seam and JSF
    • Seam and jBPM
    • Drools.Net
    • Section Summary
    • Course Summary and Feedback

39 Comments »

  1. I’d certainly be interested in hearing more about that..

    Comment by John McClean — May 14, 2007 @ 9:35 am

  2. John,

    I’ll probably see how the (private) training session goes, then see if the Java meetup / Developer.ie are interested in a 1hr version of the topic.

    Paul

    Comment by admin — May 14, 2007 @ 11:56 am

  3. [...] For these simple websites , using Enterprise Java is like using a sledgehammer to crack a walnut - you’re much better off using a solution like Ruby on Rails. Off course, once you go off the usual path (e.g. to implement complex business rules and workflow) things become a lot more difficult. That’s how we make a living - a post for another day. [...]

    Pingback by The last Rails For All mail you will ever get, maybe - Technology in plain English - Dublin Ireland — May 16, 2007 @ 7:36 am

  4. Hi John,

    Please tell me about how to integrate Drools with Springs.

    it very urgent for me …

    please help me…

    Regards;
    Suresh

    Comment by suresh kumar — May 18, 2007 @ 12:16 pm

  5. Hi John,

    Please tell me about how to integrate Drools with Springs.

    it very urgent for me.
    please help me.

    Regards;
    Suresh

    Comment by suresh kumar — May 18, 2007 @ 12:17 pm

  6. Hi John,

    Please tell me about how to integrate Drools with Springs.

    it is very urgent for me.
    please help me.

    Regards;
    Suresh

    Comment by suresh kumar — May 18, 2007 @ 12:18 pm

  7. Suresh,

    It’s easy to integrate Drools with Spring.

    1) Write a normal Spring Bean, with getter / setter methods as to where the Decision table or DRL File comes from

    2) Add the method to load the DRL / Decision table from the classpath: sample in this section: http://www.firstpartners.net/kb/index.php/JBoss_DSL#Java_Code_to_load_rules_from_classpath

    3)Fire the rules - a sample on how to do this is here (although you probably don’t need the DSL):
    http://www.firstpartners.net/kb/index.php/JBoss_DSL#Java_Code_to_run_this

    Hope this helps

    Paul

    Comment by admin — May 18, 2007 @ 12:21 pm

  8. Thanks Paul,

    but i need complete process, becoze i am new to springs

    so please help me.

    regards;
    Suresh;
    suresh0214@gmail.com

    Comment by suresh kumar — May 18, 2007 @ 12:47 pm

  9. Suresh,

    You have 2 questions:

    1) How Spring works. Big question - best place to start is the Spring documentation. Write a simple Spring Bean (Hello World)

    2) How to make a call to Drools / JBoss rules.

    Remember that *all* the Java code you write is normal Java - it is unaware that it is being managed by Spring.

    So your call to Drools / DRL is just a normal java call - (as per the links). Put the sample Java to call drools (the link from earlier) code into your ‘Hellow world sample).

    If you need a complete sample, try downloading the Red-Piranha source code.
    http://red-piranha.sourceforge.net

    Comment by admin — May 18, 2007 @ 12:52 pm

  10. Hi Paul,

    Drools Integration with Spring
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    First thanks for your guides,

    but clear me where and how to call a .drl file in spring.

    i am using MyEclipse 5.5, if there i need any jar files please tell me that i can download.
    My project end date is 23rd of this month so please help me. This is my academic project i am doing MCA final year from the university of Hyderabad, India(www.uohyd.ernet.in), if i didn’t present my project before that my all effort will waste so please help me. i need step by step process, and any required jar files, are these are open source
    please do needful. if you have any demo application please mail me i will refer it.

    “waiting for your response”

    Thanks and Re grads;
    SURESH

    Comment by suresh kumar — May 21, 2007 @ 11:07 am

  11. Hi Pual,

    i didnt get any reply till now please help me.

    sir its my education life please help me.

    thanks and regards;

    SURESH

    Comment by suresh kumar — May 21, 2007 @ 12:05 pm

  12. Hi Pual,

    i didnt get any reply till now please help me.

    sir its my education life please help me.

    thanks and regards
    SURESH

    Comment by suresh kumar — May 21, 2007 @ 12:12 pm

  13. Suresh,

    The information you need was linked to from a previous post: http://www.firstpartners.net/kb/index.php/JBoss_DSL#Java_Code_to_load_rules_from_classpath

    Paul

    Comment by admin — May 21, 2007 @ 12:26 pm

  14. Hi Paul,

    i agree with that you already provided me one example. What are jar files to need to integrate drools with spring.
    if possible please give a sample project that can help me.
    please Paul help me.

    Thanks and Regards;
    Suresh

    Comment by suresh kumar — May 21, 2007 @ 12:38 pm

  15. Suresh,

    There is no ‘integration’ needed- the jar files you need are those listed on the Spring and JBoss rules websites.

    Paul

    Comment by admin — May 21, 2007 @ 12:57 pm

  16. Thanks Paul,

    i have complete all the process, but i am confused where the spring class called.

    can you tell me how to create spring class and from where i should call.

    regards;
    Suresh

    Comment by suresh kumar — May 22, 2007 @ 9:49 am

  17. and another confusion with from where i can call drl file,
    the “log.*” is not working.
    help me

    Comment by suresh kumar — May 22, 2007 @ 10:10 am

  18. and another confusion with spring program,, from where i can call drl file and how will i run it,
    the “log.*” is not working.
    help me

    Comment by suresh kumar — May 22, 2007 @ 11:08 am

  19. Paul sir help.

    Comment by suresh kumar — May 22, 2007 @ 11:53 am

  20. Hi Paul,

    This is dharavatu, i have one doubt i wrote all drl files and a java(drool) program to fire all rules.

    It is execute and i get output also but the problem is how i can integrate with spring i have created a spring beans also, but i didnt where i can cal drl file and how can i execute that drl file in spring beans give me a brief idea on this

    thanks and regards;
    Dharavatu

    Comment by dharavatu — May 22, 2007 @ 2:02 pm

  21. Dharavatu,

    The answer is really really simple.

    You put the ‘call drools’ code you have just written inside a plain old java object.

    You then configure the pojo using Spring in the normal manner.

    This assumes that you do all DB access *outside* of drools (using something like Spring / Hibernate) and then assert the the data into Drools working memeory (like any other Java Object).

    Paul

    Comment by admin — May 22, 2007 @ 2:50 pm

  22. Hi Paul,

    I tried a lot but there are lot of errors.
    can u give me any example code for this.

    i totally stuck here :(
    waiting for ur reply.

    thanks;
    Dharavatu

    Comment by dharavatu — May 24, 2007 @ 10:45 am

  23. Dharavatu,

    Can you be more specific as to the problem that you are having?

    Paul

    Comment by admin — May 24, 2007 @ 12:04 pm

  24. Respected sir,

    i am asking u lot of times about drools integration with springs, if you r really a helpful person so please help sir. I tried a lot but i didnt get its out put please sir help me. i beg u. please do needful

    i am full of problems almost all my project completion date comes but i didnt get ant integration resources about drools and spring.
    so please help me sir,

    my project life cycle is like this :

    JSF(UI) + Spring + Drools
    and for Data i am Hibernate

    so please help me sir,

    Thanks and Regards;
    Suresh;

    Comment by suresh kumar — May 25, 2007 @ 7:25 am

  25. Suresh,

    I am still unclear as to (a) the problem that you have and (b) the steps you have taken so far to solve it.

    Once I know this , then I can begin to help.

    This is a good guide on how to ask for techical help: http://www.catb.org/~esr/faqs/smart-questions.html

    Paul

    Comment by admin — May 25, 2007 @ 7:37 am

  26. Drools looks interesting but I’d suggest dropping Seam training and swapping it with JRuby on Rails.

    Comment by Thomas — August 25, 2007 @ 8:03 pm

  27. Thomas

    I think Seam was requested by the client on this ; the advantage being that it comes from JBoss and makes integration easier.

    On the other hand, Seam doesn’t have anything like the buzz / traction that (J)Ruby on Rails does.

    Paul

    Comment by admin — August 25, 2007 @ 10:17 pm

  28. [...] Disclaimer: I’ll be talking about Java Workflow (based on on JBoss jBPM). But compared to these guys, I’m way down on the Z-List of presenters. [...]

    Pingback by Technology and People - Top 10 Speakers at the Irish Java Technologies Conference (IJTC Dublin) — October 25, 2007 @ 1:56 pm

  29. Hi,

    I have following queries ragarding Drools(JBoss Rule Engine).
    1) How we can define drl files in xml format? Is there any specific setting for the same?
    2) org.drools.DroolsException and org.drools.io.RuleBaseLoader can not be resolved. Is there any jar file that i am missing.
    3) newWorkingMemory( ) method is not supported by RuleBase and assertObject(StockOffer ) method is also not supported by Working Memory. Are there any alternative?
    4) It will be great if i will be having any working example of web application which interacts with Drools.

    Comment by Mukesh Anand Chaurasia — March 26, 2008 @ 10:14 am

  30. Mukesh,

    If you’re following the OnJava / OReilly sample , you should be aware that the Rules format and API has changed substantially from version 2 to the current version 4.5.

    The best place to start for examples and more documentation is the Drools Website
    http://labs.jboss.com/drools/

    Paul

    Comment by Paul Browne — March 26, 2008 @ 12:17 pm

  31. Thanks for your reply Paul….
    can you please give me idea about the problem like..
    i want to call drools rule engine from a web application. how i can do the same.
    The example drools-insurance given in the drools-example folder is not working.
    I am using drools 4.0.4..

    Thanks and Regards,
    Mukesh Anand Chaurasia

    Comment by Mukesh Anand Chaurasia — March 26, 2008 @ 12:56 pm

  32. Hi,

    Can any1 tell me how to call jbpm rules file using java program? i din’t integrate drools with jbpm. Is it possible to call …..pls help me out

    Comment by Raji — October 3, 2008 @ 11:27 am

  33. Hi,

    Im new to Jboss Drools. Im using this for my project work. I want to know whether using excel for rules very important. Will writing rules in a .drl file is alone sufficient. If Excel sheet is required how to write in and link it with java file.
    I have tried a sample rules in drl it works. Now how can i call it from a standalone java program. Im using Eclipse 3.2. can anyone help me??

    Regards,
    Joyce

    Comment by Joyce — March 12, 2009 @ 6:21 am

  34. Hi ,
    My application is being developed in Jdeveloper(jdk 1.4).Am using drools as rule engine.
    In my .drl file when I place two rules whose consequence parts just contains “System.out.println(”Some message”);” it works fine.
    But when I try to call any method instead of sop, it hangs at

    builder.addPackageFromDrl(new InputStreamReader(MyDrools.class.getResourceAsStream(”/abc.drl”)));

    Am not getting compilation errors.

    The same code works fine with Eclipse.
    Can anyone tell me what the problem is?

    Comment by Arc — April 16, 2009 @ 2:58 pm

  35. Arc,

    I’m going to suggest two actions;

    1) You post the message on the Drools Mailing list :-)
    2) You buy my lovely book which may or may not be able to help these and other queries (available at http://www.amazon.co.uk/dp/1847196063?tag=firstparnet-21&camp=1406&creative=6394&linkCode=as1&creativeASIN=1847196063&adid=03Q2J1X56NT3Y16NQMMQ&)

    I would check the compatibility of the version of drools that you are using with version 1.4

    Paul

    Comment by Paul Browne — April 16, 2009 @ 8:33 pm

  36. Hi,

    I am working on drools. I have a problem, i have given some rules in the .drl file and it is working.
    The same i tried using decision table but i am getting the following errors.

    Enter Name:
    gfd
    Enter age:
    21
    Enter Natioanality:
    sdvfsd
    Enter Monthly Income:
    13122
    Enter Years of Permanent Employment(in months):
    23
    org.drools.rule.InvalidRulePackage: Duplicate declaration for variable ‘loanApp’ in the rule ‘LoanApplication_11′ : [Rule name=LoanApplication_11, agendaGroup=MAIN, salience=0, no-loop=false]
    Duplicate declaration for variable ‘loanApp’ in the rule ‘LoanApplication_11′ : [Rule name=LoanApplication_11, agendaGroup=MAIN, salience=0, no-loop=false]
    Unable to return Declaration for identifier ‘Indian’ : [Rule name=LoanApplication_11, agendaGroup=MAIN, salience=0, no-loop=false]
    Unable to create restriction ‘[VariableRestriction: == Indian ]‘ for field ‘nationality’ in the rule ‘LoanApplication_11′ : [Rule name=LoanApplication_11, agendaGroup=MAIN, salience=0, no-loop=false]
    Duplicate declaration for variable ‘loanApp’ in the rule ‘LoanApplication_11′ : [Rule name=LoanApplication_11, agendaGroup=MAIN, salience=0, no-loop=false]
    Duplicate declaration for variable ‘loanApp’ in the rule ‘LoanApplication_11′ : [Rule name=LoanApplication_11, agendaGroup=MAIN, salience=0, no-loop=false]
    Duplicate declaration for variable ‘loanApp’ in the rule ‘LoanApplication_12′ : [Rule name=LoanApplication_12, agendaGroup=MAIN, salience=0, no-loop=false]
    Duplicate declaration for variable ‘loanApp’ in the rule ‘LoanApplication_12′ : [Rule name=LoanApplication_12, agendaGroup=MAIN, salience=0, no-loop=false]
    Unable to return Declaration for identifier ‘Pakistan’ : [Rule name=LoanApplication_12, agendaGroup=MAIN, salience=0, no-loop=false]
    Unable to create restriction ‘[VariableRestriction: == Pakistan ]‘ for field ‘nationality’ in the rule ‘LoanApplication_12′ : [Rule name=LoanApplication_12, agendaGroup=MAIN, salience=0, no-loop=false]
    Duplicate declaration for variable ‘loanApp’ in the rule ‘LoanApplication_12′ : [Rule name=LoanApplication_12, agendaGroup=MAIN, salience=0, no-loop=false]
    Duplicate declaration for variable ‘loanApp’ in the rule ‘LoanApplication_12′ : [Rule name=LoanApplication_12, agendaGroup=MAIN, salience=0, no-loop=false]
    Rule Compilation error : [Rule name=LoanApplication_11, agendaGroup=MAIN, salience=0, no-loop=false]
    org/openbank/rules/resource/Rule_LoanApplication_11_0.java (7:373) : Approved cannot be resolved
    Rule Compilation error : [Rule name=LoanApplication_12, agendaGroup=MAIN, salience=0, no-loop=false]
    org/openbank/rules/resource/Rule_LoanApplication_12_0.java (7:373) : Not cannot be resolved
    org/openbank/rules/resource/Rule_LoanApplication_12_0.java (7:377) : Syntax error on token “Approved”, delete this token

    null
    at org.drools.rule.Package.checkValidity(Package.java:424)
    at org.drools.common.AbstractRuleBase.addPackage(AbstractRuleBase.java:394)
    at org.openbank.rules.RulesExec1.readDecisionTable(RulesExec1.java:119)
    at org.openbank.rules.RulesExec1.executeXLS(RulesExec1.java:66)
    at org.openbank.rules.RulesExec1.main(RulesExec1.java:41)

    can u help me out please..

    Regards,
    Joyce

    Comment by Joyce — April 24, 2009 @ 7:41 pm

  37. Hi,

    How can i integrate Drools with JSF.

    can u please help.

    Regards
    Joyce

    Comment by Joyce — April 24, 2009 @ 7:57 pm

  38. @Joyce

    Best way of integrating Seam and Drools is to use Seam - all three are JBoss products, work well together as well as with the JBoss extensions for Eclipse. I’d check out jboss.org for more information.

    Comment by Paul Browne — April 26, 2009 @ 8:09 pm

  39. Hi,I’m new of drools.
    How can I save the roles of .drl file in a Clob in a postgres DB?Can someone help me?!?!?please!
    Regards
    Max

    Comment by max — May 21, 2009 @ 12:11 am

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by WordPress