<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://training-course-material.com/index.php?action=history&amp;feed=atom&amp;title=JBPM_and_Drools_Introduction</id>
	<title>JBPM and Drools Introduction - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://training-course-material.com/index.php?action=history&amp;feed=atom&amp;title=JBPM_and_Drools_Introduction"/>
	<link rel="alternate" type="text/html" href="https://training-course-material.com/index.php?title=JBPM_and_Drools_Introduction&amp;action=history"/>
	<updated>2026-05-25T02:44:20Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>https://training-course-material.com/index.php?title=JBPM_and_Drools_Introduction&amp;diff=63432&amp;oldid=prev</id>
		<title>Fstachecki: /* Domain Specific Language Rules⌘ */</title>
		<link rel="alternate" type="text/html" href="https://training-course-material.com/index.php?title=JBPM_and_Drools_Introduction&amp;diff=63432&amp;oldid=prev"/>
		<updated>2017-11-02T15:34:12Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Domain Specific Language Rules⌘&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[[Category:jBPM]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;slideshow style=&amp;quot;nobleprog&amp;quot; headingmark=&amp;quot;⌘&amp;quot; incmark=&amp;quot;⌘&amp;quot; scaled=&amp;quot;false&amp;quot; font=&amp;quot;Trebuchet MS&amp;quot; &amp;gt;&lt;br /&gt;
;title: jBPM and Drools Introduction&lt;br /&gt;
;author: &amp;lt;br/&amp;gt;Filip Stachecki (filip@NobleProg.pl), Bernard Szlachta (anbo@nobleprog.com)&lt;br /&gt;
&amp;lt;/slideshow&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Copyright Notice}}&lt;br /&gt;
&lt;br /&gt;
=jBPM Overview⌘=&lt;br /&gt;
== jBPM General Info ⌘==&lt;br /&gt;
:[[File:ClipCapIt-171026-095539.PNG]] [[File:ClipCapIt-171026-095651.PNG]]&lt;br /&gt;
* jBPM is a BPMS (Business Process Management Suite) written in Java&lt;br /&gt;
* It allows you to design, model, execute, and monitor business processes throughout their life cycle.&lt;br /&gt;
* Contains Drools - Business Rules Management System (BRMS) &lt;br /&gt;
* jBPM, released by JBOSS (Red Hat boght JBOSS)&lt;br /&gt;
* Open Source and Commercial&lt;br /&gt;
&lt;br /&gt;
== BPMN ⌘==&lt;br /&gt;
[[File:OMG_BPMN.png]]&lt;br /&gt;
* Business Process &amp;#039;&amp;#039;&amp;#039;Model&amp;#039;&amp;#039;&amp;#039; and Notation (BPMN)&lt;br /&gt;
* OMG standard &lt;br /&gt;
* similar to flowchart diagram, but&lt;br /&gt;
** formal (specification - http://www.omg.org/spec/BPMN/2.0/)&lt;br /&gt;
** event based&lt;br /&gt;
** with message flows&lt;br /&gt;
&lt;br /&gt;
== Business Process⌘==&lt;br /&gt;
[[File:ClipCapIt-141204-113643.PNG]]&lt;br /&gt;
&lt;br /&gt;
BPMN 2.0 Spec:&lt;br /&gt;
 &lt;br /&gt;
 A Process describes a sequence or flow of Activities &lt;br /&gt;
 in an organization with the objective of carrying out work.&lt;br /&gt;
&lt;br /&gt;
Howard Smith, Peter Fingar, Business Process Management – The Third Wave, Meghan Kiffer, 2006:&lt;br /&gt;
 Business Process is the complete and dynamically coordinated set of collaborative &lt;br /&gt;
 and transactional activities that deliver value to customers.&lt;br /&gt;
== Process Logic⌘==&lt;br /&gt;
&amp;lt;small&amp;gt;by Bruce Silver&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:ProcessModelManyPaths.png]]&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Process Logic&amp;#039;&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;Process Model&amp;#039;&amp;#039;&amp;#039;) is a complete map of all the paths from the triggering event to any defined end state.&lt;br /&gt;
* Process Model is more than documentation of one instance of the process.&lt;br /&gt;
* Process logic is usually hidden.&lt;br /&gt;
&lt;br /&gt;
== BPMN 2.0 Purpose ⌘==&lt;br /&gt;
* Provide a notation that is readily understandable by business and technical people&lt;br /&gt;
* Create a standardized bridge for the gap between the business process design and process implementation&lt;br /&gt;
* To standardize a business process model and notation&lt;br /&gt;
* To provide a means of communicating process information to other businesses, users, managers and process implementers&lt;br /&gt;
* To exchange BPMN definitions (both domain model and diagram layout) between different tools&lt;br /&gt;
&lt;br /&gt;
== Audience of BPMN ⌘==&lt;br /&gt;
* Business users &lt;br /&gt;
** Business analysts &lt;br /&gt;
** Strategy analyst &lt;br /&gt;
** Quality managers &lt;br /&gt;
&lt;br /&gt;
* Technical developers &lt;br /&gt;
** Process designers &lt;br /&gt;
** Developers &lt;br /&gt;
** Integrators &lt;br /&gt;
** Software, System and Enterprise Architects&lt;br /&gt;
==BPMN Basics⌘==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table border=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;tr&amp;gt;&lt;br /&gt;
			&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Flow Objects&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* [[File:Element_start_event.png|35px]] Events (Circles)&lt;br /&gt;
