Diego Adrian Naya Lazo has just published an OSWorkflowBook “OSWorkflow: A guide for Java developers and architects to integrating open-source Business Process Management”. I’ve no idea if the book is any good or not but it has a whole chapter on Drools integration:Chapter 5 introduces and integrates Rules engine and Drools open source rule engine.Read more →
I’ve no idea if the book is any good or not but it has a whole chapter on Drools integration: Chapter 5 introduces and integrates Rules engine and Drools open source rule engine.
So if anyone reads this book, please do post us a review we can place here. And Diego, any chance you could email me chapter 5, as a free sample 🙂
What I found more interesting is that a non JBoss workflow engine put in a chapter about Drools integration, but the JBoss jBPM book “Business Process Management with JBoss jBPM” didn’t. I did notice that the book refers to us as just Drools, I hope somewhere prominently in the chapter that JBoss are given credit.
Drools 4.0.1 will include SubFlow and Milestone support, below shows a screenshot of the new pallet. For more information on WorkFlow patterns see http://workflowpatterns.com. Drools 4.0.1 will also include a new Number Guess example that shows a recursive rule flow. Here you can see the Rule Flow branch constraint editor with context assist. As mentionedRead more →
Drools 4.0.1 will include SubFlow and Milestone support, below shows a screenshot of the new pallet. For more information on WorkFlow patterns see http://workflowpatterns.com.
Drools 4.0.1 will also include a new Number Guess example that shows a recursive rule flow.
Here you can see the Rule Flow branch constraint editor with context assist. As mentioned before our constraint editor gives you full access to the Drools “when” conditional language and that constraint lives as an actual rule reasoning over the Working Memory, allowing for very powerful constraints to be expressed.
Finally here you can see how easy it is to add rules in the drl to a ruleflow-group, its just a simple attribute. Complex process behavioural modelling has never been so easy 🙂
As promised I finally got round to updating the popular Conways Game of Life example so it can be executed with both agenda-groups and ruleflows for execution control. So now people have a good example to study when trying to learn the two concepts. (click to enlarge images). With agenda-groups we specify the stack executionRead more →
As promised I finally got round to updating the popular Conways Game of Life example so it can be executed with both agenda-groups and ruleflows for execution control. So now people have a good example to study when trying to learn the two concepts. (click to enlarge images).
With agenda-groups we specify the stack execution order for each group, in the java code. With ruleflow we instead specify the process id of the ruleflow: Here you can see the ruleflow for the above process id, notice how “birth” and “kill” are executed in parallel: This code is in trunk, and will be part of the next release for drools-examples.
From working on this example what has become obvious is we need support for sub ruleflows, so that we can have a parent ruleflow choreographing all the ruleflows in the application, which is currently being done from java code.
Code completion has just been added to the constraint editor for ruleflow ‘splits’ and ‘joins. ‘and’, ‘or and ‘xor’ type logic can be applied and the constraint used for each branch. The same constraint language is used as the left hand side (LHS) ‘when’ part of a rule, and that constraint monitors the Working Memory.Read more →
Code completion has just been added to the constraint editor for ruleflow ‘splits’ and ‘joins. ‘and’, ‘or and ‘xor’ type logic can be applied and the constraint used for each branch. The same constraint language is used as the left hand side (LHS) ‘when’ part of a rule, and that constraint monitors the Working Memory. When the ruleflow enters the ‘split’ or ‘join’ it is only true if that LHS for the Working Memory is true. This provides extremely powerful Ruleflow modelling, bring the true power of rules to workflow, in a fully integrated fashion.
Simple Ruleflow showing the Code Completion for a constraint
Code Completion showing the available fields
Code Completion showing the valid operators for the “message” field.
The end result, of course mode complex constraints can be built.
Kris has worked his magic again and it’s now possible to make decisions on ‘split’ and ‘join’ nodes in Rule Flow. ‘split’ nodes now support ‘and’, ‘or’ and ‘xor’ type decisions while ‘join’ supports ‘and’ and ‘or’. The beautiful part of this is its fully tooled and the decisions are specialised rules, so you canRead more →
Kris has worked his magic again and it’s now possible to make decisions on ‘split’ and ‘join’ nodes in Rule Flow. ‘split’ nodes now support ‘and’, ‘or’ and ‘xor’ type decisions while ‘join’ supports ‘and’ and ‘or’. The beautiful part of this is its fully tooled and the decisions are specialised rules, so you can leverage the facts in the working memory and our powerful rule language.
The first screenshot (click to enlarge) shows the Constraint Editor on a ‘split’ node with an entry for each branch. At the bottom you will see the standard properties editor with the properties for the ‘split’ node, the node type is ‘xor’ and if you click the dotted builder icon on the constraints property it opens the Constraint Editor. This screenshot (click to enlarge) shows the form used while editing the constraints for a particular branch. Note how you can use standard left hand side (LHS) language statements. We still have to get context assist and code highlighting into the editor, but that will be coming soon, I just have to persuade Kris to give up sleep this weekend 🙂
A new feature has been added to the JBoss Rules code, allowing users to create a graphical flow chart that defines the order in which rule sets should be evaluated. This blog shows some examples on how to use ruleflow. Ruleflow will be available in the next milestone release, and really anxious users can alreadyRead more →
A new feature has been added to the JBoss Rules code, allowing users to create a graphical flow chart that defines the order in which rule sets should be evaluated. This blog shows some examples on how to use ruleflow. Ruleflow will be available in the next milestone release, and really anxious users can already try it by building the latest version on svn.
JBoss Rules already provides some functionality to define the order in which rules should be executed, like salience, activation groups, etc. When dealing with (possibly a lot of) large rule sets, managing the order in which rules are evaluated might become complex. Ruleflow allows you to specify the order in which rule sets should be evaluated by using a flow chart. This allows you to define which rule sets should be evaluated in sequence or in parallel, to specify conditions under which rule sets should be evaluated, etc. Here are two examples of a ruleflow:
<sampleruleflow1.gif>Figure 1: A ruleflow showing a simple sequence of two ruleflow-groups that makes sure that all rules responsible for validating orders are checked first before trying to process these orders. </sampleruleflow1.gif>
Figure 2: A more advanced ruleflow showing parallelism, conditional evaluation of rule sets (e.g. the rule set responsible for processing orders should only be executed if no errors were found when checking the order) and looping.
The JBoss Rules IDE has also been extended to allow the creating of these ruleflows: * A new editor for creating ruleflow files (.rf), as shown in the next screenshot. Whenever you try to save such a ruleflow file, a corresponding model file (.rfm) is created that contains the definition of the ruleflow. The ruleflow file (.rf) contains the graphical information. A wizard for creating a new ruleflow file.
Ruleflow definitions can be added to a RuleBase almost the same way rules are added to one:
// create a package containing all the rules final PackageBuilder builder = new PackageBuilder(); builder.addPackageFromDrl( new InputStreamReader( getClass().getResourceAsStream( "rules.drl" ) ) ); final Package pkg = builder.getPackage();
// create a new process containing the ruleflow ProcessBuilder processBuilder = new ProcessBuilder(); processBuilder.addProcessFromFile(new InputStreamReader( getClass().getResourceAsStream( "ruleflow.rfm" ) ) );
// add the package and the processes to the RuleBase final RuleBase ruleBase = RuleBaseFactory.newRuleBase(); ruleBase.addPackage( pkg ); ruleBase.addProcess( processBuilder.getProcesses()[0]);
// create a new working memory for this RuleBase final WorkingMemory workingMemory = ruleBase.newWorkingMemory();
Ruleflows can then be started by
// add elements to the working memory here, then start // the ruleflow to start executing the first ruleset workingMemory.startProcess(1);
More details on how to use ruleflow will be added in the near future. We are however already interested in getting some feedback about the usefulness and useability of ruleflows, and possibly some extension you might find interesting.