OSWorkflow: A guide for Java developers and architects to integrating open-source Business Process Management - Diego Naya Lazo - E-Book

OSWorkflow: A guide for Java developers and architects to integrating open-source Business Process Management E-Book

Diego Naya Lazo

0,0
39,59 €

-100%
Sammeln Sie Punkte in unserem Gutscheinprogramm und kaufen Sie E-Books und Hörbücher mit bis zu 100% Rabatt.

Mehr erfahren.
Beschreibung

OSWorkflow is an open-source workflow engine written entirely in Java with a flexible approach and a technical user-base target. It is released under the Apache License. You can create simple or complex workflows, depending on your needs. You can focus your work on the business logic and rules. No more Petri Net or finite state machine coding! You can integrate OSWorkflow into your application with a minimum of fuss. OSWorkflow provides all of the workflow constructs that you might encounter in real-life processes, such as steps, conditions, loops, splits, joins, roles, etc.This book explains in detail all the various aspects of OSWorkflow, without assuming any prior knowledge of Business Process Management. Real-life examples are used to clarify concepts.

Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:

EPUB

Seitenzahl: 185

Veröffentlichungsjahr: 2007

Bewertungen
0,0
0
0
0
0
0
Mehr Informationen
Mehr Informationen
Legimi prüft nicht, ob Rezensionen von Nutzern stammen, die den betreffenden Titel tatsächlich gekauft oder gelesen/gehört haben. Wir entfernen aber gefälschte Rezensionen.



Table of Contents

OSWorkflow
Credits
About the Author
About the Reviewers
Introduction
What This Book Covers
Who is This Book For
Conventions
Reader Feedback
Customer support
Downloading the example code for the book
Errata
Questions
1. BPM and Workflow Basics
Business Process Orientation
BPR and BPM
Business Process Improvement
What's a BPMS?
Traceability and Auditing
Different Kinds of BPMS
System Orchestration with System-Oriented BPMS
System Orchestration
Enabling Workgroup Collaboration with People-Oriented BPMS
Components of a BPM Solution
The Workflow Management Coalition
How Components Map to the BPM Lifecycle
Open-Source BPMS
Summary
2. OSWorkflow Introduction and Basics
Downloading and Installing OSWorkflow
Getting a Taste from the Distribution
Navigating the Sample User Interface
OSWorkflow Basics
XML Definition Files
An Example Workflow
Steps, Actions, and Results: The Workflow Building Blocks
Testing the Workflow Definition
Splits and Joins
Setting Status and Old Status Values
Sending an Email Automatically
Visual Process Modeling
Visually Creating the Holiday Example
Looking at the End Result
Ways to Implement OSWorkflow
OSWorkflow as a Workflow Layer
OSWorkflow as a Centralized Workflow Server
Adding the SOAP Bindings
Summary
3. Adding Code to our Definitions
How to Deal with Transient Data
Variable Interpolation in the Definition
PropertySet and Transient Variables
Exploring PropertySet
Using the PropertySet to Store Variable Data
Using the PropertySet to Retrieve Stored Data
Cleaning the PropertySet
Configuring the PropertySet
Adding Code to our Definition
FunctionProviders
Creating our first FunctionProvider
FunctionProvider Types
Defining a Custom Function Provider
BeanShell Scripting
Built-in Functions
Conditions
Creating our own Condition
Registers
Using the LogRegister
Implementing a Register
Validators
Creating a Customer Identifier Validator
BeanShell Validators
Other Useful Descriptor Concepts
Finish Actions
Auto Actions
Summary
4. Using OSWorkflow in your Application
OSWorkflow Configuration
Registering our Process Descriptors
Embedding OSWorkflow into your Application
Starting a Workflow
Executing Actions
What's the Status?
What can I Do?
The Useful Abstract States
Querying the Workflow Store
Querying the Workflow Factory
Inspecting the Workflow Descriptor from Code
Using the Workflow Configuration Object
Workflow Interface Implementations
Loading the Descriptors—the Workflow Factory
Loading Descriptors from a Database
Persisting Instance Information
Persistence Choices
Configuring the JDBC Store
PropertySet Persistence
Configuring the JDBC PropertySet
Unit Testing your Workflow
What is JUnit?
Running the Tests
Integrating with Spring
The Object Registry—BeanFactory
Using our BeanFactory
Transaction Support in Spring
The SpringTypeResolver
Workflow Security
Step Permissions
Action Restrictions
Step Ownership
Extending User and Group Authentication and Authorization
Summary
5. Integrating Business Rules with JBoss Rules
Incorporating Business Logic into Business Processes
Simple Logic with Conditional Results
Complex Business Logic
What is "JBoss Rules"?
Creating a Rule
Executing a Rule
Integrating with OSWorkflow
RulesCondition
RulesFunctionProvider
Summary
6. Task Scheduling with Quartz
What is Quartz?
Installing
Basic Concepts
Integration with OSWorkflow
Creating a Custom Job
Trigger Functions
More about Triggers
SimpleTrigger
CronTrigger
Scheduling a Job
Scheduling from a Workflow Definition
Transactions in Quartz
JobStores
Example Application—Customer Support
Example Application—Claims Processing
Summary
7. Complex Event Processing
Complex Event Processing (CEP)
Patterns and Data
CEP in BPM
What is Esper?
The Esper Architecture
Downloading and Installing Esper
Hello World from Esper
Push and Pull Mode
EQL Queries
Integration with OSWorkflow
Esper Function Provider
Real-World Examples
Summary
8. Dashboards with Pentaho
What is Pentaho?
Pentaho Requirements
Downloading and Installing Pentaho
Setting up Pentaho to use the OSWorkflow Database
Using the Design Studio to Create our First Chart
Useful Charts for BAM Consoles
Summary
Index