* [[File:Element activity.png|35px]] Activities (Roundtangles)&lt;br /&gt;
* [[File:Element gateway.png|35px]] Gateways (Diamonds)&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
			&amp;lt;/td&amp;gt;&lt;br /&gt;
			&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Swimlanes&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* [[File:Element_pool.png|100px]] Pools&lt;br /&gt;
* [[File:Element_lane.png|100px]] Lanes&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
			&amp;lt;/td&amp;gt;&lt;br /&gt;
		&amp;lt;/tr&amp;gt;&lt;br /&gt;
		&amp;lt;tr&amp;gt;&lt;br /&gt;
			&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Connecting Objects&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* [[File:Element_sequence_flow.png|100px]]Sequence Flows&lt;br /&gt;
* [[File:Element_message_flow.png|100px]]Message Flows&lt;br /&gt;
* [[File:Element_association.png|100px]]Associations&lt;br /&gt;
* [[File:Element_association.png|100px]]Data Associations&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
			&amp;lt;/td&amp;gt;&lt;br /&gt;
			&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Artifacts&amp;#039;&amp;#039;&amp;#039; (used to provide additional information about the Process)&lt;br /&gt;
* [[File:Element_group.png|100px]] Group&lt;br /&gt;
* [[File:Text_annotations.png|100px]] Text Annotation&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
			&amp;lt;/td&amp;gt;&lt;br /&gt;
		&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Levels of BPMN Process Modelling⌘==&lt;br /&gt;
