37
1 jBPM 4 Sneak Preview Tom Baeyens JBoss, Red Hat

Sneak Preview of jBPM 4 at JAX conference

Embed Size (px)

DESCRIPTION

After a general introduction to BPM and jBPM, a couple of concrete examples show what jBPM can do.

Citation preview

Page 1: Sneak Preview of jBPM 4 at JAX conference

1

jBPM 4 Sneak Preview

Tom BaeyensJBoss, Red Hat

Page 2: Sneak Preview of jBPM 4 at JAX conference

2

JBoss jBPM• Business Process Management

– BPM as a discipline– BPM as software engineering

• What is jBPM• jBPM 4 Overview

Page 3: Sneak Preview of jBPM 4 at JAX conference

3

Tom Baeyens• Lead and founder of JBoss jBPM• Consulting for numerous BPM projects• Bringing BPM mainstream• Articles

– InfoQ, TSS, Dzone, OnJava,…• Blogs

– http://processdevelopments.blogspot.com/• Talks

– JavaOne, JBossWorld, JAOO, TSS,…

Page 4: Sneak Preview of jBPM 4 at JAX conference

4

BPM as a Discipline• Management discipline• Business processes grow organic

– Understand– Describe– Optimise

• Non technical• People to people

– What, not how– Can be vague

• Unrelated to software architecture• Often include diagrams

Page 5: Sneak Preview of jBPM 4 at JAX conference

5

BPM as Software Engineering• Aspect of software expressed as a graph• Specifies execution flow• BPMS ‘runs’ process executions• It’s software

– DSL– Executes on one system– Central dispatcher– Multiple participants– Wait states

Page 6: Sneak Preview of jBPM 4 at JAX conference

6

Traditional BPM Vendors• Stack Integrators

– Oracle, IBM, SAP– XML basis for BPM ?!– BPEL, WSDL Lots of tooling required to hide clumsy basics Deprecating BPEL in favour of BPMN

• Pure plays– Monolithic server– Automagical– Hard to integrate in your project

Page 7: Sneak Preview of jBPM 4 at JAX conference

7

jBPM !• Bottom Up

– No magic• Server or embedded

– Not monolithic– Just a library

• Freedom– Use the most appropriate tech

• Java, groovy, web services, SQL– Java excellent dispatcher technology

Page 8: Sneak Preview of jBPM 4 at JAX conference

8

Your AppYour Architecture

jBPM’s Modelling Advantage

jBPM

BusinessAnalyst

Developer

Page 9: Sneak Preview of jBPM 4 at JAX conference

9

Your AppYour Architecture

jBPM’s Modelling Advantage

jBPM

BusinessAnalyst

Developer

Page 10: Sneak Preview of jBPM 4 at JAX conference

10

jBPM Overview• Process Virtual Machine

– Java state machine library– Pluggable Activities

• jPDL– BPM as a discipline– Orchestrating Human Tasks & Services– Transactional Script– Execution modes

• SEAM Pageflow• …

Page 11: Sneak Preview of jBPM 4 at JAX conference

11

jPDL Activities• Control flow

transition start end end-cancel end-error decision fork join super-statesub-process

• Functionalstate sub-process task java script esb hql sql

Page 12: Sneak Preview of jBPM 4 at JAX conference

12

jPDL Features• Lots of functional activities

– mail, java, esb, task,…• Concurrency• Event listeners• Timers• Asynchronous continuations• Transactional exception handlers

Page 13: Sneak Preview of jBPM 4 at JAX conference

13

State Choice

Page 14: Sneak Preview of jBPM 4 at JAX conference

14

State Choice<process name="StateChoice">

<start> <transition to="wait for response"/> </start>

<state name="wait for response" > <transition name="accept" to="submit document" /> <transition name="reject" to="try again" /> </state>

<state name="submit document" /> <state name="try again" />

</process>

Page 15: Sneak Preview of jBPM 4 at JAX conference

15

