jbpm 5.2

36
jBPM 5.2 - JBoss Business Process Management

Upload: xebia-india

Post on 06-May-2015

1.544 views

Category:

Technology


4 download

TRANSCRIPT

Page 1: jBPM 5.2

jBPM 5.2 - JBoss Business Process Management

Page 2: jBPM 5.2

Page 2 Xebia copyright

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 3: jBPM 5.2

Page 3 Xebia copyright

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 4: jBPM 5.2

Page 4 Xebia copyright

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 5: jBPM 5.2

Page 5 Xebia copyright

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 6: jBPM 5.2

Page 6 Xebia copyright

BPMN 2.0 continue...

Page 7: jBPM 5.2

Page 7 Xebia copyright

BPMN 2.0 Notation continue...

Page 8: jBPM 5.2

Page 8 Xebia copyright

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 9: jBPM 5.2

Page 9 Xebia copyright

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 10: jBPM 5.2

Page 10 Xebia copyright

Overview

Page 11: jBPM 5.2

Page 11 Xebia copyright

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 12: jBPM 5.2

Page 12 Xebia copyright

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 13: jBPM 5.2

Page 13 Xebia copyright

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 14: jBPM 5.2

Page 14 Xebia copyright

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 15: jBPM 5.2

Page 15 Xebia copyright

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 16: jBPM 5.2

Page 16 Xebia copyright

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 17: jBPM 5.2

Page 17 Xebia copyright

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 18: jBPM 5.2

Page 18 Xebia copyright

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 19: jBPM 5.2

Page 19 Xebia copyright

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 20: jBPM 5.2

Page 20 Xebia copyright

Knowledge Base API

Page 21: jBPM 5.2

Page 21 Xebia copyright

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 22: jBPM 5.2

Page 22 Xebia copyright

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 23: jBPM 5.2

Page 23 Xebia copyright

Creating a process

A process can be created in

– Eclipse Editor (Demo)

– Web based Editor (Demo)

Page 24: jBPM 5.2

Page 24 Xebia copyright

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 25: jBPM 5.2

Page 25 Xebia copyright

Start Event

Start of the process.

A process should have only one start node.

No incoming connection.

Only one outgoing connection.

Page 26: jBPM 5.2

Page 26 Xebia copyright

End Event

End of the process.

A process should have one or more end events.

One incoming connection.

No outgoing connection.

Page 27: jBPM 5.2

Page 27 Xebia copyright

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 28: jBPM 5.2

Page 28 Xebia copyright

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 29: jBPM 5.2

Page 29 Xebia copyright

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 30: jBPM 5.2

Page 30 Xebia copyright

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 31: jBPM 5.2

Page 31 Xebia copyright

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 32: jBPM 5.2

Page 32 Xebia copyright

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 33: jBPM 5.2

Page 33 Xebia copyright

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 34: jBPM 5.2

Page 34 Xebia copyright

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 35: jBPM 5.2

Page 35 Xebia copyright

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 36: jBPM 5.2

Page 36 Xebia copyright

Thanks