&amp;lt;small&amp;gt;by Bruce Silver - Three Levels of Process Modeling with BPMN, BPMS Watch, April 2008&amp;lt;/small&amp;gt;&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Descriptive modeling&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
**Abstract, high-level, simple to communicate across the organization&lt;br /&gt;
**Requires understanding of fundamental concepts such as pools and lanes, tasks and subprocesses and sequence flow, &amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039; the complexities of BPMN&amp;#039;s various flow control and event patterns&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Analytical modeling&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
**More details, showing all the steps, including the exception paths required to analyze process performance using simulation or to create details requirements for an IT implementation. Requires understanding of BPMN&amp;#039;s various decisions and merge patterns, event and exception handling patterns. Hierarchical representation of the end to end business process&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Executable modeling&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
**BPMN is a part of the executable process implementation. Imposes many validation constraints.&lt;br /&gt;
** Modeling at this level is somewhat vendor tool-dependent.&lt;br /&gt;
&lt;br /&gt;
== Sub-models within an end-to-end BPMN model ⌘==&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Processes&amp;#039;&amp;#039;&amp;#039; (Orchestration)&lt;br /&gt;
#* Private non-executable (internal) Business Processes&lt;br /&gt;
#* [[File:ClipCapIt-171026-112123.PNG]] -&amp;gt; Private executable (internal) Business Processes  &lt;br /&gt;
#* Public Processes&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Collaborations&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Choreographies&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Conversations&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
== jBPM components ⌘==&lt;br /&gt;
:[[File:ClipCapIt-140916-144554.PNG]]&lt;br /&gt;
&amp;lt;small&amp;gt;source: https://docs.jboss.org/jbpm&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== BPM tools ⌘==&lt;br /&gt;
[[File:ClipCapIt-171026-112917.PNG]]&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
[[File:ClipCapIt-150824-145749.PNG]]&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=jBPM Workbench Overview ⌘=&lt;br /&gt;
== Starting jBPM console ⌘==&lt;br /&gt;
 &amp;amp;nbsp;&lt;br /&gt;
 cd /opt/jbpm-installer&lt;br /&gt;
 ant start.demo&lt;br /&gt;
or&lt;br /&gt;
 ant start.demo.noeclipse&lt;br /&gt;
&lt;br /&gt;
Go to Firefox and type:&lt;br /&gt;
http://localhost:8080/jbpm-console&lt;br /&gt;
&lt;br /&gt;
== Evaluation Demo ⌘==&lt;br /&gt;
[[File:Evaluation.png]]&lt;br /&gt;
* An employee performance needs to be evaluated&lt;br /&gt;
* First, the employee gives feedback about their own performance&lt;br /&gt;
* Later, HR (mary) and PM (john) departments give their opinion about employee department&lt;br /&gt;
* It does not matter whether HR or PM evaluation is done first&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Lab Executing Process in Kie ⌘==&lt;br /&gt;
# localhost:8080/jbpm-console&lt;br /&gt;
# login krisv/krisv&lt;br /&gt;
# Build Project&lt;br /&gt;
## Got to Authoring/Project Autorining&lt;br /&gt;
## In Project Explorer select &amp;#039;&amp;#039;demo&amp;#039;&amp;#039; / &amp;#039;&amp;#039;jbpm-playground&amp;#039;&amp;#039; / &amp;#039;&amp;#039;Evaluation&amp;#039;&amp;#039; project&lt;br /&gt;
## Click BUSINESS PROCESSES / &amp;#039;evaluation&amp;#039; process to view the diagram&lt;br /&gt;
## Click Open Project Editor / Build &amp;amp; Deploy&lt;br /&gt;
# Start an Process Instance&lt;br /&gt;
## Process Management / Process Definitions&lt;br /&gt;
## Actions / Start&lt;br /&gt;
## Employee: krisv (must be this user)&lt;br /&gt;
## Reason: evaluation&lt;br /&gt;
== Lab Executing Process in Kie cont.⌘==&lt;br /&gt;
# Perform Self-Evaluation&lt;br /&gt;
## Task List / Actions / Start&lt;br /&gt;
## Performance: &amp;quot;I am excellent&amp;quot;&lt;br /&gt;
# HR Evaluation&lt;br /&gt;
## Log in as mary&lt;br /&gt;
## Tasks / Actions / Start&lt;br /&gt;
## Click on Magnifying Glass icon / Work tab / Complete&lt;br /&gt;
# PM Evaluation&lt;br /&gt;
## Log in as john&lt;br /&gt;
## Task / Actions / Start&lt;br /&gt;
## Click on Magnifying Glass icon / Work tab / Complete&lt;br /&gt;
# View Log&lt;br /&gt;
## Process Management / Process Instances / Completed&lt;br /&gt;
## Actions / Details&lt;br /&gt;
&lt;br /&gt;
=Drools Overview ⌘=&lt;br /&gt;
by Ronald Ross, Business Rule Concepts: Getting to the Point of Knowledge, 4th edition - BRS, 2013&lt;br /&gt;
===Business Rules⌘===&lt;br /&gt;
[[File:ClipCapIt-140905-143445.PNG]]&lt;br /&gt;
* Rules are familiar to us all in real life. &lt;br /&gt;
* We play games by rules, we live under a legal system based on rules, we set rules for our children, and so on.&lt;br /&gt;
* Thinking about the control aspect of any organized activity in terms of rules is actually very natural (try explaining any game without explaining the rules the game is based).&lt;br /&gt;
&lt;br /&gt;
====What is a Business Rule?⌘====&lt;br /&gt;
The SBVR follows a common-sense definition of ‘business rule’:&lt;br /&gt;
 Business Rule: rule that is under business jurisdiction&lt;br /&gt;