OSWorkflow

Diego Adrian Naya Lazo

OSWorkflow

Copyright © 2007 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, Packt Publishing, nor its dealers or 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 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: August 2007

Production Reference: 1210807

Published by Packt Publishing Ltd.

32 Lincoln Road

Olton

Birmingham, B27 6PA, UK.

ISBN 978-1-847191-52-6

www.packtpub.com

Cover Image by Vinayak Chittar (<[email protected]>)

Credits

Author

Diego Adrian Naya Lazo

Reviewers

Gabriel Bruno

Hani Suleiman

Juan Pedro Danculovic

Development Editor

Nanda Padmanabhan

Assistant Development Editor

Rashmi Phadnis

Technical Editors

Rashmi Phadnis

Saurabh Singh

Editorial Manager

Dipali Chittar

Project Manager

Patricia Weir

Project Coordinator

Abhijeet Deobhakta

Indexer

Mithil Kulkarni

Proofreader

Chris Smith

Production Coordinators

Manjiri Nadkarni

Shantanu Zagade

Cover Designer

Shantanu Zagade

About the Author

Diego Naya Lazo is a Chief Enterprise Architect living in Buenos Aires, Argentina. He currently works for Argentina's biggest healthcare provider and has more than 10 years of experience in the IT industry. He has participated in several projects as a hands-on software architect and performed the technical lead role in many companies. His interest in computer programming began with his desire to create the most vivid 3D animations as a graphic designer at the age of 15.

His interests range from Enterprise Architecture to SOA and BPM technology. He is a Sun Certified Enterprise Architect and holds other certifications such as: SCJP, SCWCD, MCSA, and Security+. He is also a member of the WWISA and GEAO enterprise architects' associations as well as an active developer of the OSWorkflow project. He holds a Bachelors degree in IT and is currently enrolled in an MBA program.

Away from work, Diego enjoys traveling all around the world with his family. You can reach him at <[email protected]>.

I want to thank Gustavo Aguirre, my role model and mentor, for giving me advice and my reviewers Juan Pedro Danculovic and Gabriel Bruno, for loving this as much as I do. Hani Suleiman, for your commitment to the project and the whole OSWorkflow team.

