Book Image

jBPM6 Developer Guide

Book Image

jBPM6 Developer Guide

Overview of this book

Table of Contents (21 chapters)
jBPM6 Developer Guide
Credits
About the Author
Acknowledgments
About the Author
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Preface

jBPM6 Developer Guide was written to provide a comprehensive guide that helps you understand the main principles used by the jBPM6 project to build smarter applications using the power of business processes. This book covers important topics such as the BPMN 2.0 specification, the WS-HT specification, domain-specific runtime configurations, integration patterns, and tooling descriptions. All these topics are covered with a technical perspective that will help developers to adopt these technologies. The book is also targeted at topics that are not usually covered by BPM systems, such as business rules, complex event processing and tooling extension capabilities, which are introduced to demonstrate the power of mixing different business knowledge descriptions into one smarter, adaptive platform.

What this book covers

Chapter 1, Why Do We Need Business Process Management?, introduces the BPM discipline. This chapter will provide the basis for the rest of the book, by providing an understanding of why and how the jBPM6 project has been designed, and the path its evolution will follow.

Chapter 2, BPM Systems' Structure, explores what the main pieces and components inside a Business Process Management system are, in depth. This chapter introduces the concept of BPM system as the natural follow-up of an understanding of the BPM discipline. The reader will find a deep and technical explanation about how a BPM system core can be built from scratch and how it will interact with the rest of the components in the BPM system infrastructure. This chapter also describes the intimate relationship between the Drools and jBPM projects, which is one of the key advantages of jBPM6 in comparison with all the other BPM systems, as well as existing methodologies where a BPM system connects with other systems.

Chapter 3, Using BPMN 2.0 to Model Business Scenarios, covers the main constructs used to model our business processes, guiding you through an example that illustrates the most useful modeling patterns. The BPMN 2.0 specification has become the de facto standard for modeling executable business processes since it was released in early 2011, and is recommended to any BPM implementation, even outside the scope of jBPM6.

Chapter 4, Understanding the KIE Workbench, takes a look into the tooling provided by the jBPM6 project, which will enable you to both define new processes and configure a runtime to execute those processes. The overall architecture of the tooling provided will be covered in this chapter as well.

Chapter 5, Creating a Process Project in the KIE Workbench, dives into the required steps to create a process definition with the existing tooling, as well as to test it and run it. The BPMN 2.0 specification will be put into practice as you create an executable process and a compiled project where the runtime specifications will be defined.

Chapter 6, Human Interactions, covers the Human task component inside jBPM6, in depth. A big feature of the BPM system is the capability to coordinate human and system interactions. It also describes how the existing tooling builds a user interface using the concepts of task lists and task forms, exposing the end users involved in the execution of human tasks, coming from multiple process definitions, to a common interface.

Chapter 7, Defining Your Environment with the Runtime Manager, covers the different strategies provided to configure an environment to run our processes. You will explore the configurations for connecting external systems, Human task components, persistence strategies and the relation a specific process execution will have with an environment, as well as methods to define their own custom runtime configuration.

Chapter 8, Implementing Persistence and Transactions, covers the shared mechanisms between the Drools and jBPM projects used to store information and define transaction boundaries. When we want to support processes that coordinate systems and people over long periods of time, we need to understand how the process information can be persisted.

Chapter 9, Integration with Other Knowledge Definitions, gives a brief introduction to the Drools rule engine. It is used to mix business processes with business rules, to define advanced and complex scenarios. We also cover Drools Fusion, and an added feature of the Drools rule engine to add the ability of temporal reasoning, allowing business processes to be monitored, improved, and covered by business scenarios that require temporal inferences.

Chapter 10, Integrating KIE Workbench with External Systems, describes the ways in which the provided tooling can be extended with extra features, along with a description of all the different extension points provided by the API and exposed by the tooling. A set of good practices is described in order to give you a comprehensive way to deal with different scenarios a BPMS will likely face.

Appendix, The UberFire Framework, goes into detail about the based utility framework used by the KIE Workbench to define its user interface. You will learn the structure and use of the framework, along with a demonstration that will enable the extension of any component in the workbench distribution you choose.

What you need for this book

This is a developer guide, so the thing you will find most useful when you read this book is a computer beside you, where you can try the examples and open, compile, and test the provided projects. The main idea behind the book is to get you up to speed in the development of applications or tooling that use jBPM6, and for this reason the book spends a lot of time with code examples and unit tests to run.

Good programming skills are required to easily understand the examples presented in this book. Most of the chapters complement the covered topics with a set of executable Maven projects. A basic understanding of Maven, Java, and JUnit is required.

Who this book is for

This book is intended for Java developers and architects who want to start developing applications using jBPM6, as well as start working on top of the provided tooling, either using or extending it. jBPM6 is a very flexible framework, but with this flexibility comes architectural and design decisions that we need to make when we start using it. This book offers a complete reference to all of the components distributed with jBPM 6.1.0.Beta3 community version, and it can be used as reference material to guide a team of developers in building efficient solutions using business processes and other knowledge definitions such as business rules and complex event processing.

After reading this book, you will have a good understanding of the jBPM6 architecture and components. jBPM6 is a Red Hat's lead open source community project and is fully supported through JBoss BPMS product. If you are interested in the BPMS product, you can find more details at http://www.redhat.com/products/jbossenterprisemiddleware/business-process/.

Conventions

In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.

Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "You can also run the server using the same command line by typing mvn exec:exec once the installation is done."

A block of code is set as follows:

public class RuleFlowProcessInstance implements ProcessInstance {
  public RuleFlowProcess getRuleFlowProcess() { ... }
  public int getState() { ... }
  public void setVariable(String name, Object value) { ... }
  public Collection<NodeInstance> getNodeInstances() { ... }
  public Object getVariable(String name) { ... }
}

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

TaskService taskService = HumanTaskServiceFactory.
        newTaskServiceConfigurator().
        entityManagerFactory(emf).
        userGroupCallback(ugCallback).
        interceptor(priority, new UserLogInterceptor()).
        getTaskService();

Any command-line input or output is written as follows:

bin/standalone.sh --server-config=standalone-full.xml

New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "Once the Finish button is clicked on, we're directed to the project editor, where we can configure dependencies, KIE bases, KIE sessions, and all the project-relevant components."

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.

To send us general feedback, simply send an e-mail to , and mention the book title via the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files for all Packt books you have purchased from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the errata submission form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded on our website, or added to any list of existing errata, under the Errata section of that title. Any existing errata can be viewed by selecting your title from http://www.packtpub.com/support.

Piracy

Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors, and our ability to bring you valuable content.

Questions

You can contact us at if you are having a problem with any aspect of the book, and we will do our best to address it.