*‘Under business jurisdiction’ means that the business can create, revise, and discontinue their business rules as they see fit.&lt;br /&gt;
* If a rule is not under business jurisdiction in that sense, then it is not a business rule. &lt;br /&gt;
* For example, the ‘law’ of gravity is obviously not a business rule. Neither are the ‘rules’ of mathematics.&lt;br /&gt;
&lt;br /&gt;
====Business Rule “Mantra”⌘====&lt;br /&gt;
 “Rules are based on facts, and facts are based on terms.”&lt;br /&gt;
&amp;lt;table border=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;tr&amp;gt;&lt;br /&gt;
			&amp;lt;td&amp;gt;[[File:RuleFactTerm.png]]&amp;lt;/td&amp;gt;&lt;br /&gt;
			&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Terms&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&lt;br /&gt;
*Employee&lt;br /&gt;
*Employee number&lt;br /&gt;
*Car&lt;br /&gt;
*Car registration number&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Facts&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&lt;br /&gt;
*Car has car registration number&lt;br /&gt;
*Employee drives car&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Rules&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&lt;br /&gt;
*Each employee must be uniquely identifiable.&lt;br /&gt;
* Each car always has exactly one car registration number.&amp;lt;/td&amp;gt;&lt;br /&gt;
		&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Artificial Intelligence ⌘==&lt;br /&gt;
