2. Module 1: jBPM5 Introduction
jBPM5 Community Training
version: 1.0-SNAPSHOT
Release Date: 01/28/2011
Under The Creative Common License
3. Module 1: jBPM5 Introduction
jBPM5 Community Training Course by
Mauricio "Salaboy" Salatino is licensed
under a Creative Commons Attribution
3.0 Unported License.
Based on a work at salaboy.wordpress.
com.
Permissions beyond the scope of this
license may be available at http:
//salaboy.wordpress.com/.
4. Agenda
jBPM Project History
jBPM5 Overview
jBPM5 Goals
Classic BPMS vs jBPM5 architecture (Competitors)
BPMN2 Standard
jBPM5 features
Developing Applications with jBPM5
Conclusions
5. jBPM Project History
jBPM 3.x borns as a BPMS (Business Process Management
System)
It was classified by JBoss as an integration software
Until jBPM 4.x Tom Baeyens was in charge of the project
Tom Baeyens quit JBoss and joins Alfresco
6. jBPM Project History (Drools)
Drools was born as a Rule Engine.
Mark Proctor is the current project leader.
In Drools version 4.x a new module appear called Drools
Flow.
The main idea behind Drools Flow was to provide BPMS
capabilities on top of the Rule Engine.
Kris Verlaenen, Phd was in charge of the Drools Flow
initiative, writing it from the scratch.
The main goal of Drools is to provide a platform where rules
and business processes can live, coexist and collaborate as
Knowledge Representations.
7. jBPM Project History
Drools Flow 5.x was released back in 2009
The rebranded version of Drools Flow, jBPM5 was
released on December of 2010
Provides a rock solid BPMS core and a flexible
mechanisms to implement the main stages of the BPM
discipline
Totally based on BPMN2
jBPM5 was conceived having in mind the code base of
Drools Flow and covering all the functionality provided
by jBPM 4.x
jBPM 5.x is a mature code base with more than 3 years of
development and several testing.
8. jBPM Project History
The main difference between jBPM5 and other BPMS's is
the fact that jBPM5 runs on top of Drools Expert (Rule
Engine), providing amazing features like:
The possibility of doing inferences over our business
processes
Handling process exceptional paths using business
rules
Mixing Complex Event Processing, Rules and
Processes together without learning a new API for
each topic
10. jBPM5 Overview
It is a bridge between Business Analysts and Developers
Apache ASL Licensed
Central concept inside jBPM5: Business Process
BPMS = BPM System
Design / Model (Eclipse Plug in - Web Based Editor)
Execute (runtime to execute our processes)
Monitor / Optimize (BAM and Reporting tools)
Tightly coupled with the rule engine
allow us to represent complex situations (real life is
complex)
11. Business Process
hmm.. but wait a second, What is a business process?
"A sequence of activities,
performed by humans or systems
to complete a business goal"
13. jBPM5 Features
It provides you a flexible platform for designing and
executing your business processes
It provides you an integrated set of APIs for the Rule
Engine, Process Engine and the Complex Event Processing
Engine
It provides you a platform to build our applications using
business processes to guide the company work
It provides you an abstraction about how your company's
activities are orchestrated
It provides a simple and automated mechanism to handle
information across activities
20. Classic BPMS and Rule Engine Interaction
Drawbacks of the classic approach:
The Rule Engine and the BPMS uses different APIs
Sharing information between the Rule Engine and the
BPMS becomes complicated and difficult to maintain
Our Business Processes become very complex when we
describe the exceptional paths using a process centric vision.
We can leverage the declarative approach of business rules
to describe exceptional situations.
23. Inversion of Control
Benefits:
Tightly coupled design
Process Centric vision for common branches
Exceptions are handled in a cleaner way with rules
Using a declarative approach
No problems with communications and marshaling
We don't need to learn different APIs
24. Once again, Business Process
"A sequence of activities,
performed by humans or systems
to complete a business goal"
28. Business Process Definitions
At runtime jBPM5 load the XML process definitions to
an Object Model that contains the process structure
29. Business Process Runtime
Based on the process structure that jBPM5 creates, we
can create new Processes Instances
These Processes Instances will represent living process
executions
30. Developing Applications
For developing applications with jBPM5 you will need to
know:
Project library dependencies
Understand the concept of KnowledgeBuilder,
KnowledgeBase and KnowledgeSession
Basic jBPM5 APIs
31. Project Dependencies
Maven project dependencies of jBPM5 can be
found at JBoss Maven Repositories:
<repositories>
<repository>
<id>JBoss Maven Repo</id>
<name>jboss</name>
<url>https://repository.jboss.
org/nexus/content/groups/public/</url>
</repository>
</repositories>
32. Project Dependencies
The jBPM artifacts that you must use in your
projects are:
<dependency>
<groupId>org.jbpm</groupId>
<artifactId>jbpm-flow</artifactId>
<version>5.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.jbpm</groupId>
<artifactId>jbpm-flow-builder</artifactId>
<version>5.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.jbpm</groupId>
<artifactId>jbpm-bpmn2</artifactId>
<version>5.0-SNAPSHOT</version>
</dependency>
33. KBase and KSession
Knowledge Base: it will represent a compiled and static
representation of our business assets. The knowledge base is
constructured using a Knowledge Builder that will compile our
knowledge assets into knowledge packages. The knowledge base
can be composed of 1..N knowledge packages.
Knowledge Session: it represent our runtime environment. A
knowledge session is created based on a knowledge base and it will
contain a living version (in memory) of our knowledge assets. Our
applications will interact with it. It will contain our processes and
rules running inside it.
35. KnowledgeBuilder
It will compile our business assets into a binary and
optimized format
This process is expensive and must be avoided in production
systems
We usually build our packages once and then store the
binary result in a repository to reuse them
Useful methods
add(KnowledgeResource resource, ResourceType type)
getErrors()
getKnowledgePackages()
36. KnowledgeBase
It will contain our Knowledge packages
It represents a static version of our knowledge assets
Useful methods
addKnowledgePackage(KnowledgePackage)
newStatefulKnowledgeSession()
37. StatefulKnowledgeSession
Easy and cheap to create
It will represent our runtime environment
Our processes will run inside a StatefulKnowledgeSession
Useful methods
startProcess(String processId, Map parameters)
signalEvent(String eventId, Object event, Long
processId)
For rules, insert, update, retract, fireAllRules()
For events: getWorkingMemoryEntryPoint(String
name)
38. We have learned ...
jBPM5 is a BPMS that runs on top of Drools Expert (Rule
Engine)
Knowing the project library dependencies and the jBPM5
artifact dependencies we can create our first jBPM5 project
Using the Basic APIs we can set up easily our runtime
environment
Stay tuned for the next modules that will explain important
topics such as:
The Business Process Management Discipline
The Business Process Modeling and Notation V2
Human Interactions inside our processes
etc.
39. Next Modules
Stay tuned for the next modules that will explain important
topics such as:
The Business Process Management Discipline
The Business Process Modeling and Notation V2
Human Interactions inside our processes
etc.
40. Related Links
You can find more information, examples, tutorials and
more in:
Official documentation
http://hudson.jboss.
org/hudson/job/jBPM5/lastSuccessfulBuild/artifact/
target/jbpm-5.0-SNAPSHOT-docs-build/jbpm-
docs/html/index.html
Blog Athico:
http://blog.athico.com
Salaboy Blog
http://salaboy.wordpress.com
Plug Tree Blog
http://www.plugtree.com