This book is dedicated to Mariela and Mauro—You are the light that shines on my path through life.

About the Reviewers

Gabriel A. Brunolives in Argentina and has been working since 1997 in the IT industry. Among his various activities are consulting services in many companies, mainly in the financial industry, and he also has performed activities as an instructor of OO analysis and design, and data structures.

In 1998 he discovered the open-source world through the GNU Linux operating system, which he adopted to perform his duties. Two years later, he began to use Java and subsequently the J2EE platform professionally.

He's currently working as a Java Architect for an important health insurance company in Argentina.

I greatly thank Diego Naya for including me in this endeavor.

Hani Suleiman is the CTO of Formicary, a company specializing in integration and portal solutions for financial firms. He also is an elected individual member of the JCP Executive Committee, as well as serving on a number of enterprise-related Expert Groups.

Juan Pedro Danculovic received his Computer Science Analyst degree at the UNLP-La Plata, Argentina in 2001.

He has researched in several areas such as object-oriented and web applications design, and also web personalization aspects in web services and applications.

He has also taught web application architecture aspects courses at the UNLP.

He is currently working in the IT Architecture department at the biggest health care services company in Argentina.

Introduction

OSWorkflow is a Java-based open-source workflow engine. It helps you to focus your work on the business logic and rules rather than working on heavy coding. Integrating OSWorkflow into your application is very easy and fast. OSWorkflow provides all of the workflow constructs that you might come across in real-life processes like steps, conditions, loops, splits, joins, roles, etc. The latest version of OSWorkflow has a GUI for developing workflows, which simplifies creating workflows for simple needs. To get the best out of it, creating workflows by XML coding is recommended. OSWorkflow takes advantage of many existing Java open-source projects, including:

BeanShell: For workflow scriptingOpenForBusiness: Entity engine persistence supportGLUE: For a SOAP interfaceQuartz: For job scheduling

OSWorkflow can work in any J2EE container, including servlet containers (EJB support does not work here). OSWorkflow was designed to be as flexible as possible to fit the needs of many unique requirements.

This book explains OSWorkflow, without assuming any prior knowledge of Business Process Management. Real-life examples are used to clarify concepts. It gives step-by-step instructions on how to do things. The basics are explained first and then examples help to clarify and reinforce the principles.

What This Book Covers

Chapter 1 gives an overview of the BPM technology and the workflow engine, along with an analysis of the different types of BPMS.

Chapter 2 introduces OSWorkflow and teaches the basics of the workflow engine along with a real-life example.

Chapter 3 introduces several key features of OSWorkflow like handling persistent and transient variables, variable interpolation, built-in OSWorkflow functions, Conditions, and BeanShell scripting.

Chapter 4 covers Persistence of variables across invocations, and the FunctionProviders along with integrating OSWorkflow with Spring.

Chapter 5 introduces and integrates Rules engine and Drools open-source rule engine.

In Chapter 6 we explore the Quartz task scheduler and its integration with OSWorkflow and we give a tutorial with Quartz sending events and actions to OSWorkflow.

Chapter 7 introduces Event Stream Processing and Complex Event Processing. We give an OSWorkflow function provider that interfaces with the ESPer CEP engine and allows the monitoring of real-time process information and events.

Chapter 8 gives OSWorkflow visualization of its business process information with the Pentaho open-source BI solution. Using the charting capabilities of Pentaho we build an enterprise process dashboard to monitor and analyze the processes.

Who is This Book For

The book is aimed at experienced Java developers and system architects who want to develop complex Java applications using the OSWorkflow workflow engine. OSWorkflow is a flexible low-level workflow implementation for developers and architects; it is not a quick "plug-and-play" solution for non-technical end users.

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.

There are three styles for code. Code words in text are shown as follows: "The OSWorkflow descriptor XML must have a root element of workflow and obligatory child elements named steps and initial-actions."

A block of code will be set as follows:

… <steps> <step id="1" name="Employee request"> <actions> <action id="1" name="Request holidays"> <results> <unconditional-result old-status="Finished" step="2" status="Requested"/> </results> </action> </actions> </step> …