[[File:Drools-ai.jpg]]&lt;br /&gt;
&amp;lt;!-- * Neural Networks, Genetic Algorithms, Decision Trees, Frame Systems and Expert Systems --&amp;gt;&lt;br /&gt;
* Expert Systems are also known as Knowledge-based Systems and Knowledge-based Expert Systems &lt;br /&gt;
* Drools is a Rule Engine that uses the rule-based approach to implement an Expert System and is more correctly classified as a Production Rule System.&lt;br /&gt;
&lt;br /&gt;
== Rule Engine ⌘==&lt;br /&gt;
:[[File:Drools-ruleengine.PNG]]&lt;br /&gt;
&amp;lt;p style=&amp;quot;font-size:10px&amp;quot;&amp;gt;Drools documentation, Figure 1.1. High-level View of a Rule Engine&amp;lt;/p&amp;gt;&lt;br /&gt;
* The &amp;#039;&amp;#039;&amp;#039;Rules&amp;#039;&amp;#039;&amp;#039; are stored in the Production Memory&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Facts&amp;#039;&amp;#039;&amp;#039; that the &amp;#039;&amp;#039;&amp;#039;Inference Engine&amp;#039;&amp;#039;&amp;#039; matches against are kept in the &amp;#039;&amp;#039;&amp;#039;Working Memory&amp;#039;&amp;#039;&amp;#039;. &lt;br /&gt;
* Facts are asserted into the Working Memory where they may then be &amp;#039;&amp;#039;&amp;#039;modified&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;retracted&amp;#039;&amp;#039;&amp;#039;. &lt;br /&gt;
* A system with a large number of rules and facts may result in many rules being true for the same fact assertion; these rules are said &amp;#039;&amp;#039;&amp;#039;to be in conflict&amp;#039;&amp;#039;&amp;#039;. &lt;br /&gt;
* The &amp;#039;&amp;#039;&amp;#039;Agenda&amp;#039;&amp;#039;&amp;#039; manages the execution order of these conflicting rules using a &amp;#039;&amp;#039;&amp;#039;Conflict Resolution&amp;#039;&amp;#039;&amp;#039; strategy.&lt;br /&gt;
&lt;br /&gt;
=== Advantages of a Rule Engine ⌘===&lt;br /&gt;
* Declarative Programming (&amp;quot;What&amp;quot;, not &amp;quot;How&amp;quot;)&lt;br /&gt;
* Explanation Facility - we can see &amp;quot;how&amp;quot; engine solved the problem  &lt;br /&gt;
* Logic and Data Separation (breaking OO coupling of data and logic)&lt;br /&gt;
* Speed and Scalability (Rete, Leaps, PHREAK)&lt;br /&gt;
* Centralization of Knowledge (Documentation)&lt;br /&gt;
* Tool Integration&lt;br /&gt;
* Understandable Rules (DSL)&lt;br /&gt;
&lt;br /&gt;
=== When should you use RE? ⌘===&lt;br /&gt;
* The problem may not be complex but there is no non-fragile way of building a solution for it&lt;br /&gt;
* The problem is beyond any obvious algorithmic solution&lt;br /&gt;
* The logic changes often&lt;br /&gt;
* Domain experts (or business analysts) are readily available, but are nontechnical&lt;br /&gt;
* There are too many rules to manage them in the code&lt;br /&gt;
* We need rules to be explicit and documented&lt;br /&gt;
&lt;br /&gt;
=== When shouldn&amp;#039;t you use RE? ⌘===&lt;br /&gt;
* Maintaining the infrastructure is more expensive than the gains&lt;br /&gt;
* With system which hardly ever change&lt;br /&gt;
* There is no person understanding RE&lt;br /&gt;
&lt;br /&gt;
=== Alternatives to Rule Engine ⌘===&lt;br /&gt;
* Scripting  &lt;br /&gt;
* Decision Tables (Lookup tables, DMN) &lt;br /&gt;
* Other data-driven solutions&lt;br /&gt;
=== Rules Syntax ⌘===&lt;br /&gt;
:[[File:ClipCapIt-150708-182520.PNG]]&lt;br /&gt;
&lt;br /&gt;
 Rule &amp;quot;Next delegate discount&amp;quot;&lt;br /&gt;
    When&lt;br /&gt;
        $NumberOfDelegates &amp;gt; 1&lt;br /&gt;
    Then&lt;br /&gt;
        $Price = $Price - $Price*($numberOfDelegates-1)*10%&lt;br /&gt;
 End&lt;br /&gt;
&lt;br /&gt;
===Domain Specific Language Rules⌘===&lt;br /&gt;
:[[File:ClipCapIt-171026-120855.PNG]]&lt;br /&gt;
* DSL is a way non-technical people can write &amp;#039;&amp;#039;&amp;#039;executable&amp;#039;&amp;#039;&amp;#039; rules in Drools environment&lt;br /&gt;
* DSL is ultimately transformed to rules (mvel or java)&lt;br /&gt;
* .dsl file contain the transformations (mapping)&lt;br /&gt;
== The Business Rules Manifesto ⌘==&lt;br /&gt;
http://www.businessrulesgroup.org/brmanifesto.htm&lt;br /&gt;
 Rules are not process and not procedure.  They should not be contained in either of these.&lt;br /&gt;
&lt;br /&gt;
 Rules build on facts, and facts build on concepts as expressed by terms.&lt;br /&gt;
&lt;br /&gt;
 If something cannot be expressed, then it is not a rule.&lt;br /&gt;
&lt;br /&gt;
 Business rules should be expressed in such a way that they can be validated for correctness by business people.&lt;br /&gt;
&lt;br /&gt;
 Exceptions to rules are expressed by other rules.&lt;/div&gt;</summary>
		<author><name>Fstachecki</name></author>
	</entry>
</feed>