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. 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

  2. Hi John,

    Please tell me about how to integrate Drools with Springs.

    it very urgent for me …

    please help me…

    Regards;
    Suresh

  3. Hi John,

    Please tell me about how to integrate Drools with Springs.

    it very urgent for me.
    please help me.

    Regards;
    Suresh

  4. Hi John,

    Please tell me about how to integrate Drools with Springs.

    it is very urgent for me.
    please help me.

    Regards;
    Suresh

  5. 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

  6. 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

  7. 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

  8. Hi Pual,

    i didnt get any reply till now please help me.

    sir its my education life please help me.

    thanks and regards;

    SURESH

  9. Hi Pual,

    i didnt get any reply till now please help me.

    sir its my education life please help me.

    thanks and regards
    SURESH

  10. 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

  11. 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

  12. 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

  13. 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

  14. 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

  15. 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

  16. 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;

  17. 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

  18. 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.

  19. 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

  20. 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

  21. 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

  22. 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?

  23. 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

  24. @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.

  25. 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

Leave a Reply to Thomas Cancel reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s