State ChoicerepositoryService.createDeployment() .addResourceFromClasspath( "org/jbpm/examples/state/choice/process.jpdl.xml“) .deploy();

Page 16: Sneak Preview of jBPM 4 at JAX conference

16

State ChoiceProcessInstance processInstance = executionService .startProcessInstanceByKey("StateChoice"); String executionId = processInstance .findActiveExecutionIn("wait for response") .getId();

processInstance = executionService .signalExecutionById(executionId, "accept"); assertEquals("submit document", processInstance.getActivityName());

Page 17: Sneak Preview of jBPM 4 at JAX conference

17

Human Task

Page 18: Sneak Preview of jBPM 4 at JAX conference

18

Human Task<process name="TaskCandidates">

<start> <transition to="review" /> </start>

<task name="review" candidate-groups="sales-dept"> <transition to="wait" /> </task> <state name="wait" />

</process>

Page 19: Sneak Preview of jBPM 4 at JAX conference

19

LDAP

Identity Component

jBPM

Identity Component Interface

jBPMbuild-in

JBossIDM

Your own custom

implementation

3 10

Page 20: Sneak Preview of jBPM 4 at JAX conference

20

Identity Component

johndoe

joesmoe

sales-dept

membership

membership

Page 21: Sneak Preview of jBPM 4 at JAX conference

21

Human TaskexecutionService .startProcessInstanceByKey("TaskCandidates");

List<Task> johnsTakableTasks = taskService.findTakableTasks("johndoe");

List<Task> joesTakableTasks = taskService.findTakableTasks("joesmoe");

taskService.takeTask(task.getDbid(), "johndoe");

List<Task> johnsPersonalTasks = taskService.findAssignedTasks("johndoe");

taskService.completeTask(task.getDbid());

Page 22: Sneak Preview of jBPM 4 at JAX conference

22

Timer Transition

Page 23: Sneak Preview of jBPM 4 at JAX conference

23

Timer Transition<process name="TimerTransition">

<start> <transition to="guardedWait" /> </start>

<state name="guardedWait"> <transition name="go on" to="next step" /> <transition name="timeout" to="escalation"> <timer duedate="2 business days" /> </transition> </state> <state name="next step" />

<state name="escalation" />

</process>

Page 24: Sneak Preview of jBPM 4 at JAX conference

24

Asynchronous Continuations• Automatic activities in sequence• One takes a long time• Don’t block the client thread• async=“true”

Transaction 1 Transaction 2

JobExecutor

Page 25: Sneak Preview of jBPM 4 at JAX conference

25

Designer

Page 26: Sneak Preview of jBPM 4 at JAX conference

26

Console

Page 27: Sneak Preview of jBPM 4 at JAX conference

27

Console

Page 28: Sneak Preview of jBPM 4 at JAX conference

28

Conclusion• jBPM provides overview of application

– External triggers– Wait states– Business view

• jBPM adds a layer on top of TX basics– Transactional timers– Asynchronous messages

• Integrates with – Standard & Enterprise Java– JBoss and other app servers– SEAM– Spring

Page 29: Sneak Preview of jBPM 4 at JAX conference

29

Q&A

Page 30: Sneak Preview of jBPM 4 at JAX conference

30

Execution Modes

Page 31: Sneak Preview of jBPM 4 at JAX conference

31

Execution Modes

Processes

Executions

History

JVMBPM Engine (1)

Persistent Dynamic

Page 32: Sneak Preview of jBPM 4 at JAX conference

32

Execution Modes

Executions

History

JVMBPM Engine

ProcessResources

(2)Persistent

Process resource

Page 33: Sneak Preview of jBPM 4 at JAX conference

33

Execution Modes

Executions

History

JVMBPM Engine

INSURANCE_CLAIMSID … STATE …

ProcessResources

(3)PersistentEmbeddedReferenced

Page 34: Sneak Preview of jBPM 4 at JAX conference

34

Execution Modes

History

JVMBPM Engine

INSURANCE_CLAIMSID … STATE …

ProcessResources

(4)PersistentEmbeddedIncluded

“review”

Page 35: Sneak Preview of jBPM 4 at JAX conference

35

Execution Modes

History

JVMBPM Engine

ProcessResources

ExecutionObjects

(5)Memory

With Persistent History

Page 36: Sneak Preview of jBPM 4 at JAX conference

36

Execution ModesJVM

BPM Engine

ProcessResources

ExecutionObjects

(6)Memory

Page 37: Sneak Preview of jBPM 4 at JAX conference

37

Process Concurrency