Devoxx 2009 Conference session Jbpm4 In Action

Preview:

Citation preview

jBPM 4 in ActionjBPM 4 in Actionby by

Tom Baeyens & Joram BarrezTom Baeyens & Joram Barrez

2

Speaker’s qualificationsFounded jBPM in 2003Project Lead of jBPMPassionate about BPM and JavaArticles/international conferences

JBoss jBPM core developer (06/09)Before: jBPM/BPM consultant

3

jBPM is great for BPM*and*

for developers

6

Business process

An (organized) way of 'doing things'... with a certain goal

7

Processes are everywhere

Processes are everywhere

Processes are everywhere

10

Conclusion

Any company Any productAny service

They all have business processes

11

Conclusion

Any company Any productAny service

Which means– 'Doing business'

== executing some business process

They all have business processes

12

Newsflash

Every app you write– Is (part of) a business process

So your job ...– implementing business processes!

Wouldn't you rather have a powerful, flexible framework where you can apply all your Java-powers?

13

Introducing jBPM

Transactional state-machineGeneric graph execution engineBut most of all...

– A kick-ass JAVA BPM engine

jBPM Evolution

jBPM 1• EJB state machine

jBPM 2• Std Java Embeddable

• Hibernate state machine

jBPM 3• First Activity Pluggability• First Multiple Languages

• First Enterprise Embeddability

jBPM 4• Activity Pluggability API

• Command Based Services •Multiple Languages

• Many Execution modes• DB Partitioning• DB Evolution

• Full Embeddability

Product

Project

jBPM today

jBPM today

17

JBPM v4: what's new?Clean & simplified

– Based on 2nd generation PVM– New API (incl. cool query mechanism)– Compact db schema– Native Spring integration

Improved tooling– Sexy GWT console – Signavio web modeling

QA lab

jBPM3 jBPM4

Software Project

Executable Process

Processes As Part Of Software Development

Non-techBusiness Analyst Developer<details />

Java, XML, Buildscripts,Tests, …

EAPSOA-PJBossTomcatJDK 5

Oracle, MySQL, PostgreSQL

jBPM YourApp

Analyst

Developer

Abstract Process

jBPM APIConfiguration cfg = new Configuration();

ProcessEngine processEngine = cfg.buildProcessEngine();

processEngine.getRepositoryService();processEngine.getExecutionService();processEngine.getHistoryService();processEngine.getTaskService();processEngine.getIdentityService();

jbpm.cfg.xml

Print Dots

• Automatic activity• Print dots on the console

Starting ProcessInstance

public void userClickedButton() { ... executionService .startProcessInstanceByKey("PrintDots"); ...}

SomeWeb

Framework

<process name=“PrintDots">

<start> <transition to="print dots" /> </start>

<custom name="print dots" class="com.devoxx.jbpm.printdots.PrintDots"> <transition to="end" /> </custom> <end name="end"/>

</process>

Bananas

• Get a quote for bananas• Asynchronously

FruitStore

executionService .signalExecutionById

MDB

<process name="Bananas"> <start> <transition to="get price for bananas"/> </start>

<state name="get price for bananas"> <on event="start"> <event-listener

class="com.devoxx.jbpm.bananas.GetPriceForBananas"/> </on> <transition to="print price of bananas"/> </state>

<custom name="print price of bananas“ class="com.devoxx.jbpm.bananas.PrintPrice"> <transition to="end"/> </custom>

<end name="end"/></process>

Yummie

• Choose 1 outgoing transition• Based on the price of bananas

<process name="Yummie"> <start> <transition to="checkPrice"/> </start>

<decision name="checkPrice"> <transition to="yummie"> <condition expr="#{priceForBananas &lt; 10}" /> </transition> <transition to="hungry" /> </decision>

<custom name="yummie" class="com.devoxx.jbpm.yummie.PrintMsg"> <field name="msg"> <string value="Yummie!" /> </field>

</custom>

... <custom name="hungry" class="com.devoxx.jbpm.yummie.PrintMsg"> <field name="msg"> <string value="I'm hungry :-(" /> </field> </custom>

</process>

GetCoffee

• User task

addtask

Tasklist completetask

<process name="GetCoffee">

<start> <transition to="get coffee"/> </start>

<task name="get coffee" assignee="johndoe"> <notification/> <transition to="print coffee"/> </task>

<custom name="print coffee" class="com.devoxx.jbpm.coffee.PrintCoffee"/>

</process>

Other Features

• jPDL– Concurrency– Asynchronous continuations

• Task forms– Rapid prototyping

Other Features

• Production usage– Installer– Upgrade– Process versioning & migration– Clusterable

Other Features

• Tools– Eclipse process designer– Web based modeller (Signavio)– Web console

• Superfast

Other Features

• Multiple process languages– jPDL– BPMN 2 !

35

DEMODEMO•The train ticket demoThe train ticket demo

•INTROINTRO

36

Taking the train 2.0 • The Problem

– Using coins, ticket machines, conductors, ... sooooo 2008

• The solution

JBPM on Rails

37

Use case 1. Ticket request

Other Train System (EJB)

2.Price quote

3.Accept

38

Architecture SMS Gateway

HTTP Interface (Servlet)

jBPM on RailsExt. Sys.

(EJB3)

User Registration

39

Where can I find it?

Blog http://www.jorambarrez.be/blog/2009/09/18/train-ticket-demo-overview-final-part-getting-started-with-jbpm-in-less-than-a-minute/

40

DEMODEMO•The train ticket demoThe train ticket demo

41

JBPM v4: performance

process01 process02 process03 process04 process05 random0

2

4

6

8

10

12

jBPM 4.2 basic benchmark - Postgresql 8.3(10 000 executions)

Seq. exec.2 fixedTP3 fixedTP4 fixedTP5 fixedTP6 fixedTP7 fixedTP8 fixedTP9 fixedTP10 fixedTPav

g du

ratio

n (m

s)

Config: Ubuntu 9.04, AMD Phenom II X4 3.0Ghz, 8Gb Ram, 7200rpm HDDB and benchmark on same machine

42

JBPM v4: performance

Avg process exec. time– 0.75ms – 2ms– 1.8 mil./hour– Yeah, that's fast

jBPM overhead == (extremely) minimal– So what are you waiting for?

I just know you're excited to give it a try

You can do it tonight Just before you go to sleep Or even in your bed

Last demo movie

Getting started