When we wish to draw your attention to a particular part of a code block, the relevant lines or items will be made bold:

<actions> <action id="1" name="Action 1"> <results> <unconditional-result old-status="Finished" status= "Pending" split="1"/> </results> </action> </actions>

New terms and important words are introduced in a bold-type font. Words that you see on the screen, in menus or dialog boxes for example, appear in our text like this: "You can simply click on the Authors link located on the books listing page in your browser."

Note

Important notes appear in a box like this.

Note

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 drop an email to <[email protected]>, making sure to mention the book title in the subject of your message.

If there is a book that you need and would like to see us publish, please send us a note in the SUGGEST A TITLE form on www.packtpub.com or email <[email protected]>.

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 for the book

Visit http://www.packtpub.com/support and select this book from the list of titles to download any example code or extra resources for this book. The files available for download will then be displayed.

The downloadable files contain instructions on how to use them.

Errata

Although we have taken every care to ensure the accuracy of our contents, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in text or 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 to improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/support, selecting your book, clicking on the Submit Errata link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata added to any list of existing errata. Any existing errata can be viewed by selecting your title from http://www.packtpub.com/support.

Questions

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

Chapter 1. BPM and Workflow Basics

This chapter gives an overview of the BPM technology and its core component, the workflow engine. We will analyze the different types of BPMS and the flexibility they provide in terms of workgroup collaboration and system orchestration. A brief outline of the topics covered in this chapter is as follows:

Business Process OrientationWhat is a BPMS?Types of BPM SystemsComponents of a BPM solutionOpen-source BPMS

Business Process Orientation

Today's marketplace is more global and competitive than ever. Big players are trying to attract new clients along with maintaining the existing ones (thereby making more profit for shareholders), and smaller players are entering the markets with innovative products. To add to this, customers are demanding better prices and service and governments are continuously changing regulations.

Businesses redefine themselves in order to adapt to this environment or to create new market niches for exploitation. Technology plays an important role in realizing these changes and adaptations. With the appropriate technology and tools, businesses can reduce costs, raise margins, and make the most of the existing information to understand the clients better and thus create new markets based on this data.

Businesses are focusing on internal efficiency, which aims at realizing the goals of making profit, reducing costs, creating and maintaining customers, and negotiating with suppliers in faster, cheaper, and improved ways.

With the appropriate use of technology, businesses can benefit in many ways such as greater revenue, bigger margins, automated processes, improved decision making, and so on.

Every business has a set of connected activities and functions driven by business rules such as sales, account receivables, R & D, and so on. The daily operation of such essential processes costs a big chunk of revenue from shareholders. Business Process Management (BPM) technology promises continuous enhancement of the business processes.

To diminish these costs and maximize the profit generated, each business process must be efficient and smooth. The more visible these processes are, the more we can modify them to align with the organizational strategy.

Every corporate strategy and company mission wants to treat the customer in the best possible way it can, but are the customer service processes aligned with the strategy? Is the bureaucracy of my service as minimal as possible? Are my business processes impeding the efforts of employees to excel at customer support? Am I generating long-lasting bonds between my customers and my company?

These questions can only be answered by knowing the processes, the actors, the context, etc. Today's business executives are held accountable for the performance of the processes they manage. Accountability needs objective measures, and how can we measure what we don't know?

BPR and BPM

In the early nineties, a trend called Business Process Reengineering (BPR) emerged as a panacea to make business process more efficient. A common buzzword of those days was downsizing. BPR failed its goal; downsizing was associated with layoffs and more work for the employees and not with the ultimate efficiency goal. Reengineering proposed that the existing processes be discarded and new ones be created from scratch. This was a big and ambitious approach, a big bang change for the organization.

At the beginning of 2000, the term BPM was coined to refer to a new management approach, a holistic way to produce an agile and adaptive organization based on the enhancement of business processes. BPM unlike BPR is based in an incremental approach, improving the process step by step, with enough evidence to support this move. BPM is an old approach to manage processes, which has been renewed by using technology as the improvement tool.

