Table Of ContentjBPM Developer Guide
A Java developer's guide to the JBoss Business
Process Management framework
Mauricio "Salaboy" Salatino
BIRMINGHAM - MUMBAI
This material is copyright and is licensed for the sole use by ALESSANDRO CAROLLO on 18th December 2009
6393 south jamaica court, , englewood, , 80111
jBPM Developer Guide
Copyright © 2009 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval
system, or transmitted in any form or by any means, without the prior written
permission of the publisher, except in the case of brief quotations embedded in
critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy
of the information presented. However, the information contained in this book is
sold without warranty, either express or implied. Neither the author, nor Packt
Publishing, and its dealers and distributors will be held liable for any damages
caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the
companies and products mentioned in this book by the appropriate use of capitals.
However, Packt Publishing cannot guarantee the accuracy of this information.
First published: December 2009
Production Reference: 1101209
Published by Packt Publishing Ltd.
32 Lincoln Road
Olton
Birmingham, B27 6PA, UK.
ISBN 978-1-847195-68-5
www.packtpub.com
Cover Image by Filippo Sarti ([email protected])
This material is copyright and is licensed for the sole use by ALESSANDRO CAROLLO on 18th December 2009
6393 south jamaica court, , englewood, , 80111
Credits
Author Editorial Team Leader
Mauricio "Salaboy" Salatino Gagandeep Singh
Reviewers Project Team Leader
Jeronimo Ginzburg Priya Mukherji
Federico Weisse
Project Coordinator
Acquisition Editor Leena Purkait
David Barnes
Proofreader
Development Editor Andie Scothern
Darshana S. Shinde
Graphics
Technical Editors
Nilesh R. Mohite
Ishita Dhabalia
Charumathi Sankaran
Production Coordinator
Shantanu Zagade
Copy Editor
Sanchari Mukherjee Cover Work
Shantanu Zagade
Indexer
Rekha Nair
This material is copyright and is licensed for the sole use by ALESSANDRO CAROLLO on 18th December 2009
6393 south jamaica court, , englewood, , 80111
This material is copyright and is licensed for the sole use by ALESSANDRO CAROLLO on 18th December 2009
6393 south jamaica court, , englewood, , 80111
About the Author
Mauricio Salatino (a.k.a. Salaboy) has been a part of the Java and open source
software world for more than six years now. He's worked with several technologies
(such as PHP, JSP, Java SE, Java ME, and Java EE) during these years and is now
focused on JBoss frameworks. He got involved with the JBoss Drools project about
a year and a half ago as a contributor, gaining a lot of experience with the open
source community and with multiple technologies such as JBoss jBPM, JBoss
Drools, Apache RIO, Apache Mina, and JBoss Application Server.
During 2008 he dictated the official jBPM courses for Red Hat Argentina several
times, and he was involved in several JBoss jBPM and JBoss Drools implementations
in Argentina. He was also part of the Research and Development team of one of the
biggest healthcare providers in Argentina, where he trained people in the BPM and
Business Rules field.
Mauricio is currently involved in different open source projects that are being
created by the company he co-founded, called Plug Tree (www.plugtree.com),
which will be released in 2010. Plug Tree is an open source based company that
creates open source projects and provides consultancy, training, and support on
different open source projects.
Mauricio is an Argentinian/Italian citizen based in Argentina. In his free time
he gives talks for the JBoss User Group Argentina (www.jbug.com.ar), that he
co-founded with a group of local friends. He also runs his personal blog about
JBoss, jBPM, and JBoss Drools, that was originally targeted to Hispanic audiences
but is now aimed at an international audience and receives more than five hundred
questions per year.
I would like to thank my family for always being there to support
my decisions and adventures, my new and old friends who have
helped me during this process, all the Packt Publishing staff who
have guided me during these months of hard work; and last but
not least, the open source community guys who are always
creating new, interesting, and exciting projects.
This material is copyright and is licensed for the sole use by ALESSANDRO CAROLLO on 18th December 2009
6393 south jamaica court, , englewood, , 80111
About the Reviewers
Jeronimo Ginzburg has a degree in Computer Science from Universidad de
Buenos Aires, Argentina. He has more than 10 years of experience in designing
and implementing Java Enterprise applications. He currently works at Red Hat as
a Middleware Consultant, specialized in JBoss SOA-P (jBPM, Rules, ESB, and JBoss
AS). During the last four years, Jeronimo has been researching Web Engineering and
he has co-written articles published on journals, proceedings, and as a book chapter.
Federico Weisse was born in Buenos Aires, Argentina. He has over 10 years
of expertise in the IT industry. During his career he has worked with several
technologies and programming languages such as C, C++, ASP, PHP; different
relational databases (Oracle, SQLServer, DB2, PostgreSQL), platforms (AS400, Unix,
Linux) and mainframe technologies.
In 2002, he adopted Java as his main technology. He has been working with it since
then, becoming a specialist in this field. A couple of years later, he got involved with
BPM systems.
Nowadays, he is a J2EE architect of a BPM system based on OSWorkflow in one of
the most important healthcare providers of Argentina.
I want to thank Mauricio for choosing me to review his book, which
I think has great value for the developers who want to get to know
BPM theory and jBPM technology.
I also want to mention the effort and dedication of all the developers
around the world who provide open source software of excellent
quality, making it accessible for anyone eager to get new IT
knowledge.
This material is copyright and is licensed for the sole use by ALESSANDRO CAROLLO on 18th December 2009
6393 south jamaica court, , englewood, , 80111
Dedicated to my loving future wife Mariela, and especially to my mother
who helps me with the language impedance.
This material is copyright and is licensed for the sole use by ALESSANDRO CAROLLO on 18th December 2009
6393 south jamaica court, , englewood, , 80111
This material is copyright and is licensed for the sole use by ALESSANDRO CAROLLO on 18th December 2009
6393 south jamaica court, , englewood, , 80111
This material is copyright and is licensed for the sole use by ALESSANDRO CAROLLO on 18th December 2009
6393 south jamaica court, , englewood, , 80111
Table of Contents
Preface 1
Chapter 1: Why Developers Need BPM? 7
Business Process, why should I know about that? 8
"A sequence of tasks that happen in a repeatable order" 8
"executed by humans and/or systems" 9
"to achieve a business goal" 12
I know what BPs are, but what about the final "M" in BPM? 12
BPM stages 13
BPM stages in a real-life scenario 15
BPM improvements 16
Global understanding of our processes 16
Agile interaction between systems, people, and teams 16
Reduce paperwork 17
Real time process information 17
Process information analysis 18
Statistics and measures about each execution 18
BPM and system integration "history" 18
Some buzzwords that we are going to hear when people talk
about BPM 19
Theoretical definitions 19
Integration (system integration) 20
Workflow 20
Service Oriented Architecture (SOA) 21
Orchestration 21
Technological terms 21
Workflow 21
Enterprise Service Bus (ESB) 21
BPEL (WS-BPEL) 22
Table of Contents
Business Process Management Systems (BPMS), my tool
and your tool from now on 22
BPM systems versus BPM suites 22
Why we really need to know BPM and BPMS, and how do they
change/impact on our daily life 23
New approach 23
Homework 25
Summary 27
Chapter 2: jBPM for Developers 29
Graph Oriented Programming 30
Common development process 30
Database model 32
Business logic 32
User interfaces 32
Decoupling processes from our applications 33
Graph Oriented Programming on top of OOP 34
Implementing Graph Oriented Programming on top of the
Java language (finally Java code!) 35
Modeling nodes in the object-oriented world 37
Modeling a transition in the object-oriented world 37
Expanding our language 38
Process Definition: a node container 39
Implementing our process definition 40
The Node concept in Java 40
The Transition concept in Java 41
The Definition concept in Java 42
Testing our brand new classes 43
Process execution 44
Wait states versus automatic nodes 45
Asynchronous System Interactions 46
Human tasks 47
Creating the execution concept in Java 48
Homework 52
Creating a simple language 53
Nodes description 54
Stage one 55
Stage two 56
Stage three 57
Homework solution 59
[ ii ]
This material is copyright and is licensed for the sole use by ALESSANDRO CAROLLO on 18th December 2009
6393 south jamaica court, , englewood, , 80111