This session will get you started with JBoss BRMS. It will walk you through some of the capabilities, components and basic concepts that one needs to understand to start building process and rule-driven applications. Join us for an hour or two of Business Process Management (BPM) concepts, explanations of how to capture your enterprises logic in business rules and a demonstration or two from real live processes that bring these concepts to life.
7. Repository
Central Knowledge / Asset Repository
Store – Models, Process Def, Rule Def, Images, Anything
Else
Can store and manage any kind of assets
Based on JCR 2.0
Version Control
Can also be accessed by WebDAV and HTTP
New – Access through REST
Further persists to RDBMS
7
8. BRMS (+jBPM 5) Interoperability with SOA -P
SOA-P is a certified Container
Integration of jBPM 5 with ESB in 5.3
8
9. Operations Management
Pluggable to JON
Monitor long running sessions
Monitor knowledgebase params for each KB
View list of running sessions
List of active rules in sessions
For each rule session params
Session params like
– No. of facts
– Total firing time
– Avg firing time
– Total activations
9
10. Embed Guvnor Editors in Custom Applications
Embed Any editor in
your app
Guvnor webapp should
be running
BRL Editor mode – no
repo saving
Existing Asset Editor
mode – save to repo
New Asset Editor mode
Use JavaScript to
interact with editor
Use Http to interact with
Guvnor app
10
12. JBoss BRMS
What is a rule?
● In short, a rule is an premise and conclusion
● If it is raining, then the ground must be wet
● A rule is made of conditions and actions. When all the
conditions are met, a rule may “fire”.
● The conditions are collectively referred to as the LHS (left
hand side) and the actions are referred to as the RHS (right
hand side, or consequence).
● A rule operates on facts (data). In our case, these facts are
instances of objects in our application.
12
13. JBoss BRMS
What is inferencing?
● We want to take all of our data (facts) and combine it with our
knowledge (rules) and come up with some conclusions
(inferencing)
13
14. JBoss BRMS
What is inferencing?
● We want to take all of our data (facts) and combine it with our
knowledge (rules) and come up with some conclusions
(inferencing)
14
15. JBoss BRMS
What is inferencing?
● We want to take all of our data (facts) and combine it with our
knowledge (rules) and come up with some conclusions
(inferencing)
15
16. JBoss BRMS
What is inferencing?
● We want to take all of our data (facts) and combine it with our
knowledge (rules) and come up with some conclusions
(inferencing)
16
17. JBoss BRMS
What is inferencing?
● We want to take all of our data (facts) and combine it with our
knowledge (rules) and come up with some conclusions
(inferencing)
17
19. Golfing Configuration Example
There are four Golfers standing at a tee, in a line from
left to right:
• The golfer to Fred’s immediate right is wearing blue pants
• Joe is second in line
• Bob is wearing plaid pants
• Tom isn’t in position one or four, and he isn’t wearing the orange
pants
19
20. Create all possible combinations
String[] names = new String[]{"Fred", "Joe", "Bob", "Tom"};
String[] colors = new String[]{"red", "blue", "plaid”,"orange" };
int[] positions = new int[] {00, 2, 3, 4};
for ( int n = 0; n < names.length; n++ ) {
for ( int c = 0; c < colors.length; c++ ) {
for ( int p = 0; p < positions.length; p++ ) {
new Golfer(names[n], colors[c], positions[p]);
}
}
}
20
21. Fred
• There is a golfer named Fred
// There is a golfer named Fred
fred : Golfer( name == "Fred" )
21
22. Joe
• Joe is second in line
// Joe is in position 2
joe : Golfer( name == "Joe”,
position == 2 && != fred.position,
color != fred.color )
22
23. Bob
• Bob is wearing plaid pants
// Bob is wearing plaid pants
bob : Golfer( name == "Bob",
position != fred.position &&
!= joe.position,
color == "plaid" &&
!= fred.color &&
!= joe.color )
23
24. Tom
• Tom isn’t in position one or four, and he isn’t wearing the orange
pants
// Tom isn't in position 1 or 4
// and isn't wearing orange
tom : Golfer( name == "Tom",
position not in (1, 4, fred.position,
joe.position, bob.position),
color not in ("orange", "blue",
fred.color, joe.color, bob.color))
24
25. Fred's neighbor
• The golfer to Fred's immediate right is wearing blue pants
// The golfer to Fred's immediate right
// is wearing blue pants
Golfer ( position == (fred.getPosition() + 1),
color == "blue",
this in ( joe, bob, tom )
)
25
26. Results
System.out.println( "Fred's position is " +
fred.getPosition() + " and his color is " +
fred.getColor() );
System.out.println( "Joe's position is " +
joe.getPosition() + " and his color is " +
joe.getColor() );
System.out.println( "Bob's position is " +
bob.getPosition() + " and his color is " +
bob.getColor() );
System.out.println( "Tom's position is " +
tom.getPosition() + " and his color is " +
tom.getColor() );
Fred 1 orange
Joe 2 blue
Bob 4 plaid
Tom 3 red
26
27. Conclusions
• Rules technology provides a new way to create
business applications, where business logic is
“declared” in a rule language, instead of a traditional
procedural language.
• Rule engines are good for solving complex problems
that don't have any other way to solve.
• Business Rule Management Systems can be used to
manage thousands of rules.
27
28. JBoss BRMS
Inference Engine
● The brain of a Production Rule System is an Inference Engine
which matches facts against Production Rules.
● When matches are found, the rules actions are fired.
● Actions most often change the state of the facts, or perform some
external action on the application.
28
29. Conceptual example
Stateful / Stateless
Knowledge Knowledge
Base Session
Rule package Agenda
(artifacts)
29
30. Example: real BPM
Stateful
Knowledge Knowledge
Base Session
Process Process
Definition Instance
30
31. JBoss BRMS
How it Works
Agenda
Rule Activation
Rule
Rule 1.Parse DRL RuleBase Rule Fact
Rule
Rule
Activation
Fact
2. Create
Rule Fact
Fact
Fact
Fact 3. Assert Facts WorkingMemory
Fact
Fact Fact
Fact
Fact
es
Fact
ul
Fact
R
ll
A
re
Fi Rule (5) activation
Rule -> consequence
4.
Rule
Rule
Rule
31
32. Rules Engine
Support Inference
Implements ReteOO algorithm
Embeddable, lightweight
Highly performant
Scalable and most stable
Supports Declarative Programming
32
34. All new Decision Table: Business User Friendly
Intuitive and powerful
interface for any users
Ability to visually create
large set of business rules
Quick validation of rules
Verify coverage for all
conditions
34
35. Decision Tables – Supported Categorization
Multi hit, all hit
Conditions are not mutually
exclusive
All matching rules executed
Multi hit, first hit
Conditions are not mutually
exclusive.
First matching rule executes
Single hit
Exactly One rule fires
No ambiguity
35
37. BRMS 5.3 – Other New Features
Backward Chaining – Full Support
Lazy Truth Maintenance – enabled automagically when needed
Free form expression in constraints: Enables writing complex
expressions and nested accessors
Person( age * 2 > $anotherPersonsAge + 2 ) // mathematical expressions
Person( addresses["home"].streetName.startsWith( "High Park" ) ) // method calls and collections simplified
syntax
Person( isAdult() ) // boolean expression without relational operator
Cheese( ) from [ $stilton, $brie, $provolone ] // inline list creation and
iteration
Performance enhancements
● Optimized parser enhances
Modularity enabled for OSGI set up
37
38. Developer Perspective
JBoss Developer Studio
Fact Model
DSL Template
Check-In Artifacts to
Repository
JBoss BRMS Web
Manager
Use Facts & DSL
to create Business Rules
J2SE
EAP-
WS,WAR,EAR
Deployment
SOA-P,
Mediated
Services
JBoss BRMS Web JBoss BRMS Web
Manager Manager
Create Test Scenarios Create Package
38
45. Process Modeling
Web Based Modeling Tools IDE Based Modeling Tools
Create BPMN2 Process Definition
Common Design Time Repository – Store, Manage, Version
Create Process Definitions, Validate, Package, Deploy
Develop User forms, integrate other Business Assets (rules etc)
Import BPMN2 Definitions
45
46. Process Designer Highlights
Fully Integrated with BRMS Guvnor – On-stop business modeling tool
Rich set of BPMN2 elements – Drag and drop on canvas
Domain Specific Nodes – Add your own tasks to the list
Generate PDF or PNG documents of process definition
Embeddable Designer – Allows adopting designer in your own tool
46
47. Process Designer Highlights – User Forms
Create Task Forms and Process
Forms in the designer
Forms necessary for Workflow
kick off and Human task inputs
These forms are used when
process instance is created –
Business Central
Inline editing within the process
definition
47
48. Process Designer Highlights – Visual Process Validation
Visually validate the process definition before packaging
48
49. Process Deployment – Loading Process Definition
Load Definitions through
Business Central
Use Knowledge API to
programmatically load
49
50. Process Execution - Process Engine Highlights
Lightweight, Embeddable, Extensible
Manages State Transition
Native BPMN2 Execution
Use out of the box Persistence and Transaction
Or Plugin your Own Persistence and Transaction
Spring, Camel and OSGi Integration
50
51. Process Execution - Task Server Highlights
Independent Task Management Server
Manages Lifecycle of Human Tasks – Creation, Claim, Completion etc
Support for Assignment, Delegation, deadlines, calendar integration,
internationalization etc.
Manages its own state persistence – different from process data
persistence
WS-HT Based
Accessible both by Synchronous and Asynchronous communication
HornetQ is the default transport.
Works with Apache Mina
Accessible through REST interface
51
52. Process Monitoring – Business Central
One-stop Web Based Center for Managing
Business Operations
Manage and Monitor Business Processes
Manage Human Tasks
Plug your own reporting tool and create reports
Role based authentication – configurable to
any JaaS / LDAP
REST Interface for programmatic access to
functions
52
53. Business Central – Monitoring Processes
View all process definitions that are installed in knowledgebase
Instantiate a process instance
– Inline input Process Input form
Manage running processes – Start, Terminate, Delete, Signal
Inspect State of a Process Instance and Execution Details
53
54. Business Central – Managing Tasks
View Assigned (personal) tasks and Un-assigned (group) tasks
Claim a Task, Execute a Task, Release a Task
Complete inline user task forms
54
55. Process Monitoring – Reporting
Powerful Knowledge APIs, REST
interface
Leverage power of CEP for realtime
reporting
Easy to integrate popular 3rd party
reporting solutions
Will supply how to guides
Placeholder for dashboard. No out
of the box reporting in the product
55
57. Event Processor
CEP Engine enables -
– Event Detection: Cloud mode and Stream mode
– Temporal Reasoning (correlation) – reason over
aggregation
– Abstraction – Compose complex events and reason over
them
CEP Engine Supports:
– Event Semantics (point in time and interval) as first class
citizen analogous to rule semantics
– Support both point in time (as interval with zero duration)
and interval semantics
– Ability to apply temporal constraints
– Use Session clocks: Support Realtime (system) clock,
Psedo Clock (controlled by application)
– Sliding window support
– Ability to scale to high volume of events
57
58. CEP Modes
Cloud Mode Stream Mode
Default Mode – All facts and events are loaded Events must be time-ordered
before reasoning
Engine synchronizes between streams
Many to many pattern matching by the engine using session clock
No notion of flow of time, no clock
synchronization
Engine applies the notion of flow
Ordering is not required
Engine manages the event lifecycle
Event lifecycle managed by user Sliding window option could be used
Sliding window is not needed Negative patterns could be used. Ex. Fire
detected, no sprinkler turned on in 10 sec
sound alarm
58
59. Temporal Relationships
when
when
Shipment( $pickupTime :: scheduledPickupTime ))
Shipment( $pickupTime scheduledPickupTime Temporal
Relationship
not ShipmentPickup( this before $pickupTime ))
not ShipmentPickup( this before $pickupTime
then
then
// shipment not picked up... Action required.
// shipment not picked up... Action required.
end
end
rule “Shipment not picked up in time”
rule “Shipment not picked up in time”
13 Operators are Supported
Event A before Event B Event A coincides Event B
Event A meets Event B Event A after Event B
Event A overlaps Event B Event A metBy Event B
Event A finishes Event B Event A overlapedBy Event B
Event A includes Event B Event A finishedBy Event B
Event A starts Event B Event A during Event B
Event A finishes Event B
59
60. CEP – Sliding Windows
Sliding window 1
Sliding window 2
Joined window
Sliding Time Window Sliding Length Window
- Reason Over events occurring next set time duration - Reason Over set number of events occuring
Example: Raise alarm if avg temp reading from Example: Raise alarm if avg temp from last 100
sensor over last 10m is above the threshold sensor readings is above the threshold
rule "Sound the alarm in case temperature rises above rule "Sound the alarm in case temperature rises above
threshold" threshold"
when when
TemperatureThreshold( $max : max ) TemperatureThreshold( $max : max )
Number( doubleValue > $max ) from accumulate( Number( doubleValue > $max ) from accumulate(
SensorReading( $temp : temperature ) over SensorReading( $temp : temperature ) over
window:time( 10m ), window:length( 100 ),
average( $temp ) ) average( $temp ) )
then then
// sound the alarm // sound the alarm
end end
60
61. Apply CEP operators for Rules
Apply 13 operators available
Define sliding time window or length
61
JBoss Enteprise BRMS (new in 2009) Enables critical business rules to be managed in a more centralized manner (e.g. Insurance = policy risk assess and pricing; Heathcare = claims processing annual regulatory changes) Avoids need to otherwise re-code business rules redundantly in multiple applications Leverages JBoss Rules execution engine which has been available for years Adds new browser-based Rules Mgmt app, enabling business users to participate in the review, editing, and maintenance of business rule changes Also adds Repository to provide version management of multiple sets of business rules Supports the deployment of business rules to JBoss middleware platforms and non-JBoss runtime environments
JBoss Enteprise BRMS (new in 2009) Enables critical business rules to be managed in a more centralized manner (e.g. Insurance = policy risk assess and pricing; Heathcare = claims processing annual regulatory changes) Avoids need to otherwise re-code business rules redundantly in multiple applications Leverages JBoss Rules execution engine which has been available for years Adds new browser-based Rules Mgmt app, enabling business users to participate in the review, editing, and maintenance of business rule changes Also adds Repository to provide version management of multiple sets of business rules Supports the deployment of business rules to JBoss middleware platforms and non-JBoss runtime environments
JBoss Enteprise BRMS (new in 2009) Enables critical business rules to be managed in a more centralized manner (e.g. Insurance = policy risk assess and pricing; Heathcare = claims processing annual regulatory changes) Avoids need to otherwise re-code business rules redundantly in multiple applications Leverages JBoss Rules execution engine which has been available for years Adds new browser-based Rules Mgmt app, enabling business users to participate in the review, editing, and maintenance of business rule changes Also adds Repository to provide version management of multiple sets of business rules Supports the deployment of business rules to JBoss middleware platforms and non-JBoss runtime environments
JBoss Enteprise BRMS (new in 2009) Enables critical business rules to be managed in a more centralized manner (e.g. Insurance = policy risk assess and pricing; Heathcare = claims processing annual regulatory changes) Avoids need to otherwise re-code business rules redundantly in multiple applications Leverages JBoss Rules execution engine which has been available for years Adds new browser-based Rules Mgmt app, enabling business users to participate in the review, editing, and maintenance of business rule changes Also adds Repository to provide version management of multiple sets of business rules Supports the deployment of business rules to JBoss middleware platforms and non-JBoss runtime environments
JBoss Enteprise BRMS (new in 2009) Enables critical business rules to be managed in a more centralized manner (e.g. Insurance = policy risk assess and pricing; Heathcare = claims processing annual regulatory changes) Avoids need to otherwise re-code business rules redundantly in multiple applications Leverages JBoss Rules execution engine which has been available for years Adds new browser-based Rules Mgmt app, enabling business users to participate in the review, editing, and maintenance of business rule changes Also adds Repository to provide version management of multiple sets of business rules Supports the deployment of business rules to JBoss middleware platforms and non-JBoss runtime environments
JBoss Enteprise BRMS (new in 2009) Enables critical business rules to be managed in a more centralized manner (e.g. Insurance = policy risk assess and pricing; Heathcare = claims processing annual regulatory changes) Avoids need to otherwise re-code business rules redundantly in multiple applications Leverages JBoss Rules execution engine which has been available for years Adds new browser-based Rules Mgmt app, enabling business users to participate in the review, editing, and maintenance of business rule changes Also adds Repository to provide version management of multiple sets of business rules Supports the deployment of business rules to JBoss middleware platforms and non-JBoss runtime environments
JBoss Enteprise BRMS (new in 2009) Enables critical business rules to be managed in a more centralized manner (e.g. Insurance = policy risk assess and pricing; Heathcare = claims processing annual regulatory changes) Avoids need to otherwise re-code business rules redundantly in multiple applications Leverages JBoss Rules execution engine which has been available for years Adds new browser-based Rules Mgmt app, enabling business users to participate in the review, editing, and maintenance of business rule changes Also adds Repository to provide version management of multiple sets of business rules Supports the deployment of business rules to JBoss middleware platforms and non-JBoss runtime environments
JBoss Enteprise BRMS (new in 2009) Enables critical business rules to be managed in a more centralized manner (e.g. Insurance = policy risk assess and pricing; Heathcare = claims processing annual regulatory changes) Avoids need to otherwise re-code business rules redundantly in multiple applications Leverages JBoss Rules execution engine which has been available for years Adds new browser-based Rules Mgmt app, enabling business users to participate in the review, editing, and maintenance of business rule changes Also adds Repository to provide version management of multiple sets of business rules Supports the deployment of business rules to JBoss middleware platforms and non-JBoss runtime environments
JBoss Enteprise BRMS (new in 2009) Enables critical business rules to be managed in a more centralized manner (e.g. Insurance = policy risk assess and pricing; Heathcare = claims processing annual regulatory changes) Avoids need to otherwise re-code business rules redundantly in multiple applications Leverages JBoss Rules execution engine which has been available for years Adds new browser-based Rules Mgmt app, enabling business users to participate in the review, editing, and maintenance of business rule changes Also adds Repository to provide version management of multiple sets of business rules Supports the deployment of business rules to JBoss middleware platforms and non-JBoss runtime environments
JBoss Enteprise BRMS (new in 2009) Enables critical business rules to be managed in a more centralized manner (e.g. Insurance = policy risk assess and pricing; Heathcare = claims processing annual regulatory changes) Avoids need to otherwise re-code business rules redundantly in multiple applications Leverages JBoss Rules execution engine which has been available for years Adds new browser-based Rules Mgmt app, enabling business users to participate in the review, editing, and maintenance of business rule changes Also adds Repository to provide version management of multiple sets of business rules Supports the deployment of business rules to JBoss middleware platforms and non-JBoss runtime environments
JBoss Enteprise BRMS (new in 2009) Enables critical business rules to be managed in a more centralized manner (e.g. Insurance = policy risk assess and pricing; Heathcare = claims processing annual regulatory changes) Avoids need to otherwise re-code business rules redundantly in multiple applications Leverages JBoss Rules execution engine which has been available for years Adds new browser-based Rules Mgmt app, enabling business users to participate in the review, editing, and maintenance of business rule changes Also adds Repository to provide version management of multiple sets of business rules Supports the deployment of business rules to JBoss middleware platforms and non-JBoss runtime environments
JBoss Enteprise BRMS (new in 2009) Enables critical business rules to be managed in a more centralized manner (e.g. Insurance = policy risk assess and pricing; Heathcare = claims processing annual regulatory changes) Avoids need to otherwise re-code business rules redundantly in multiple applications Leverages JBoss Rules execution engine which has been available for years Adds new browser-based Rules Mgmt app, enabling business users to participate in the review, editing, and maintenance of business rule changes Also adds Repository to provide version management of multiple sets of business rules Supports the deployment of business rules to JBoss middleware platforms and non-JBoss runtime environments
JBoss Enteprise BRMS (new in 2009) Enables critical business rules to be managed in a more centralized manner (e.g. Insurance = policy risk assess and pricing; Heathcare = claims processing annual regulatory changes) Avoids need to otherwise re-code business rules redundantly in multiple applications Leverages JBoss Rules execution engine which has been available for years Adds new browser-based Rules Mgmt app, enabling business users to participate in the review, editing, and maintenance of business rule changes Also adds Repository to provide version management of multiple sets of business rules Supports the deployment of business rules to JBoss middleware platforms and non-JBoss runtime environments
A rule “logically” inserts an object When the rule is no longer true, the object is retracted. when $p : Person( age < 16 ) then logicalInsert( new IsChild( $p ) ) end when $p : Person( age >= 16 ) then logicalInsert( new IsAdult( $p ) ) End ule "Issue Child Bus Pass" when $p : Person( ) IsChild( person =$p ) then logicalInsert(new ChildBusPass( $p ) ); end rule "Issue Adult Bus Pass" when $p : Person( age >= 16 ) IsAdult( person =$p ) then logicalInsert(new AdultBusPass( $p ) ); End rule "Issue Child Bus Pass" when $p : Person( ) not ( ChildBusPass( person == $p ) ) then requestChildBusPass( $p ); end de-couples the logic Maintains the truth by automatically retracting The truth maintenance cascades
JBoss Enteprise BRMS (new in 2009) Enables critical business rules to be managed in a more centralized manner (e.g. Insurance = policy risk assess and pricing; Heathcare = claims processing annual regulatory changes) Avoids need to otherwise re-code business rules redundantly in multiple applications Leverages JBoss Rules execution engine which has been available for years Adds new browser-based Rules Mgmt app, enabling business users to participate in the review, editing, and maintenance of business rule changes Also adds Repository to provide version management of multiple sets of business rules Supports the deployment of business rules to JBoss middleware platforms and non-JBoss runtime environments
JBoss Enteprise BRMS (new in 2009) Enables critical business rules to be managed in a more centralized manner (e.g. Insurance = policy risk assess and pricing; Heathcare = claims processing annual regulatory changes) Avoids need to otherwise re-code business rules redundantly in multiple applications Leverages JBoss Rules execution engine which has been available for years Adds new browser-based Rules Mgmt app, enabling business users to participate in the review, editing, and maintenance of business rule changes Also adds Repository to provide version management of multiple sets of business rules Supports the deployment of business rules to JBoss middleware platforms and non-JBoss runtime environments
JBoss Enteprise BRMS (new in 2009) Enables critical business rules to be managed in a more centralized manner (e.g. Insurance = policy risk assess and pricing; Heathcare = claims processing annual regulatory changes) Avoids need to otherwise re-code business rules redundantly in multiple applications Leverages JBoss Rules execution engine which has been available for years Adds new browser-based Rules Mgmt app, enabling business users to participate in the review, editing, and maintenance of business rule changes Also adds Repository to provide version management of multiple sets of business rules Supports the deployment of business rules to JBoss middleware platforms and non-JBoss runtime environments
JBoss Enteprise BRMS (new in 2009) Enables critical business rules to be managed in a more centralized manner (e.g. Insurance = policy risk assess and pricing; Heathcare = claims processing annual regulatory changes) Avoids need to otherwise re-code business rules redundantly in multiple applications Leverages JBoss Rules execution engine which has been available for years Adds new browser-based Rules Mgmt app, enabling business users to participate in the review, editing, and maintenance of business rule changes Also adds Repository to provide version management of multiple sets of business rules Supports the deployment of business rules to JBoss middleware platforms and non-JBoss runtime environments
JBoss Enteprise BRMS (new in 2009) Enables critical business rules to be managed in a more centralized manner (e.g. Insurance = policy risk assess and pricing; Heathcare = claims processing annual regulatory changes) Avoids need to otherwise re-code business rules redundantly in multiple applications Leverages JBoss Rules execution engine which has been available for years Adds new browser-based Rules Mgmt app, enabling business users to participate in the review, editing, and maintenance of business rule changes Also adds Repository to provide version management of multiple sets of business rules Supports the deployment of business rules to JBoss middleware platforms and non-JBoss runtime environments