2. Agenda
Overview of BPM.
BPMN 2.0 Notation
What is jBPM?
Installation of JBPM
Eclipse based editor
Guvnor (webased editor) and jBPM console
JBPM API - KnowledgeBase, knowldegesession, knowledgeBuilder, other terms.
Constructs used in jBPM - Script task, User task, Service Task, Rule Task, Startevent, End
Event, Gateways(converge and diverge), timer events
JBPM 5.2 Examples
Page 2 Xebia copyright
3. Overview of BPM
What is BPM?
BPM stands for Business Process Management
The term business process management typically refers to a set of activities enterprises
can employ to automate and optimize business processes in a manner adaptable to
dynamically changing environments
BPM in system engineering is the activity of representing processes of an enterprise, so
that the processes can be analyzed and improved.
BPM is typically performed by business analysts and managers who are seeking to improve
process efficiency and quality.
Page 3 Xebia copyright
4. Overview of BPM continue...
– BPM is embodied in three distinct practices:
Process design: The task of designing existing and new processes
Process execution: The execution of an automated sequence of related events involving
software processes and/or human activities
Process monitoring: Observance and auditing of the state of individual processes so that
the statistics and performance of these processes can be recorded, reported, and optimized
Some available BPM languages are:
– BPMN 2.0
– Business Process Execution Language (BPEL)
– Web Services Choreography Description Language (WS-CDL)
– XML Process Definition Language (XPDL)
Page 4 Xebia copyright
5. BPMN 2.0 Notation
Business Process Modeling Notation (BPMN) is a standard.
BPMN is a graphical modeling language, with symbols, relationships and attributes for the
purpose of process modeling.
Easier to understand and learn.
Page 5 Xebia copyright
8. What is JBPM?
JBPM is a flexible business process management (BPM) suite.
It makes the bridge between business analysts and developers.
Provide features for both
– Business Analyst
– Developers
Page 8 Xebia copyright
9. JBPM Features
Embeddable, lightweight Java process engine, supporting native BPMN 2.0 execution.
BPMN 2.0 process modeling in Eclipse (developers) and the web (business users).
Process collaboration, monitoring and management through the Guvnor repository and the
web console.
Human interaction using an independent WS-HT task service.
Tight, powerful integration with business rules and event processing
Page 9 Xebia copyright
11. Core Engine
Responsible for execution of the processes.
Main features of core engine
– Light weight (can be deployed on almost any device that supports a simple Java Runtime
Environment.
– Ability to migrate running process instances to a new version of their process definition
– Pluggable persistence with a default JPA implementation.
Page 11 Xebia copyright
12. Installation of JBPM
– Prerequisites:
Java JDK 1.5+
Ant 1.7+
– Location for JBPM installer
There are two versions, a full installer which is already contains a lot of the dependencies
that are necessary during the installation and a minimal installer which is only contains the
installer and will download all dependencies at the time of installation
http://sourceforge.net/projects/jbpm/files/jBPM%205/
jBPM-{version}-installer-full.zip
Page 12 Xebia copyright
13. Installation of JBPM continue...
– Installation Process : The easiest way to get installed is to simply run the installation script.
Go to the install folder and run :
ant install demo
– This will download following in lib directory.
Download JBoss AS
Download Eclipse
Install Drools Guvnor into JBoss AS
Install Oryx Designer into JBoss AS
Install the jBPM gwt-console into JBoss AS
Install the jBPM Eclipse plugin
Install the Drools Eclipse plugin
Page 13 Xebia copyright
14. Installation of JBPM continue...
– After download all the artifacts, we need to start the demo.
ant start.demo
– This will start
H2 database
JBoss AS
Eclipse
Human Task Service
Page 14 Xebia copyright
15. Installation of JBPM continue...
– Test the installation
Go to http://localhost:8080/jbpm-console/app.html for Jbpm console
Got to http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/Guvnor.jsp for
Guvnor repository
Page 15 Xebia copyright
16. Eclipse Editor
The Eclipse editor is a plugin to the Eclipse IDE and allows you to integrate your business
processes in your development environment.
Targeted towards developers.
Graphical editor for creating your business processes.
Advanced testing and debugging capabilities.
Major Features :
– Integration with the knowledge repository.
– Graphical debugging, to see all the running processes.
– Plugging in your own domain specific nodes.
Page 16 Xebia copyright
17. Web-based designer
Allows you to model your business processes in a web-based environment.
Targeted towards more business users.
Graphical editor for viewing and editing your business processes (using drag and drop).
Page 17 Xebia copyright
18. Guvnor
A repository service to store your business processes and related artifacts.
A web-based user interface to manage your business processes
– Targeted towards business users.
– Supporting the visualization of your processes.
Collaboration features to have multiple actors.
Page 18 Xebia copyright
19. jBPM Console
Business processes can be managed through a web console. It is targeted towards
business users and its main features are:
– Process instance management: the ability to start new process instances, get a list of
running process instances, visually inspect the state of a specific process instances, etc.
– Human task management: being able to get a list of all your current tasks (either assigned
to you or that you might be able to claim), completing tasks on your task list (using
customizable task forms), etc.
– Reporting: get an overview of the state of your application and/or system using dynamically
generated (customizable) reports, that give you an overview of your key performance
indicators (KPIs).
Page 19 Xebia copyright
21. The jBPM API
Knowledge Base
– First requirement to have to cickstart the process.
– Should include all the process definitions.
– Creating a knowledge base.
KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder()
kbuilder.add (ResourceFactory.newClassPathResource ("MyProcess.bpmn"),
ResourceType.BPMN2)
KnowledgeBase kbase = kbuilder.newKnowledgeBase();
Page 21 Xebia copyright
22. Session
After loading your knowledgebase, you should create the session to interact with the
engine.
Session can be used to start new processes, signal events, etc.
The following code snippet shows how to create a session:
Stateful Knowledge Session ksession = kbase.newStatefulKnowledge Session();
Process Instance process Instance = ksession.startProcess ("com.sample.MyProcess");
Page 22 Xebia copyright
23. Creating a process
A process can be created in
– Eclipse Editor (Demo)
– Web based Editor (Demo)
Page 23 Xebia copyright
24. Activities and Events of jBPM
Script Task
User Task
Service Task
Rule Task
Start Event
End Event
Gateways ( converge and diverge)
Timer events etc.
Page 24 Xebia copyright
25. Start Event
Start of the process.
A process should have only one start node.
No incoming connection.
Only one outgoing connection.
Page 25 Xebia copyright
26. End Event
End of the process.
A process should have one or more end events.
One incoming connection.
No outgoing connection.
Page 26 Xebia copyright
27. Script Task
Represent a script that should be executed in the process.
One incoming connection.
One outgoing connection.
The dialect used for coding the action is JAVA and MVEL.
Page 27 Xebia copyright
28. User Task
Tasks to be executed by human being are handled by human tasks.
One incoming connection.
One outgoing connection.
Either group or user is mentioned with the task to determine who will perform the task.
Page 28 Xebia copyright
29. Service Task
All the work that is executed outside a process engine is represented in service task.
Domain specific services can be defined, using unique name, defining
parameters, and results.
One incoming and one outgoing connection.
Has to be configured. (To be shown later)
Page 29 Xebia copyright
30. Rule Task
Represent a set of rules that need to be evaluated.
One incoming and one outgoing connection.
Rules are defined in seperate Drools rule format.
Have to be configured (one example)
Page 30 Xebia copyright
31. Gateways
Allows to create branches (diverging) or merge branches (converging).
A diverging gateway has one incoming connection and two or more outgoing connection.
Three types of gateways are there.
AND, OR and XOR.
Page 31 Xebia copyright
32. Gateways continue
A converging gateway allows you to synchronize multiple branches.
A converging gateway has two or more incoming connections and one outgoing
connection.
AND or XOR types
Page 32 Xebia copyright
33. Other features
Data
– Data can be retrieved, stored, passed on and used.
– Process level variables can be set when starting a process.(show in eclipse)
Constraints
– Can be used at various locations.
– For example in script tasks, diverging gateways etc
Action Scripts
– Action scripts can be used in different ways:
– within a script task
– as entry or exit actions
Page 33 Xebia copyright
34. Connecting eclipse with guvnor
Go to File->New->Other
Select Guvnor.
Create new repository.
Select your guvnor repository on port 8080.
Select the file/process you want to add to guvnor, right click, select guvnor, select add.
Select the repository and package you want to add.
Page 34 Xebia copyright
35. Demo
Service Task (configure a service task, run a task)
Business Rule (Drools Rule) Task
Human task (Add to Guvnor repository, deploy the package, manage and
monitor on jBPM console.
Page 35 Xebia copyright