With the advent of IT as a strategic partner and change enabler of the business, Business Process Management Systems (BPMS) appeared to support the BPM way of doing things.

Both BPR and BPM are based on the rational analysis of a business process from every possible dimension, destructuring it into its parts and relations, stripping the unproductive activities. BPR didn't take technology tools into account, but BPM advocates technology and feedback as the drivers of business process efficiency. BPM tries to automate as many activities as possible. Iterating as many times as needed, obtaining feedback, and making incremental changes to the process is the BPM mantra.

Efficiency is not the only goal of BPM. Companies are trying to gain a competitive edge over their competitors by perfecting their processes. A better process can win a customer; for example, in customer service a better process should reduce time to market and eliminate unnecessary internal bureaucracy.

Business Process Improvement

The first BPM process improvement efforts started a few years ago with the replacement of the BPR methodology, forcing companies to rethink their strategy in operational efficiency and placing processes in a strategic place.

The first effect was creating a Business Process Improvement (BPI) area in every process-led organization in order to take care of process design, enhancement, and monitoring. Technology is a key change enabler in BPI, so it's not uncommon to see IT departments very involved in BPI projects.

BPM efforts generally take more than an iteration to get the process right. So you must analyze the existing process, add the improvement, and then take feedback from the real‑world operation. Then, you go back to the scratchboard, analyze the feedback (both numeric and from people), and add some other improvements until Key Process Indicators (KPI) are met. KPI are metrics that ensure that a process is running in its appropriate level of service, and are used to measure its Service Level Agreements (SLA).

Business functions can agree a service level with other business functions within the same company or with business partners and customers. The goal of BPM is to make the process exceed or maintain its current SLA.

Every effort to change a business process must take people into the equation. People have a hard time adapting to new roles, functions, and procedures and can really subvert the effort of BPM. BPR considered people as numbers, replaceable material, and this was a key factor for its failure.

What's a BPMS?

Business Process Management Systems (BPMS) technology is a tool that implements BPM in the enterprise. BPMS suites are designed to model, execute, and optimize business-process models, helping BPM people and executive-level managers to take the necessary steps for process improvement.

In the BPMS world, modeling, executing, and optimizing a business process is a continuous cycle and is therefore represented by a circle. The following figure is called the BPM lifecycle. It depicts the sequence of steps followed during the implementation of BPM in a process.

The BPM lifecycle begins by modeling the business process (taking an existing process or starting from scratch), followed by testing it, deploying it, and finally monitoring its execution in a production environment.

The first step is process modeling. It includes a phase of analysis if the modeling is being done for an existing process and if the modeling is being done for a new process, then it includes a design phase. Modeling is usually done by a business analyst who identifies and connects the basic building blocks of the process such as activities, roles, data, and so on. The next figure shows a business process modeling environment. It corresponds to OSDesigner, the business process modeler included in OSWorkflow.

As shown in the figure, a process is being created visually, by specifying the steps and the transition among them.

The testing phase consists of two steps, namely, validation and verification. Validation asserts correctness of the solution while verification checks conformity to the requirements. These activities include several debug iterations and test runs in a development or testing environment.

Once the process model is known to be correct, the analyst or programmer deploys the model in a process engine. This engine parses and identifies the model, and then executes the instructions and actions associated with it. The next step is monitoring the process in place.

During monitoring, we spot the bottlenecks, superfluous steps, and possible automation activities. Monitoring the process is usually a visual activity, through the use of a Business Activity Monitoring (BAM) dashboard. The BAM dashboard, also known as the BAM console, is a visual aggregation of business process information, usually real‑time information. The figure next page shows a typical BAM dashboard, which includes charts and gauges to display the different metrics of a business process.

In the meantime, we must take care of unforeseen environmental changes, like laws and regulations that have an impact on the process and the company. Regulations usually demand businesses to have a very good visibility of their processes, as well as their inputs and outputs.