Open-source Workflow Evaluation An evaluation of the Activiti BPM Platform. Mikael Nilsson. M.Sc. Thesis within Computer Engineering AV, 30 ECTS



Similar documents
Modeling Workflow Patterns

Process Modeling Notations and Workflow Patterns

08 BPMN/1. Software Technology 2. MSc in Communication Sciences Program in Technologies for Human Communication Davide Eynard

Business Process Driven SOA using BPMN and BPEL

Process Modeling using BPMN 2.0

Business Process Modeling

BIS 3106: Business Process Management. Lecture Two: Modelling the Control-flow Perspective

COMPUTER AUTOMATION OF BUSINESS PROCESSES T. Stoilov, K. Stoilova

SYSTEM DEVELOPMENT AND IMPLEMENTATION

BPM Process Patterns. Repeatable Designs for BPM Process Models

IBM Business Process Manager Version 8 Release 5. Hiring Tutorial IBM

Workflow Management Standards & Interoperability

Composing Services in SOA: Workflow Design, Usage and Patterns

Oracle Fusion Middleware

Modeling Guidelines Manual

Business Process Management

Koen Aers JBoss, a division of Red Hat jbpm GPD Lead

INTRODUCTION TO BUSINESS PROCESS MODELING NOTATION BPMN 1.2 AND BPMN 2.0

This document covers version of BPMN2 Modeler, published November 15, 2013.

Managing Variability in Software Architectures 1 Felix Bachmann*

What is BPM? Software tools enabling BPM

Content. Development Tools 2(63)

Dimension Technology Solutions Team 2

Created with igrafx Flowcharter 2011 ( by - Piotr Biernacki - MGX Infoservice (

IBM Business Process Manager Version 8 Release 5. Hiring Tutorial

Comparison of The Workflow Management Systems Bizagi, ProcessMaker, and Joget

MEAP Edition Manning Early Access Program Activiti in Action MEAP version 2

jbpm Explained with Simple Use Cases

zen Platform technical white paper

BPMN PATTERNS USED IN MANAGEMENT INFORMATION SYSTEMS

Orchestrating Document and Media Management using CMIS

PROJECT MANAGEMENT SYSTEM

Contents. Introduction and System Engineering 1. Introduction 2. Software Process and Methodology 16. System Engineering 53

Software Development In the Cloud Cloud management and ALM

The goal with this tutorial is to show how to implement and use the Selenium testing framework.

Sports Management Information Systems. Camilo Rostoker November 22, 2002

Software Architecture Document

Beyond the SOA/BPM frontiers Towards a complete open cooperative environment

Analytics for Performance Optimization of BPMN2.0 Business Processes

Bitrix Site Manager 4.1. User Guide

Enterprise Application Development In Java with AJAX and ORM


The Java Series. Java Essentials I What is Java? Basic Language Constructs. Java Essentials I. What is Java?. Basic Language Constructs Slide 1

ActiveVOS Server Architecture. March 2009

Agile Business Suite: a 4GL environment for.net developers DEVELOPMENT, MAINTENANCE AND DEPLOYMENT OF LARGE, COMPLEX BACK-OFFICE APPLICATIONS

Chapter 13: Program Development and Programming Languages

HP Cloud Service Automation Concepts Guide

Nexus Professional Whitepaper. Repository Management: Stages of Adoption

Specialized Programme on Web Application Development using Open Source Tools

The EMSX Platform. A Modular, Scalable, Efficient, Adaptable Platform to Manage Multi-technology Networks. A White Paper.

WebSphere Business Modeler

JBoss EntErprisE ApplicAtion platform migration guidelines

FileMaker Server 10 Help

Introducing Apache Pivot. Greg Brown, Todd Volkert 6/10/2010

Software Architecture Document

BPMN Business Process Modeling Notation

BlueJ Teamwork Tutorial

COSA. COSA BPM Suite. Roadmap

Meister Going Beyond Maven

IBM Unica emessage Version 8 Release 6 February 13, User's Guide

ARM-BASED PERFORMANCE MONITORING FOR THE ECLIPSE PLATFORM

White Paper March 1, Integrating AR System with Single Sign-On (SSO) authentication systems

How To Design An Information System

Java 7 Recipes. Freddy Guime. vk» (,\['«** g!p#« Carl Dea. Josh Juneau. John O'Conner

FileMaker Server 11. FileMaker Server Help

Oracle BPA Suite: Model and Implement Business Processes Volume I Student Guide

Manual English KOI Desktop App 2.0.x

Advantage of Jquery: T his file is downloaded from

How To Test Your Web Site On Wapt On A Pc Or Mac Or Mac (Or Mac) On A Mac Or Ipad Or Ipa (Or Ipa) On Pc Or Ipam (Or Pc Or Pc) On An Ip

Business-Driven Software Engineering Lecture 3 Foundations of Processes

CS 565 Business Process & Workflow Management Systems

Meta-Model specification V2 D

Architecture and Mode of Operation

BPMN Business Process Modelling Notation

Java Application Developer Certificate Program Competencies

Glassfish Architecture.

An introduction to creating JSF applications in Rational Application Developer Version 8.0

EMC Documentum Composer

ARIS Design Platform Getting Started with BPM

SENSE/NET 6.0. Open Source ECMS for the.net platform. 1

OnCommand Performance Manager 1.1

BPMN by example. Bizagi Suite. Copyright 2014 Bizagi

Integrity 10. Curriculum Guide

vcenter Orchestrator Developer's Guide

A Business Process Services Portal

Configuration & Build Management

Business Process Management IBM Business Process Manager V7.5

TIBCO Spotfire Statistics Services Installation and Administration. Release 5.5 May 2013

Oracle Service Bus Examples and Tutorials

TIBCO Spotfire Statistics Services Installation and Administration Guide. Software Release 5.0 November 2012

Software Development Kit

WSO2 Business Process Server Clustering Guide for 3.2.0

TestManager Administration Guide

Siebel Application Deployment Manager Guide. Siebel Innovation Pack 2013 Version 8.1/8.2 September 2013

Quareo ICM Server Software

Transcription:

Mid Sweden University The Department of Information Technology and Media (ITM) Author: E-mail address: mikaelnilsson80@yahoo.se Study programme: M. Sc. In engineering computer engineering, 240 ECTS Examiner: Tingting Zhang, tingting.zhang@miun.se Tutors: Anders Trollås, Cybercom Group, anders.trollas@cybercom.com Fredrik Håkansson, Mid Sweden University, fredrik.hakansson@miun.se Scope: 29901 words inclusive of appendices Date: M.Sc. Thesis within Computer Engineering AV, 30 ECTS Open-source Workflow Evaluation An evaluation of the

Abstract Abstract The aim of this thesis is to evaluate the newly released open-source business process management platform Activiti. The platform is evaluated in the first instance by implementing the control-flow patterns which will be used at a later stage as a comparison with other platforms that have already been evaluated. Activiti comes with a web application called Activiti Explorer which is a graphical user interface between the process engine and the user. As all the desired features commissioned by the Cybercom Group were not available in the Activiti Explorer its source-code was extended. These extended features included support for several companies per installation and the ability to customize the layout of the components in user task forms. The report is concluded with a comparison between Activiti, jbpm, OpenWFE and Enhydra shark with regards to the control-flow patterns. Keywords: Open-source, Workflow, BPM, BPMN 2.0, Activiti, Workflow patterns, Control-flow patterns ii

Acknowledgements Acknowledgements Thanks to... Anders Trollås, my tutor from Cybercom Group, for your help, guidance and support during this thesis. Fredrik Håkansson, my tutor from Mid Sweden University, for your help, reviews and valuable advice for my report. iii

Table of Contents Table of Contents Abstract... ii Acknowledgements... iii Terminology...ix 1 Introduction... 1 1.1 Background and problem motivation... 4 1.2 Overall aim and verifiable goals... 5 1.3 Scope... 6 1.4 Outline... 6 1.5 Contributions... 7 2 Theory... 8 2.1 BPMN 2.0... 8 2.2 Activiti Designer... 8 2.3 Workflow Patterns... 9 2.4 Control-flow patterns... 9 2.4.1 Basic Control Flow Patterns... 9 2.4.2 Advanced Branching and Synchronization Patterns 10 2.4.3 Multiple Instance Patterns... 11 2.4.4 State-based Patterns... 11 2.4.5 Cancellation and Force Completion Patterns... 12 2.4.6 Iteration Patterns... 12 2.4.7 Termination Patterns... 12 2.4.8 Trigger Patterns... 12 2.5 Activiti source code... 13 2.6 Activiti Explorer... 13 2.6.1 Spring Framework... 13 2.6.2 Vaadin... 14 2.6.3 Activiti Process Engine... 16 iv

Table of Contents 3 Methodology... 18 3.1 Literature studies... 18 3.2 Workflow patterns initiative... 18 3.3 Workflow patterns evaluation... 18 3.3.1 Implementing the patterns... 18 3.4 Product comparison... 19 3.5 Building the extended version of Activiti Explorer... 19 4 Implementation... 21 4.1 Control-flow patterns... 21 4.1.1 Pattern 1 Sequence... 21 4.1.2 Pattern 2 Parallel split... 21 4.1.3 Pattern 3 Synchronization... 22 4.1.4 Pattern 4 - Exclusive Choice... 22 4.1.5 Pattern 5 - Simple Merge... 23 4.1.6 Pattern 6 - Multi-Choice... 23 4.1.7 Pattern 7 - Structured Synchronizing Merge... 24 4.1.8 Pattern 8 - Multi-Merge... 24 4.1.9 Pattern 9 - Structured Discriminator... 25 4.1.10 Pattern 10 Arbitrary Cycles... 25 4.1.11 Pattern 11 - Implicit Termination... 25 4.1.12 Pattern 12 - Multiple Instances without Synchronization... 26 4.1.13 Pattern 13 - Multiple Instances with a priori Design- Time Knowledge... 26 4.1.14 Pattern 14 - Multiple Instances with a priori Run-Time Knowledge... 27 4.1.15 Pattern 15 - Multiple instances without a priori runtime knowledge... 27 4.1.16 Pattern 16 - Deferred Choice... 27 4.1.17 Pattern 17 - Interleaved Parallel Routing... 28 4.1.18 Pattern 18 Milestone... 28 4.1.19 Pattern 19 - Cancel Activity... 28 v

Table of Contents 4.1.20 Pattern 20 - Cancel Case... 29 4.1.21 Pattern 21 - Structured Loop... 29 4.1.22 Pattern 22 - Recursion... 30 4.1.23 Pattern 23 - Transient Trigger... 30 4.1.24 Pattern 24 - Persistent Trigger... 30 4.1.25 Pattern 25 - Cancel Region... 30 4.1.26 Pattern 26 - Cancel Multiple Instance Activity... 31 4.1.27 Pattern 27 - Complete Multiple Instance Activity... 31 4.1.28 Pattern 28 - Blocking Discriminator... 32 4.1.29 Pattern 29 - Cancelling Discriminator... 32 4.1.30 Pattern 30 - Structured Partial Join... 32 4.1.31 Pattern 31 - Blocking Partial Join... 32 4.1.32 Pattern 32 - Cancelling Partial Join... 33 4.1.33 Pattern 33 - Generalized AND-Join... 33 4.1.34 Pattern 34 - Static Partial Join for Multiple Instances 33 4.1.35 Pattern 35 - Cancelling Partial Join for Multiple Instances... 33 4.1.36 Pattern 36 - Dynamic Partial Join for Multiple Instances... 33 4.1.37 Pattern 37 - Acyclic Synchronizing Merge... 33 4.1.38 Pattern 38 - General Synchronizing Merge... 33 4.1.39 Pattern 39 - Critical Section... 33 4.1.40 Pattern 40 - Interleaved Routing... 34 4.1.41 Pattern 41 - Thread Merge... 34 4.1.42 Pattern 42 - Thread Split... 34 4.1.43 Pattern 43 - Explicit Termination... 34 4.2 Support for multiple companies... 34 4.2.1 Company Database and Admin web application... 34 4.2.2 CloudProcessEngines... 35 4.2.3 Login... 36 4.2.4 User Cache... 36 4.2.5 Activiti Company Deployment Manager... 36 vi

Table of Contents 4.2.6 Deployment helper tools... 38 4.3 Support for a business payment model... 39 4.4 Support for custom layout in task forms... 39 4.4.1 XML specification... 40 4.4.2 Validating custom forms... 42 4.4.3 Extending Activiti to support the custom form layouts... 42 4.4.4 Helper tools... 43 4.5 Improvements and bug fixes... 43 4.5.1 High resolution screen support... 43 4.5.2 Boolean bug fix... 44 4.5.3 Date field... 45 4.5.4 Enum fields... 46 4.5.5 Textarea component... 46 5 Results... 47 5.1 Control-flow patterns evaluation... 47 5.2 Support for multiple companies... 50 5.2.1 Admin web application and payment model... 51 5.2.2 Activiti Company Deployment Manager... 52 5.2.3 Set up a new server with the extended version of Activiti Explorer.... 56 5.3 Support for custom layout in task forms... 57 5.4 Improvements and bug fixes... 61 5.4.1 Large screen support... 61 5.4.2 Boolean bug fix... 62 5.4.3 Date field... 62 5.4.4 Enum fields... 63 6 Conclusions... 64 6.1 Control-flow evaluation... 64 6.1.1 Basic Control Flow Patterns... 64 6.1.2 Advanced Branching and Synchronization Patterns 64 6.1.3 Multiple Instance Patterns... 65 vii

Table of Contents 6.1.4 State-based Patterns... 65 6.1.5 Cancellation and Force Completion Patterns... 65 6.1.6 Iteration Patterns... 65 6.1.7 Termination Patterns... 65 6.1.8 Trigger Patterns... 66 6.1.9 Control-flow patterns... 66 6.2 Extended Activiti Explorer... 66 6.2.1 Support for multiple companies... 67 6.2.2 Support for custom layout in task forms... 67 6.2.3 Support for a business payment model... 67 6.2.4 Improvements and bug fixes... 68 7 Future work... 69 7.1 Workflow pattern evaluation... 69 7.2 Multiple companies... 69 7.3 Custom form layout... 69 References... 70 Appendix A: Process constricts in Activiti Designer... 73 Appendix B: Control-flow patterns definitions... 78 Appendix C: New Features... 88 Appendix D: Improvements and bug fixes... 122 Appendix E: XML implementation of the supported patterns... 124 viii

Terminology Terminology Acronyms BPM Business Process Management BPMN XML Business Process Model and Notation Extensible Markup Language ix

1 Introduction 1 Introduction The concept of workflow has its early roots in industrialization and was introduced in order to increase efficiency in production. In the beginning, processes were carried out entirely by humans but today processes are carried out partially or totally by computer information systems. According to Medina-Mora et al. [1] processes can be organized into material processes, information processes and business processes. Material processes consist of the assembly and delivery of physical products. Information processes are related to automated computer software that fully or partially perform tasks with interaction from humans. Business processes are a higher level concept and consist of information processes and/or material processes. Business processes describe the organization's activities from a market-centred perspective and are engineered to fulfil a business contract or to satisfy the requirements of a specific customer. This thesis deals exclusively with business processes implemented as information processes. [1] The term workflow is used casually to refer to a business process, the specification of a business process, the software that implements and automates a process or the software that supports the coordination and collaboration of people that implement a process. What workflow is and which features a workflow management system should support are not fully agreed upon, even the definition of the terms differs among software vendors. [2] Georgakopoulos et al. [2] defines the term workflow as a collection of tasks organized to accomplish some business process (e.g., processing purchase orders over the phone, provisioning telephone services, processing insurance claims). A task can be performed by one or more software systems, one or a team of humans, or a combination of these. Human tasks include interacting with computers closely (e.g., providing input commands) or loosely (e.g., using computers only to indicate task progress). In addition to a collection of tasks, a workflow defines the order of task invocation or condition(s) under which tasks must be invoked, task synchronization, and information flow (dataflow). [2] There are many different approaches to process specification with different syntax, semantics and terminology. This makes the choice of 1

1 Introduction workflow system more complex because all process specifications have their weaknesses and their strengths thus making it difficult to choose a process definition language that is suitable for a particular project. This thesis focuses on the Business Process Model and Notation language (BPMN) version 2.0. The Workflow Patterns initiative was started in 1999 by Eindhoven University of Technology and Queensland University of Technology. The goal of the initiative was to provide a comprehensive examination of the various perspectives supported by workflow systems and their process definition languages. This was conducted by categorizing common constructs used in real world processes. The purpose of the patterns is to provide an objective means of evaluating and comparing different workflow platforms and their definition languages. At the beginning they received little attention outside academia but, as of the present time, more and more vendors are evaluating their products and submitting the results to workflow patterns initiative. [3] This thesis deals with the control flow patterns as described by Wil van der Aalst et al. (2003, 2006) [4][5]. Workflow patterns are related to design patterns in architecture and computer science and were first introduced by Christopher Alexander (1977) [6] in the field of architecture and by the Gang of Four 1995 [7] in computer science. Christopher Alexander provides the following definition, Each pattern describes a problem that occurs over and over again in our environment, and then describes the core of the solution to that problem, in such a way that you can use this solution a million times over, without ever doing it the same way twice. [6] Business Process Management (BPM) extends the concept of workflow by focusing on all aspects of processes within an organization. It has methods to handle both process reengineering and process redesign and it supports the complete business process lifecycle (Design & Analysis -> Configuration -> Enactment -> Evaluation) see figure 1. [8] 2

1 Introduction Evaluation: Process Mining Business Activity Monitoring Evaluation Enactment: Operation Monitoring Maintenance Enactment Business process lifecycle Configuration Design & Analysis Design: Business Process Identification and Modeling Analysis: Validation Simulation Verification Configuration: System Selection Implementation Test and Deployment Figure 1: Business Process Lifecycle [8] The reengineering addresses the issues of system efficiency, system cost and it explores the use of new advancement in technology. Business process redesign improves the efficiency of business operations, the quality of products, reduces costs, meets new business challenges and increases customer satisfaction. A software BPM platform delivers greater control and visibility over processes and workflow integration with other applications. [8] Open-source software has grown both in popularity and maturity and is becoming a viable alternative to commercial enterprise business products. The advantages associated with choosing open-source software are that there is full control over the source code meaning that it is possible to learn how it works, to modify it, fix errors and continue its development even after the product has been discontinued. Another benefit is that there are no license fees and free community support is available. For many businesses this is not sufficient and therefore many products offer full professional support and extra features but this involves a fee. The disadvantages of choosing an open-source product are that it might not be sufficiently developed to the degree that it is able to be used in a demanding business environment. Enterprise open-source products are often more difficult to learn than their proprietary counterparts and 3

1 Introduction their intended user group are more focused towards software engineers than business analysts. 1.1 Background and problem motivation Activiti [9] is a new open-source light-weight workflow and Business Process Management platform. The development is led by Tom Baeyens and Joram Barrez and it is funded by the company Alfresco [21]. It had its first stable release on December 1 st 2010 and it has been in active development ever since. The first stable release was version 5.0 and this was because the lead developers had previously worked on jbpm (up to version 4.0) before they left Red Hat to work for Alfresco. Activiti is a relatively new product and it lacks proper independent evaluations and scientific reports. Petia Wohed et al 2007 [10] conducted a pattern-based evaluation of the open-source BPM systems, jbpm version 3.1.4 [11], OpenWFE version 1.7.3 [12] and Enhydra Shark version 2 [13]. The process definition languages used were jbpm Process Definition Language (jpdl) for jbpm, XPDL 1.0 for Enhydra shark and the OpenWFE process definition language for OpenWFE. They used the patterns from the workflow pattern initiative as the basis for their study. As of today this is the only evaluation of open-source BPM products available at the workflow patterns initiative website. Many other BPM platforms and process languages have been evaluated against the workflow patterns and the result can be found on their website [3], but since the focus of this thesis is on open-source platforms the results from other platforms will not be discussed. At the time of writing, both Activiti and its process definition language BPMN 2.0 have not yet been evaluated by the workflow pattern initiative. For this reason the IT consulting company Cybercom Group would like Activiti to be evaluated against both the control flow patterns and as an open-source product. The result from the pattern evaluation makes it easy to compare Activiti with other products. It is also easier to choose an appropriate product for a particular project by looking at its strengths and weaknesses with regards to its supported patterns. The result from the pattern evaluation of Activiti should therefore be compared to the result from the open-source BPM evaluation conducted by Petia Wohed et al 2007 [10] to determine which platform is more suitable with regards to the control flow patterns. 4

1 Introduction Activiti will also be evaluated as an open-source project by modifying and extending the source code to fit the requirements given by the Cybercom Group. 1.2 Overall aim and verifiable goals The overall aim of this thesis is to evaluate Activiti and detail its strengths and weaknesses. This result from the control flow evaluation should be used at a later stage to determine the suitability of using Activiti in a particular project and to compare it against the other opensource BPM platforms (jbpm, OpenWFE and Enhydra shark). The goal is also to offer a short theoretical overview of the control flow patterns and a brief theoretical overview of the frameworks used by the Activiti open-source project. In the practical part of this thesis an attempt to implement all the control flow patterns is made. The result should include: Table of the evaluation of Activiti against all Control flow patterns Comparison of Activti, jbpm, OpenWFE and Enhydra shark in regards to their support for the control flow patterns defined in [5]. The pattern support for jbpm, OpenWFE and Enhydra shark are taken from [10]. The Cybercom Group also requested the following extensions and modifications to Activiti Explorer, for creating an extended Activiti Explorer: Support for multiple companies within Activiti Explorer Support for customizing the layout of user task forms in Activiti Explorer. Support to change the main colours and logotypes in Activiti Explorer. Support for a business payment model (ex. pay per process instance). 5

1 Introduction All of the above points must be implemented without changing the source code of the Activiti engine. 1.3 Scope The theoretical and practical parts of the pattern evaluation will be restricted to the control flow patterns. When conducting the evaluation each pattern is implemented in Activiti Designer and graded with a '+' for direct support, '+/-' for partial support and '-' if the pattern is not supported [30]. Activiti is an open-source platform and the main interest in this study is in relation to the suitability of Activiti when choosing an open-source BPM platform. This, and the fact that the majority of commercial software is not provided with source code, is the reason why this study is limited to only open-source products. Since the extended Activiti Explorer platform is a commission from the Cybercom Group both the theoretical and practical parts will primarily focus on how to achieve the requested features. The evaluation, from an open-source perspective, consists of implementing two extensions and fixing some minor bugs. A brief theoretical presentation of the project and the major frameworks is also provided. Finally a list of all the required changes and the classes created to implement the extensions and fixes will be presented in Appendices C and D. 1.4 Outline Chapter 2 introduces the reader to BPMN 2.0 and Activiti Designer and to the control-flow patterns and then offers a short introduction to the foundation of the Activiti source code. Chapter 3 describes the methodology used in this thesis. Chapter 4 describes the implementation of the patterns and the modifications made to the source code. Chapter 5 presents the result of this thesis with tables for the patterns and screenshots of the added features. Chapter 6 presents the conclusion and discussion of this thesis. Chapter 7 presents the ideas for future work regarding the extensions to Activiti Explorer. 6

1 Introduction Appendix A: contains a list with description of the process constructs used in Activiti Designer when implementing the patterns. Appendix B: contains the definitions of all 43 control-flow patterns. Appendix C: contains a description of how the new features were added to Activiti Explorer. Appendix D: contains a description of how the improvements and bug fixes were added to Activiti Explorer. Appendix E: contains the XML implementation of the supported patterns. 1.5 Contributions The author has contributed to the Activiti evaluation of the controlflow patterns, the XML specification for the custom form layout, extensions made to the source-code of Activiti Explorer to support the requirements given by the Cybercom Group and the helper tools to facilitate the use of the extended version of Activiti Explorer. 7

2 Theory 2 Theory This chapter consists of a brief explanation of the BPMN 2.0 notation language, Activiti Designer and the workflow patterns. The last part consists of an overview of the Activiti source code and the frameworks used. 2.1 BPMN 2.0 BPMN stands for Business Process Model and Notation and version 2.0 specifies both a graphical notation language in addition to the XML notation language. It was developed by the Business Process Management Initiative and is now maintained by the Object Management Group since the merger in 2005. Business processes are modeled using connections, events, activities and gateways. Connections are used to connect activities, gateways and events together. Events are displayed as a circle and denote that something has occurred, for example start and end events. Events can also be throwing and catching events. Activities represent a piece of work that is required to be conducted. The work can be automatic or manual with human involvment. Gateways are a means of splitting up or merging the execution flow in a process. The constructs used when modeling the control-flow patterns are described in Appendix A. [20] 2.2 Activiti Designer The Activiti Designer is an Eclipse [22] plugin which allows the process developer to develop BPMN 2.0 processes using a graphical user interface with drag and drop components. Activiti Designer does not support the complete set of BPMN 2.0 components and features at the present time, but more support arrives with each new version. Activiti 5.9 has just been released with support for some new components which, at present, are labeled experimental and which are not included in Activiti Designer. Experimental components were not used when modelling the patterns. For a description of the components used in the implementation of the workflow patterns see Appendix A. 8

2 Theory 2.3 Workflow Patterns The Workflow Patterns initiative was started in 1999 by Professor Wil van der Aals and Professor Arthur ter Hofstede [3]. It was established to describe the fundamental structures in an imperative way [3]. These structures are reoccurring over and over again when modelling business processes. The research project first produced a set of twenty controlflow patterns for workflow systems [4]. Since then patterns have evolved and they now cover the following workflow perspectives, control-flow, data, resource, exception handling and presentation. These patterns have been used to evaluate existing workflow systems so as to determine their suitability for a particular project and for the development of workflow systems. [24] 2.4 Control-flow patterns In 2006 a new paper with a revised view on the control-flow patterns was released [5]. The new revised definitions were an effort to make the implementation and interpretation of the patterns less ambiguous by taking the strictest possible interpretations. In addition to the twenty revised patterns, twenty-three new control-flow patterns were also introduced. For the definitions of all 43 control-flow patterns see Appendix B. The forty-three control-flow patterns can be divided into eight classes which are described below. [25] 2.4.1 Basic Control Flow Patterns In the class Basic Control Flow Patterns are those patterns dealing with the execution order of activities and the ability to run activities concurrently and patterns that deal with simple choice and merger. These patterns are the fundamental building blocks of a workflow system. The following patterns belong to the basic control flow patterns, for their definitions see Appendix B. [25] 1. Sequence 2. Parallel Split 3. Synchronization 4. Exclusive Choice 9

2 Theory 5. Simple Merge 2.4.2 Advanced Branching and Synchronization Patterns In the class Advance Branching and Synchronization Patterns are patterns that deal with advance merging and synchronization constructs during which several branches come together. There is also a pattern that deals with the choice regarding which branches to activate. In the case of synchronization the subsequent activity should be called first when all the active branches have reached the construct, while in some patterns, only the first thread is passed to the subsequent activity while the others are blocked. There are also patterns that deal with the creation and synchronization of threads within a branch. The following is the complete set of patterns belonging to the advanced branching and synchronization patterns and for their definitions see Appendix B. [25] 6. Multi-Choice 7. Structured Synchronizing Merge 8. Multi-Merge 9. Structured Discriminator 28. Blocking Discriminator 29. Cancelling Discriminator 30. Structured Partial Join 31. Blocking Partial Join 32. Cancelling Partial Join 33. Generalised AND-Join 37. Local Synchronizing Merge 38. General Synchronizing Merge 41. Thread Merge 42. Thread Split 10

2 Theory 2.4.3 Multiple Instance Patterns In the class Multiple Instance Patterns are those patterns dealing with multiple instances of the same activity. The patterns deal with the initiation, the synchronization for completed instances and in dynamically adding new instances. The following patterns belong to the multiple instance patterns, for their definitions see Appendix B. [25] 12. Multiple Instances without Synchronization 13. Multiple Instances with a Priori Design-Time Knowledge 14. Multiple Instances with a Priori Run-Time Knowledge 15. Multiple Instances without a Priori Run-Time Knowledge 34. Static Partial Join for Multiple Instances 35. Cancelling Partial Join for Multiple Instances 36. Dynamic Partial Join for Multiple Instances 2.4.4 State-based Patterns In the class State-based Patterns are those patterns dealing with synchronization, choice and which branches are able to be activated based on the state of the process instance. The state of a process instance is referring to its execution status and the related process and working data, which includes the status of activities. The following patterns belong to the state-based patterns, for their definitions see Appendix B. [25] 16. Deferred Choice 17. Interleaved Parallel Routing 18. Milestone 39. Critical Section 40. Interleaved Routing 11

2 Theory 2.4.5 Cancellation and Force Completion Patterns In the class Cancellation and Force Completion Patterns are those patterns dealing with the forced cancellation and completion of running activities and process instances. These patterns can easily be implemented using exception handling. The following patterns belong to the cancellation and forced completion patterns, for their definitions see Appendix B. [25] 19. Cancel Task 20. Cancel Case 25. Cancel Region 26. Cancel Multiple Instance Activity 27. Complete Multiple Instance Activity 2.4.6 Iteration Patterns In the class Iteration Patterns are those patterns dealing with the repetitive behaviour of a process. The following patterns belong to the iteration patterns, for their definitions see Appendix B. [25] 10. Arbitrary Cycles 21. Structured Loop 22. Recursion 2.4.7 Termination Patterns In the class Termination Patterns are the patterns that deal with the termination and completion of a process. The following patterns belong to the termination patterns, for their definitions see Appendix B. [25] 11. Implicit Termination 43. Explicit Termination 2.4.8 Trigger Patterns In the class Trigger Patterns are those patterns dealing with the external signals that might be necessary to start certain activities. The following 12

2 Theory patterns belong to the trigger patterns, for their definitions see Appendix B. [25] 23. Transient Trigger 24. Persistent Trigger 2.5 Activiti source code The Activiti open-source project consists of many different modules. The modules that are found in the Activiti 5.9 subversion repository [26] are activiti-cactus, activiti-camel, activiti-cdi, activiti-cxf, activiti-engine, activiti-mule, activiti-osgi, activiti-spring, activiti-webapp-exploirer2 and activiti-webbapp-rest2. The code is written in Java and it is using the build manager Maven. The modules that are of interest in this study are primarily the activiti-engine, which is a BPMN 2.0 process engine and the activiti-webapp-explorer2, which is a web interface that uses the process engine. All the source code is licensed under the Apache License, Version 2.0 [14]. 2.6 Activiti Explorer Activiti Explorer [27] is a web application that is built with the Vaadin framework and it utilizes the Spring framework to start the process engine. It has an easy-to-use interface for starting processes and handling human tasks. On the task page, the tasks appear in the user s inbox or, if they are assigned to a group, under the queued menu. The process page allows the users to start new processes or to view the current execution state on an already started processes belonging to the user. The manage page is visible for users with administrator rights. The administrator can deploy new processes in this page, delete old ones, manage users and groups and investigate the content in the database tables. [27] 2.6.1 Spring Framework The Spring framework assists in the building of enterprise Java applications by allowing the programmer to focus on the problem rather than on pluming code [15]. The module used by Activiti is the inversion of control container, which is responsible for managing objects lifecycles, and this is conducted by means of dependency injection. The main principle behind dependency injection is to load objects at runtime 13

2 Theory instead of at compile time, which is the usual way of loading objects. This is conducted by specifying all objects to be loaded in an XML file that is parsed by Spring and the objects are then instantiated and loaded into a container, accessible from the Java code. This makes it possible to add objects to the software without the necessity to recompile it. Apart from the late binding, it is also possible to assign values (this includes other objects loaded by Spring) to objects using either the constructor or setters directly in the XML file. This is of course a small sub set of the features provided by the Spring framework but deals with those used in Activiti. 2.6.2 Vaadin Vaadin [16] is a Java framework for rich internet applications. Vaadin is based on the Google Web Toolkit (GWT) [17], and it is a rapid application development framework to build secure rich internet applications. It allows the programmer to write an Internet application directly in Java and compiles it to both the client and server software. The client and server communicate via asynchronous Javascript (AJAX) and thus there is no requirement for any browser plugins. See figure 2 for the complete communication chain. Web Browser Client-Side Engine Java Web Server Vaadin UI Components Your Java Application Web Service EJB DB Vaadin UI Components Figure 2: Vaadin communication [28] All user interface components that are available in Vaadin are listed in the inheritance diagram in figure 3. 14

2 Theory Figure 3: UI Component Inheritance Diagram. [28] The Component class is the top most class in this hierarchy. The components used when creating input forms are all descendants of the Field class and they are all implementing the AbstractField interface. Fields are components that have a value that can be changed directly in the interface by the user. Fields use the Vaadin data model which means that the value is handled as a Property. A Property is an interface that uses get and set methods which take a value of type Object. This makes the interface compatible with all types of components and values since all objects inherit from the Object class in Java. For the inheritance diagram of the Field class see figure 4. [28] 15

2 Theory Figure 4: Field Interface Inheritance Diagram. [28] 2.6.3 Activiti Process Engine The central point of the Process Engine API is the ProcessEngine class. To create an instance of the ProcessEngine the ProcessEngineConfiguration object can be used via the Spring framework [15], xml or directly in Java code. To handle multiple instances of the ProcessEngine the ProcessEngines class can be used and it contains methods for safely creating and closing all running engines. Once an engine is up and running its services containing the workflow/bpm methods can be obtained by calling the corresponding getters on the engine object, see figure 5 for all available services. [29] ProcessEngine RepositoryService ManagmentService TaskService HistoryService IdentityService FormService RuntimeService Figure 5: Activiti Engine and its services [29] Repository Service The RepositoryService provides access to the repository of process definitions and other deployments. It is used for deploying to the database and retrieving deployed items. [29] 16

2 Theory Management Service The ManagementService is used for maintenance and administration operations on the process engine. [29] Task Service The TaskService provides access to tasks and form operations. [29] History Service The HistoryService provides access to information about ongoing and past process instances. [29] Identity Service The IdentityService provides information on users and groups. [29] Form Service The FormService provides access to form data. [29] Runtime Service The RuntimeService provides access to process instances, definitions and deployments. [29] 17

3 Methodology 3 Methodology The methodology used in this thesis consists, in the first instance, a theoretical study on BPM, workflow patterns, Activiti and Vaadin. The second part is a practical implementation of the patterns and the extension of the functionality of Activiti Explorer. 3.1 Literature studies The online library at Mid Sweden University was used to search for articles and publications regarding BPM and workflow patterns. The workflow patterns initiative website [3] also contained many sources. The following documents were found [1][2][4][5][8][10] via the online library or at the workflow patterns initiative website. To learn about Activiti and Vaadin the main websites [9][16] were used as the primary sources and, in addition, the following books were used [18][19]. 3.2 Workflow patterns initiative The workflow patterns initiative website [3] together with the papers [4][5] were the main source of information regarding the patterns. The sources were used when studying the theory behind the patterns and for the implementation and to evaluate the result. 3.3 Workflow patterns evaluation When evaluating Activiti against the patterns, Activiti Designer was chosen as the process development tool. Because it is an official tool and offers an easy graphical environment with drag and drop components. There are other BPMN 2.0 modelling tools, for example, Activiti Modeller, which is a web based modeller but these do not offer support for Activiti specific extensions to the BPMN 2.0 language. For the evaluation of the patterns, the requirement is that a graphical development tool is to be used and that the patterns are able to be implemented through its use. [30] 3.3.1 Implementing the patterns The description of the pattern was read first and from this the motivation was provided as were the, context and implementation. Once the pattern had been fully understood an attempt was made to implement it 18

3 Methodology in Activiti Designer. If the functionality of the pattern was achieved then the evaluation criteria and product evaluation was read. Finally, the finished implementation was graded according to the product evaluation criteria. If the functionality was not achieved then further reading with regards to Activiti and BPMN 2.0 was conducted. Once all the attempts have failed then the pattern is considered to be not supported. [30] When grading the support for the patterns a + sign is given to the patterns that are directly supported, meaning that one of the language constructs satisfies the evaluation criteria of the pattern. For partial support +/- is given, meaning that there is some limitation when implementing the pattern. The sign is given to patterns that are not supported. A pattern is considered to be not supported if any form of programming or scripting is required or the solution results in a spaghetti diagram. [30] 3.4 Product comparison The Activiti open-source BPM platform was compared to the other BPM platforms by looking at the support for the different control-flow patterns. The patterns support for the different platforms is discussed for each control-flow patterns class. The pattern support for jbpm, Open- WFE, and Enhydra Shark comes from this study [10] and the result is also available at the workflow patterns initiative website [30]. 3.5 Building the extended version of Activiti Explorer The extended platform was created by extending the Activiti Explorer to support several companies per installation and the customization of user input forms. Since Activiti is an open-source project, the source code for Activiti Explorer was downloaded with Apache Subversion and modifications were made directly in the code. The development tool used was Eclipse with the Maven plugin installed. The code was firstly examined in order to discover a means of implementing the different features. Once a sound strategy had been determined that did not involve many changes, the implementation commenced. Following this, a great deal of testing was conducted to ensure that the implementation worked as intended. During the course of the project some bugs and smaller imperfections were discovered and changed to a more desirable 19

3 Methodology solution. At the conclusion of the project, version 5.9 of Activiti was released. All the changes had been made to version 5.8 and these were re-examined and brought over to version 5.9 one at a time and all the changes documented (see Appendix C and D for details). 20

4 Implementation 4 Implementation The first part of this chapter shows the implementation of all controlflow patterns with a description and a diagram for the supported patterns. In the second part the implementation of the extended version of Activiti Explorer is explained. 4.1 Control-flow patterns All patterns are modelled using the Activiti Designer which is an eclipse plugin. A brief description is provided for all the patterns and a graphical diagram is additionally shown for the supported patterns. The graphical diagrams are saved as a png file in Activiti Designer and they depict the graphical representation of the process being modelled. When modelling the patterns, all tasks are represented by a user task that is assigned to the initiator. This simplifies the testing easier as the same user both initiates the process and receives all the user tasks. For each of the supported patterns there is also a detailed XML in Appendix E. 4.1.1 Pattern 1 Sequence The pattern is directly supported by using a Sequence Flow construct between activities. For its graphical representation see figure 6. Figure 6: Pattern 1 - Sequence 4.1.2 Pattern 2 Parallel split The pattern is directly supported by using a Parallel Gateway construct. For its graphical representation see figure 7. 21

4 Implementation Figure 7: Pattern 2 - Parallel split 4.1.3 Pattern 3 Synchronization The pattern is directly supported by using a Parallel Gateway construct. For its graphical representation see figure 8. Figure 8: Pattern 3 - Syncronization 4.1.4 Pattern 4 - Exclusive Choice The pattern is directly supported by using an Exclusive Gateway construct. For its graphical representation see figure 9. 22

4 Implementation Figure 9: Pattern 4 - Exclusive choice 4.1.5 Pattern 5 - Simple Merge The pattern is directly supported by using an Exclusive Gateway construct. For its graphical representation see figure 10. Figure 10: Pattern 5 - Simple merge 4.1.6 Pattern 6 - Multi-Choice The pattern is directly supported by using an Inclusive Gateway construct with conditions on the outgoing Sequence Flows. For its graphical representation see figure 11. 23

4 Implementation Figure 11: Pattern 6 - Multi-choice 4.1.7 Pattern 7 - Structured Synchronizing Merge The pattern is directly supported by using an Inclusive Gateway construct. For its graphical representation see figure 12. Figure 12: Pattern 7 - Structured synchronizing merge 4.1.8 Pattern 8 - Multi-Merge The pattern is directly supported by using an Exclusive Gateway construct. For its graphical representation see figure 13. 24

4 Implementation Figure 13: Pattern 8 - Multi-merge 4.1.9 4.1.10 Pattern 9 - Structured Discriminator The pattern is not supported. Support for this pattern is referred to in the BPMN specification but Activiti Designer does not support the complex gateway construct. Pattern 10 Arbitrary Cycles The pattern is directly supported by using the Exclusive Gateway construct with Sequence Flows to construct the loops. For its graphical representation see figure 14. Figure 14: Pattern 10 - Arbitrary cycles 4.1.11 Pattern 11 - Implicit Termination The pattern is directly supported by the BPMN process language and when all paths have reached an end event the process is terminated. For its graphical representation see figure 15. 25

4 Implementation Figure 15: Pattern 11 - Implicit Termination 4.1.12 Pattern 12 - Multiple Instances without Synchronization The pattern is partially supported. By default, the multi instance task will synchronize and the subsequent flow will only be called once all instances are completed. In order to circumvent this a Parallel Gateway is used to split the thread of control before calling the multiinstance. To specify the number of instances to be started, the Loop cardinality is set to the variable containing the number of instances. For its graphical representation see figure 16. Figure 16: Pattern 12 - Multiple instances without synchronization 4.1.13 Pattern 13 - Multiple Instances with a priori Design-Time Knowledge The pattern is directly supported. The Loop cardinality for the multiinstance is set at the design time to the number of activity instances in this case 3. For its graphical representation see figure 17. 26

4 Implementation Figure 17: Pattern 13 - Multiple instances with a priori design-time knowledge 4.1.14 Pattern 14 - Multiple Instances with a priori Run-Time Knowledge The pattern is directly supported. The Loop cardinality for the multiinstance is set at the design time to a process variable. For its graphical representation see figure 18. Figure 18: Pattern 14 - Multiple instances with a priori run-time knowledge 4.1.15 4.1.16 Pattern 15 - Multiple instances without a priori run-time knowledge The pattern is not supported. The number of instances cannot be changed after the multi-instance task has started. Pattern 16 - Deferred Choice The pattern is partially supported. It can be modelled using a sub process with error events to cancel the remaining listeners after a choice has been made. Experimental support exists for the event based gateway construct and signals which should offer full support for this pattern (Support for this patterns is therefore expected in future releases). For its graphical representation see figure 19. 27

4 Implementation Figure 19: Pattern 16 - Deferred choice 4.1.17 4.1.18 4.1.19 Pattern 17 - Interleaved Parallel Routing The pattern is not supported. There is no construct that offers serial execution of parallel activities. Pattern 18 Milestone The pattern is not supported. Activiti has no support for states. Pattern 19 - Cancel Activity The pattern is directly supported by using an error boundary event attached to the activity being cancelled and issue an error message to cancel the activity. For its graphical representation see figure 20. 28

4 Implementation Figure 20: Pattern 19 - Cancel activity 4.1.20 Pattern 20 - Cancel Case The pattern is directly supported, by encapsulating the process in a subprocess and using error events. For its graphical representation see figure 21. Figure 21: Pattern 20 - Cancel case 4.1.21 Pattern 21 - Structured Loop The pattern is directly supported. Both post- and pre-test loops can be constructed using exclusive gateways and a process variable. For the post-test loop see figure 22 and for the pre-test see figure 23. 29

4 Implementation Figure 22: Pattern 21 - Structured loop (post-test) Figure 23: Pattern 21 - Structured loop (pre-test) 4.1.22 4.1.23 4.1.24 4.1.25 Pattern 22 - Recursion The pattern is not supported. There is no means of specifying recursion in the Activiti Designer. Pattern 23 - Transient Trigger The pattern is not supported.there is no means of specifying triggers in Activiti Designer. Pattern 24 - Persistent Trigger The pattern is not supported. There is no means of specifying triggers in Activiti Designer. Pattern 25 - Cancel Region The pattern is partially supported, by encapsulating the region in a subprocess and using error events to cancel the region. For its graphical representation see figure 24. 30

4 Implementation Figure 24: Pattern 25 - Cancel Region 4.1.26 Pattern 26 - Cancel Multiple Instance Activity The pattern is directly supported by using an error boundary event to cancel all remaining instances. For its graphical representation see figure 25. Figure 25: Pattern 26 - Cancel Multiple Instance Activity 4.1.27 Pattern 27 - Complete Multiple Instance Activity The pattern is directly supported, by using a boundary event or setting the completion condition of the multi-instance. For the graphical representation when using a boundary event see figure 26 and figure 27 for an example using the completion condition. 31

4 Implementation Figure 26: Pattern 27 - Complete Multiple Instance Activity (Boundary event) Figure 27: Pattern 27 - Complete Multiple Instance Activity (completion condition) 4.1.28 4.1.29 Pattern 28 - Blocking Discriminator The pattern is not supported. Activiti Designer does not support the complex gateway construct. Pattern 29 - Cancelling Discriminator The pattern is directly supported, using a sub-process and an error event to cancel the remaining activities. For its graphical representation see figure 28. Figure 28: Pattern 29 - Cancelling Discriminator 4.1.30 4.1.31 Pattern 30 - Structured Partial Join The pattern is not supported. Activiti Designer does not support the complex gateway construct. Pattern 31 - Blocking Partial Join The pattern is not supported. Activiti Designer does not support the complex gateway construct. 32

4 Implementation 4.1.32 4.1.33 4.1.34 4.1.35 Pattern 32 - Cancelling Partial Join The pattern is not supported. Activiti Designer does not support the complex gateway construct. Pattern 33 - Generalized AND-Join The pattern is not supported. The parallel gateway executes the subsequent activity when it has received the same number of input signals as the number of input branches, even if all signals come from the same branches. Pattern 34 - Static Partial Join for Multiple Instances The pattern is not supported. There is no means of triggering the subsequent task without cancelling the other instances. Signals, which at present are labelled experimental, might be used to accomplish this. Pattern 35 - Cancelling Partial Join for Multiple Instances The pattern is supported, and can be modelled by using an error boundary event or by setting the completion condition to M=N. For its graphical representation see figure 29. Figure 29: Pattern 35 - Cancelling partial join for multiple instances 4.1.36 4.1.37 4.1.38 4.1.39 Pattern 36 - Dynamic Partial Join for Multiple Instances The pattern is not supported. The number of instances cannot be changed after the multi-instance task has started. Pattern 37 - Acyclic Synchronizing Merge The pattern is not supported. The Inclusive Gateway has to be used in a structured context. Pattern 38 - General Synchronizing Merge The pattern is not supported. The Inclusive Gateway has to be used in a structured context. Pattern 39 - Critical Section The pattern is not supported. Activiti Desiger offers no support for limiting concurrent execution of activities. 33

4 Implementation 4.1.40 4.1.41 4.1.42 4.1.43 Pattern 40 - Interleaved Routing The pattern is not supported. Ad-hoc processes are not supported in Activiti Designer. Pattern 41 - Thread Merge The pattern is not supported. startquantity attribute of activities is not supported in Activiti Designer. Pattern 42 - Thread Split The pattern is not supported. completionquantity attribute of activities is not supported in Activiti Designer. Pattern 43 - Explicit Termination The pattern is not supported. The Terminate End Event construct is missing in Activiti Designer. 4.2 Support for multiple companies To support multiple companies without changing the code for the engine, the ProcessEngines class was used to register one engine per company. For a complete list of changes required to implement the multi-company support see Appendix C. 4.2.1 Company Database and Admin web application When Activiti Explorer is initialized it loads a configuration file via Spring to start the engine. Since one engine will be used per company, it is necessary to start several engines and to add engines without restarting the application. Because of this, the configuration file was changed to contain the configuration for a JDBC connection to a MySQL database that stores the configuration parameters for the engines. See figure 30 for the database table. When the application starts it loads the JDBC connection via Spring and investigates all the records and sets up one engine per company and starts it. 34

4 Implementation Company PK CompanyName DriverClassName URL UserName Password MailServerHost MailServerUserName MailServerPassword MailServerPort MailServerDefaultFrom MailServerUseTLS Figure 30: Company database table To handle the administration of companies, a Vaadin web application was created that can be accessed by adding /admin to the URL. The Admin web application can be used to start and stop the engines for companies that are already in the database. The login information for the admin web application is stored in the Admin database table (see figure 31) and the password is stored using a SHA-1 cryptographic hash function. Admin PK UserName Password Figure 31: Admin database table 4.2.2 CloudProcessEngines The CloudProcessEngines class was created to ease the handling of multiple companies. The class communicates directly with the engines, and all communications between a logged in user in Activiti Explorer and the engine pass through this object. All classes that have previously communicated with the engine were changed to communicate via the CloudProcessEngines with the exception of the classes handling the login of the user (see next section). When the process engines are registered they are associated with a name, which in this case is the same as the company name. When getprocessengine() method is called on the CloudProcessEngines object, it firstly reads the company name associat- 35

4 Implementation ed with the logged in user and then calls the ProcessEngines class in order to retrieve the engine registered with that company name and then returns it. The Admin web application also communicates with this class. 4.2.3 4.2.4 4.2.5 Login A new implementation of the logged in user interface was created with the addition of a field containing the company name. This class is attached to the application object and is therefore globally available. The login screen was also extended to include an input field for the company name. When the user attempts to log in, an engine is loaded associated with the given company and, if it exists, the user s credentials (name and password) are sent to the engine for verification. If no engine is associated with the company name, then the login fails. After the login has succeeded and providing that the credentials were correct, the user object (with company name) is attached to the application object and the user is logged in. User Cache The user cache is used to cache users for the purpose of speeding up user lookup operations. Only one user cache does not work with multiple companies since they have different users, and because of this and the time constraints on this project, the user cache implemented simply retrieves users from the database instead of actually caching them. Activiti Company Deployment Manager This application makes it easier to create and modify company information that is used when deploying a new company. It is a Java application with a graphical user interface (GUI) that is using the Swing framework. The file format, when saving and loading the company deployment file, is a zip file with the structure shown in figure 32. The theme/img directory contains all the images for the theme, the users/pictures directory contains all the pictures of the users and the processes directory contains all processes to be deployed. 36

4 Implementation / theme img styles.xml users pictures users.xml processes Figure 32: File structure of the company deployment zip file To create a theme, one color is picked and the logos are loaded from a file or generated based on the first logo. After the color and logos have been selected the application will generate images for buttons and the menubar together with a css file to be used as a Vaadin theme. The algorithm used for the real-time preview of the menubar uses the hardware accelerated graphics and lower settings to make it faster on older machines. The algorithm used when generating the actual images uses the Java 2d graphics API with the best quality settings together with antialiasing. The theme can be exported as a Vaadin theme or saved in a zip file, making it usable for both the modified version in addition to the original version of Activiti Explorer. Users can be easily added, deleted and edited directly in the application. The users are saved in an XML file, with pictures in a separate directory, for an example, see below. In the edit user dialog, groups can be added or removed. The dropdown menu of available users is loaded from the groups.xml file, which is located in the application directory. This file can be edited in a text editor to add more groups, see below for the xml structure. The processes are merely a list of loaded process files that will be saved in the zip file. 37

4 Implementation <?xml version="1.0" encoding="utf-8"?> <users> <user> <userid>kermit</userid> <firstname>kermit</firstname> <lastname>the Frog</lastname> <password>kermit</password> <email>kermit@activiti.org</email> <picture>kermit.jpg</picture> <groups> <group id="admin" type="security-role">admin</group> <group id="management" type="assignment">management</group> <group id="sales" type="assignment">sales</group> <group id="marketing" type="assignment">marketing</group> <group id="engineering" type="assignment">engineering</group> </groups> </user> </users> User xml file format <?xml version="1.0" encoding="utf-8"?> <groups> <group id="admin" type="security-role">admin</group> <group id="management" type="assignment">management</group> <group id="sales" type="assignment">sales</group> <group id="marketing" type="assignment">marketing</group> <group id="engineering" type="assignment">engineering</group> </groups> Groups xml file format 4.2.6 Deployment helper tools To make it easier to set up the initial database and to write the configuration file used by Activiti Explorer when it is started, a command line Java application was created. The application takes the path to the Activiti Explorer, database info and credentials (to create the schemas and tables). It creates the activiti_cloud schema and a MySQL user with the same name and sets the privileges for this user to only use Select operations on the activiti_cloud schema. The password for the user is auto generated with a simple random algorithm. Finally, the configuration file with the credentials is created in the Activiti Explorer directory path. To make it easier to set up a new company a command line Java application was created. The application takes a zip file containing the theme to be used together with all users and processes (see Activiti Company Deployment Manager). It also takes the path to the theme directory and the database credentials. It firstly copies the theme to the Activiti Explorer theme directory and then launches an offline process engine. 38

4 Implementation Then a schema and a user are created (they both have the company name). Following this, the process engine sets up the database and builds all the tables. All users are then added to the database via the engine and finally the processes are deployed. When everything is completed the process engine is shut down and the configuration and the database credentials are written to the Company table (for uml diagram see figure 30). 4.3 Support for a business payment model The invoice can be reached from the admin web application (for an image see result chapter). For each company there is a date field and a button. By choosing a month and pressing the invoice data button an invoice for the selected month is downloaded for that company. The invoice is created by accessing the process engine for the selected company and accessing its HistoryService. In order for this to work, the engine must be started and running. The invoice created is in a XML format for easy integration with the desired billing software, since it is a well-known standard in data serialization. 4.4 Support for custom layout in task forms By default, all form components are as shown in figure 33. There is no means of changing this layout, thus, in order to provide the process developer with the ability to change it, Activiti Explorer was extended. In order to support different types of layouts, an XML specification (for the tags see below) for describing the layout was developed. When developing processes, each user task has an associated formkey property, the name of this property should be the same as the filename of the desired layout file for that form. If this field is left empty the default layout is choosen, which is one field per row. When deploying processes which are using custom layouts, the process definition file, together with all layout files, must be zipped and deployed as a zip file, this is because no changes are required in the code responsible for the deployment. 39

4 Implementation Figure 33: Standard form layout in Activiti Explorer. 4.4.1 XML specification The following shows, all the tags available in the XML specification created for the purpose of offering the process developer the ability to customize form layouts: Form, block, row, column, field, divider, a, img, br, space. form The form is the outer most tag and it contains the entire layout. field 40

4 Implementation The field is the graphical component that is displayed together with its label. The field takes an id attribute, which should be the same as the id of the field in the corresponding task form in the process definition. The description attribute is a text attribute that is used as a tool tip text, which is displayed when the user is hovering over the input field with the mouse pointer. If the id of a field is not found in the process definition file then the field is not displayed. The field tag cannot contain any other tags. block The block layout can contain any of the following tags: row, column, field, divider, a, img and br. It has a type attribute which can be one of the following two values divider and panel. The divider has a line on top and the panel has four borders that can be styled by specifing a style name in the style attribute (the name should corespond to a style in the Vaadin theme). The caption of the block is the title that is written at the top of the block. A block is only displayed if at least one of its interior fields is also displayed. row The row tag displays all its conponents on a single line. It can contain the following tags: field, a, img and space. The expand attribute can be either true or false, with the true meaning being that all the components are distributed with equal width over the entire row and the false meaning being that the components are laid out one after the other with their default width. column The column tag lays out the components one per row with the difference is that the label is on the left side of the component instead of being on top, which is the default. The column can contain the folowing tags: field, divider, a, img and br. divider 41

4 Implementation The divider tag draws a line on the screen and the content of the element. It cannot contain any other tags. a The a tag represents a url link. It can contain an img tag. Its attributes are href, used to refer to a static link and var, to a process variable that contains the link. If an image is not used the element is displayed. img The img tag represents an image that is displayed. The image can be part of a link but cannot contain any tags. The src attribute is the URL in which the image can be reached. The alt attribute is the text that is displayed when the image cannot be located. The height and width attributes are used to change the default size of the image. All of these attributes are written directly to the HTML page that is viewed by the user. br The br tag is used to write a linebrake by writing the br tag to the generated HTML page. The br tag cannot contain any tags, attribues or elements. space The space tag is used to insert a space between components in the row tag when its expand attribute is set to false. It cannot contain any tags, attributes or elements 4.4.2 4.4.3 Validating custom forms When developing custom forms a dtd file can be used to validate its syntax. The dtd can be found in Appendix C. Extending Activiti to support the custom form layouts The following classes were changed to add support for custom form layouts: FormPropertiesComponent, FormPropertiesForm, ProcessDefinitionDetailPanel and TaskDetailPanel. Their functions are to take data from the process engine and render the form and to send the data from 42

4 Implementation the components to the process engine. For a more detailed description regarding the changes see Appendix C. The FormTemplateParser class was created and it is instantiated with the process instance id and the formkey. It loads the custom form layout xml by looking for the file with the same name as the formkey in the deployment of the process instance, by accessing the RepositoryService of the process engine. Once the xml is loaded it is parsed. The getformlayout method is then called and it takes a map with all components (Vaadin Field objects) and properties, and returns a VerticalLayout with all components ready to be displayed. When the user is finished, the map with all the components is used to go through them for validation and if an error occurs then this is displayed and the user is unable to proceed before it is fixed. After the validation has finished successfully the component values are sent to the engine. 4.4.4 Helper tools To speed up the development of the custom form files, a command-line application written in Java was created. This application takes the path to the process definition file as the command-line input and writes one custom layout file per start event / user task that has a value written in the formkey property. This auto generated custom form file will have the same filename as the value in the formkey and contain all fields. The default files is an acceptable starting point when developing the custom form layouts as the developer only has to add rows, columns, blocks and so on. 4.5 Improvements and bug fixes Here are some of the improvements and bug fixes made to Activiti Explorer. A more detailed description is available in Appendix D. 4.5.1 High resolution screen support The reason why the Activiti Explorer web application is not able to achieve a webpage beyond the width of 1920 pixels (see figure 34) is that it is specified in the css file. By removing this line the webpage will fill up all the space on the higher resolution screens. For a detailed description regarding how this can be performed see Appendix D. 43

4 Implementation Figure 34: The Activiti web page not extending beyond 1920 pixels. 4.5.2 Boolean bug fix The reason why the Boolean datatype does not work (see figure 35) when it is referenced to display the value of a process variable is because of a data conversion error. The checkbox component in Vaadin is using the interface Property, which has a member function setvalue that takes a value of type Object (the object which all objects inherit from). In the particular case of the checkbox it takes the type Object to conform to the standard interfaces used by all components in Vaadin but it expects that it can be cast to a Boolean. The Activiti process engine stores process variables as strings, which cannot be cast to a Boolean and in order to to fix this a conversion from string to Boolean is necessary. 44

4 Implementation Figure 35: Error message when trying to display a form using a Boolean field that is showing the value of a process variable. 4.5.3 Date field The standard date field is, by default, shown with controls with a resolution of milliseconds, even if the date format written in the process definition file is at a lower resolution. In figure 36 a date field with millisecond resolution and input field with a minute resolution is shown. 45

4 Implementation Figure 36: Date field for selecting date and time with higher resolution than required. 4.5.4 Enum fields The enum fields have, by default, an empty option null even when it is a required field, making this choice invalid (see figure 37). That is why the null was removed when the field is required, even after it has been removed the field is empty before a choice is made. Figure 37: Enum dialog for a required field 4.5.5 Textarea component To add a custom component such as the textarea component (figure 38) it is necessary to create two classes. The first class implements Abstract- FormType and it is used to register the type with the engine. The second class implements AbstractFormPropertyRenderer and it is used to convert between the Field and FormProperty. Both of these files are loaded with Spring when Activiti Explorer starts, thus it is possible to extend without the necessity of changing the source code. For a description of changes and source code for the implemented classes see Appendix D. Figure 38: Textarea component 46

5 Results 5 Results This chapter is divided in two parts, the result from the control-flow pattern evaluations and then a presentation of the extended version of Activiti Explorer. 5.1 Control-flow patterns evaluation The result from the control-flow patterns implementation can be seen in table 1 together with the result from this paper [10]. Table 1: Control-flow pattern eveluation Pattern Basic Control Flow Patterns Pattern 1 (Sequence) + + + + Pattern 2 (Parallel Split) + + + + Pattern 3 (Synchronization) + + + + Pattern 4 (Exclusive Choice) + + + + Pattern 5 (Simple Merge) + + + + Advanced Branching and Synchronization Patterns Pattern 6 (Multi-Choice) + - +/- + Pattern 7 (Structured Synchronizing Merge) + - - - Pattern 8 (Multi-Merge) + + - - Pattern 9 (Structured Discriminator) - - + - Pattern 28 (Blocking Discriminator) - - - - Pattern 29 (Cancelling Discriminator) + - + - Pattern 30 (Structured Partial Join) - - + - Pattern 31 (Blocking Partial Join) - - - - Pattern 32 (Cancelling Partial Join) - - - - Pattern 33 (Generalized AND-Join) - + - - Pattern 37 (Local Synchronizing Merge) - - +/- - Pattern 38 (General Synchronizing Merge) - - - - Pattern 41 (Thread Merge) - +/- - - Pattern 42 (Thread Split) - +/- - - Activiti JBPM OpenWFE Enhydra Shark 47

5 Results Pattern Multiple Instance Patterns Pattern 12 (Multiple Instances without Synchronization) +/- + + + Pattern 13 (Multiple Instances with a priori Design-Time Knowledge) + - + - Pattern 14 (Multiple Instances with a priori Run-Time Knowledge) + - + - Pattern 15 (Multiple Instances without a priori Run-Time Knowledge) - - - - Pattern 34 (Static Partial Join for Multiple Instances) - - + - Pattern 35 (Cancelling Partial Join for Multiple Instances) + - + - Pattern 36 (Dynamic Partial Join for Multiple Instances) - - - - State-based Patterns Pattern 16 (Deferred Choice) +/- + - - Pattern 17 (Interleaved Parallel Routing) - - +/- - Pattern 18 (Milestone) - - - - Pattern 39 (Critical Section) - - - - Pattern 40 (Interleaved Routing) - - + - Cancellation and Force Completion Patterns Pattern 19 (Cancel Task) + + - - Pattern 20 (Cancel Case) + - +/- - Pattern 25 (Cancel Region) +/- - - - Pattern 26 (Cancel Multiple Instance Task) + - - - Pattern 27 (Complete Multiple Instance Task) + - - - Iteration Patterns Pattern 10 (Arbitrary Cycles) + + + + Pattern 21 (Structured Loop) + - + - Pattern 22 (Recursion) - - + + Termination Patterns Pattern 11 (Implicit Termination) + + + + Pattern 43 (Explicit Termination) - - - - Trigger Patterns Pattern 23 (Transient Trigger) - + + - Pattern 24 (Persistent Trigger) - - - - Activiti JBPM OpenWFE Enhydra Shark In table 2, 3 and 4 are the number of directly, partially and not supported patterns per class for each platform. In table 5 the sum of all supported, partially supported and not supported patterns for each platform are shown. 48

5 Results Table 2: Number of directly supported patterns per class. Directly supported pattern classes Basic Control Flow Patterns (5) 5 5 5 5 Advanced Branching and Synchronization Patterns (14) 4 2 3 1 Multiple Instance Patterns (7) 3 1 5 1 State-based Patterns (5) 0 1 1 0 Cancellation and Force Completion Patterns (5) 4 1 0 0 Iteration Patterns (3) 2 1 3 2 Termination Patterns (2) 1 1 1 1 Trigger Patterns (2) 0 1 1 0 Activiti JBPM OpenWFE Enhydra Shark Table 3: Number of partially supported patterns per class. Partially supported pattern classes Basic Control Flow Patterns (5) 0 0 0 0 Advanced Branching and Synchronization Patterns (14) 0 2 2 0 Multiple Instance Patterns (7) 1 0 0 0 State-based Patterns (5) 1 0 1 0 Cancellation and Force Completion Patterns (5) 1 0 1 0 Iteration Patterns (3) 0 0 0 0 Termination Patterns (2) 0 0 0 0 Trigger Patterns (2) 0 0 0 0 Activiti JBPM OpenWFE Enhydra Shark 49

5 Results Table 4: Number of not supported patterns per class. Not supported pattern classes Basic Control Flow Patterns (5) 0 0 0 0 Advanced Branching and Synchronization Patterns (14) 10 10 9 13 Multiple Instance Patterns (7) 3 6 2 6 State-based Patterns (5) 4 4 3 5 Cancellation and Force Completion Patterns (5) 0 4 4 5 Iteration Patterns (3) 1 2 0 1 Termination Patterns (2) 1 1 1 1 Trigger Patterns (2) 2 1 1 2 Activiti JBPM OpenWFE Enhydra Shark Table 5: All control-flow patterns. All control-flow patterns Directly supported 19 13 19 10 Partially supported 3 2 4 0 Not supported 21 28 20 33 Activiti JBPM OpenWFE Enhydra Shark 5.2 Support for multiple companies The extended login screen can be seen in figure 39 and the admin web application in figure 40 and 41. 50

5 Results Figure 39: Activiti Explorer login screen with the extended support for multiple companies. 5.2.1 Admin web application and payment model The admin web application requires a different set of login credentials (which are stored in the admin database table). After a successful login the user has the ability to start and stop company engines for all companies that have their configuration stored in the company database table. If the process engine of a company is stopped, then no proceses will run and users belonging to that company cannot log in. Another feature is the ability to download an invoice for a given company and month, below is en example of such an invoice. <?xml version="1.0" encoding="utf-8"?> <invoice customerid="cybercom" period="201205"> <current_no_uses>4</current_no_uses> <usage> <process id="employeedevelopment:2:318" started="1" usertasks_started="9" /> <process id="employeedevelopment:1:8" started="1" usertasks_started="5" /> <process id="workrelatedinjury:1:16" started="1" usertasks_started="3" /> <process id="neworder:1:105" started="1" usertasks_started="2" /> </usage> </invoice> The process id tag in the invoice is composed of <process definition key>:<process definition version>:<generated id>. The generated id is a unique number to guarantee uniqueness in a cluster environment. Started is the number of times that the process has started and usertasks_started is the total number of user tasks started by the process (this number may vary for each run since there can be more than one path in a process). 51

5 Results Figure 40: Admin web application login Figure 41: Admin web application with one company 5.2.2 Activiti Company Deployment Manager The company deployment manager is used to create the company deployment file. This file contains the theme, users and processes for the company. In figure 42 is the application with the default theme used by Activiti. 52

5 Results Figure 42: Company deployment manager with default theme In figure 43 the company deployment manager with a custom theme is displayed. The buttons next to the logos are open file, reload original logo and the button with the gears is to auto generate a logo based on the top most logo which has been used in figure 43. Figure 46 shows this theme in use. 53

5 Results Figure 43: Manager with custom theme The company deployment manager is shown in figure 44 with the user s tab selected and the user Kermit open for editing. In the user tab, users can be added, removed and edited from the user menu or by right clicking on a user in the table view. It is also possible to export and import users from an xml file. 54

5 Results Figure 44: Editing a user in the company manager application The company deployment manager is shown in figure 45 with the processes tab selected. Here, the user is able to add and remove processes. 55

5 Results Figure 45: Processes tab in the company manager application 5.2.3 Set up a new server with the extended version of Activiti Explorer. 1. Install Java, Tomcat and MySQL if they are not installed. 2. Deploy the war file in tomcat (wite down the path to the directory). 3. Run setup command-line Java application with the directory (from 2) and credentials to the database as parameters. To run this step requires credentials that can write on the path and create a schema and user in the database. Enter a username and password for the admin web application. 4. Restart the webapplication (required to obtain the database credentials). 5. Make a company deployment file (using the Activiti company deployment manager or manualy). 6. Run the company deployment command-line Java program with database credentials and the path to the deployment file. This step 56

5 Results requires credentials that allow a write access to the company table and the creation of a new schema and user. 7. Log in to the admin web application and start company process engine. To add more companies repeat steps 5, 6 and 7. 5.3 Support for custom layout in task forms The custom form layout works by deploying the process definition together with layout xml files for each user input form that has a name written in its formkey attribute. Below is an example of a task form declaration from a process definition file followed by a form layout that was auto generated using the helper tool and the final version which uses many of the tags for demonstration purposes. <usertask id="enterorder" name="enter Order (${uuid)" activiti:assignee="${initiator" activiti:formkey="custom_form_layout.xml"> <extensionelements> <activiti:formproperty id="user" name="user" type="user" required="false" readable="true" writable="true"></activiti:formproperty> <activiti:formproperty id="companyname" name="company Name" type="string" required="true" readable="true" writable="true"></activiti:formproperty> <activiti:formproperty id="companyaddress" name="company Address" type="string" required="true" readable="true" writable="true"></activiti:formproperty> <activiti:formproperty id="description" name="description" type="textarea" required="true" readable="true" writable="true"></activiti:formproperty> <activiti:formproperty id="firstname" name="first Name" type="string" required="true" readable="true" writable="true"></activiti:formproperty> <activiti:formproperty id="middlename" name="middle Name" type="string" required="false" readable="true" writable="true"></activiti:formproperty> <activiti:formproperty id="lastname" name="last Name" type="string" required="true" readable="true" writable="true"></activiti:formproperty> <activiti:formproperty id="address" name="address" type="string" required="true" readable="true" writable="true"></activiti:formproperty> <activiti:formproperty id="zipcode" name="zip Code" type="string" required="true" readable="true" writable="true"></activiti:formproperty> <activiti:formproperty id="city" name="city" type="string" required="true" readable="true" writable="true"></activiti:formproperty> <activiti:formproperty id="email" name="email" type="string" required="true" readable="true" writable="true"></activiti:formproperty> <activiti:formproperty id="phone" name="phone" type="string" required="true" readable="true" writable="true"></activiti:formproperty> <activiti:formproperty id="articleid" name="article Id" type="string" required="true" readable="true" writable="true"></activiti:formproperty> <activiti:formproperty id="nbrofarticles" name="number of Articles" type="long" required="true" readable="true" writable="true"></activiti:formproperty> <activiti:formproperty id="delivery" name="delivered by" type="enum" required="true" readable="true" writable="true"> <activiti:value id="fedex" name="fedex"></activiti:value> <activiti:value id="dhl" name="dhl"></activiti:value> <activiti:value id="ups" name="ups"></activiti:value> </activiti:formproperty> <activiti:formproperty id="deliverydate" name="delivery date" type="date" datepattern="yyyy-mm-dd" required="true" readable="true" writable="true"></activiti:formproperty> 57

5 Results <activiti:formproperty id="fast" name="fast delivery" type="boolean" required="true" readable="true" writable="true"></activiti:formproperty> <activiti:formproperty id="emailto" name="to" type="string" required="true" readable="true" writable="true"></activiti:formproperty> <activiti:formproperty id="subject" name="subject" type="string" required="true" readable="true" writable="true"></activiti:formproperty> <activiti:formproperty id="message" name="description" type="textarea" required="true" readable="true" writable="true"></activiti:formproperty> </extensionelements> </usertask> <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE form SYSTEM "activiti_custom_forms.dtd"> <form> <field id="user" description="" /> <field id="companyname" description="" /> <field id="companyaddress" description="" /> <field id="description" description="" /> <field id="firstname" description="" /> <field id="middlename" description="" /> <field id="lastname" description="" /> <field id="address" description="" /> <field id="zipcode" description="" /> <field id="city" description="" /> <field id="email" description="" /> <field id="phone" description="" /> <field id="articleid" description="" /> <field id="nbrofarticles" description="" /> <field id="delivery" description="" /> <field id="deliverydate" description="" /> <field id="fast" description="" /> <field id="emailto" description="" /> <field id="subject" description="" /> <field id="message" description="" /> </form> <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE form SYSTEM "activiti_custom_forms.dtd"> <form> <block type="panel" caption="company"> <column> <field id="user" description="user" /> <field id="companyname" description="companyname" /> <field id="companyaddress" description="company Address" /> <divider /> <field id="description" description="description" /> </column> </block> <br /> <block type="divider" caption="personal"> <row> <field id="firstname" description="enter your first name here" /> <field id="middlename" description="enter your middle name here" /> <field id="lastname" description="enter your last name here" /> </row> <field id="address" description="enter your address here" /> <row> <field id="zipcode" description="enter your zip code here" /> <field id="city" description="enter your city here" /> </row> <divider /> <field id="email" /> <field id="phone" /> 58

5 Results <a href="http://cybercom.com" >Cybercom Group</a> </block> <br /> <divider>article</divider> <field id="articleid" description="enter article id here" /> <field id="nbrofarticles" description="enter the number of articles here" /> <row> <field id="delivery" /> <field id="deliverydate" /> </row> <field id="fast" /> <br /> <divider>email</divider> <column> <field id="emailto" /> <field id="subject" /> <divider /> <field id="message" /> </column> <br /> <row expand="false"> <a href="http://cybercom.com" ><img src="http://www.cybercom.com/templates/cybercom/images/logo_blue.gif" alt="cybercom website"/></a> <space/> <img src="http://www.cybercom.com/templates/cybercom/images/logo_blue.gif" alt="cybercom logo"/> </row> </form> All the tabs have been removed from the XML above in order to increase the readability in this document. In figures 46 and 47 screenshots regarding the appearance of the custom form (from the XML above) when it is displayed in the modified version of Activiti Explorer are shown. 59

5 Results Figure 46: The first part of the custom form layout This is almost the same user form as that in figure 33 (Implementation chapter) with the exception of the two textarea fields, which are not supported by default in Activiti Explorer. In figure 33, standard string input fields are used instead of the two textarea fields. Another difference is that Related content, People and Subtasks have been moved to after the user input form since they are considered less important than the form. 60

5 Results Figure 47: The second part of the custom form layout 5.4 Improvements and bug fixes The following provides information relating to some of the improvements and bug fixes performed in the extended version of Activiti Explorer. 5.4.1 Large screen support The fix for large screen support can be seen in figure 48. 61

5 Results Figure 48: Large screen support 5.4.2 Boolean bug fix A Boolean field working without error messages when assigned a process variable can be seen in figure 49. Figure 49: Working Boolean field 5.4.3 Date field The date field displaying only the controls nesssesary to enter a date and time in the requested resolution is shown in figure 50. 62

5 Results Figure 50: Improved date field 5.4.4 Enum fields The enum field without the option to enter a null value when the field is required is shown in figure 51. Figure 51: Improved enum field 63

6 Conclusions 6 Conclusions The first part of the conclusion concerns the control-flow pattern evaluation and the second part deals with the software extensions made to Activiti Explorer. 6.1 Control-flow evaluation One of the goals of this study was to perform a pattern based analysis of of Activiti using the control-flow patterns. The pattern based evaluation offers an independent and objective means of assessing the support of business process constructs that are commonly used in practice. When starting to evaluate Activiti, it became apparent that it does not offer full BPMN 2.0 support. There has been recently released experimental support for more BPMN constructs but these are not yet supported in Activiti Designer. Since Activiti is a relatively young product, the support for signals and the event based gateway will eventually become stable and since they strive to be a BPMN 2.0 process engine, other constructs such as the complex gateway will probably also become available in future releases. Other open-source platforms that are starting to support BPMN 2.0 are jbpm (version 5) and ProcessMaker (bpmn 2.0 preview release). As is the case for many open-source offerings, Activiti is a work in progress and with each new release more functionality is added to the engine. 6.1.1 6.1.2 Basic Control Flow Patterns All the basic control-flow patterns were supported, which was expected since they are the basic building blocks when modelling business processes. All open-source products offer full support for this class of control-flow patterns. Advanced Branching and Synchronization Patterns Activiti offers very limited support in this class of control-flow patterns. The BPMN offers better support in this class with its complex gateway constructs and several attributes that are missing in Activiti. The parallel gateway is not implemented in Activiti as suggested and thus it does not support the generalized AND-join pattern. It became apparent after 64

6 Conclusions an investigation involving other open-source offerings that they also offer limited support in this class. 6.1.3 6.1.4 6.1.5 6.1.6 6.1.7 Multiple Instance Patterns Activiti offers a wide support in relation to the multiple instance patterns. The main aspects which are missing are a means of adding instances to a multi-instance while it is executing and in completing the multi-instance without cancelling the remaining instances (using a condition). jbpm and Enhydra Shark offer almost no support for the multiple instance patterns while OpenWFE offers slightly better support than Activiti. State-based Patterns All open-source products have either limited or no support for the statebased patterns. This is mostly because they do not support the notion of state or cannot act on it. When the event based gateway becomes available in Activiti the support will increase slightly. Even though there is only limited support for these patterns, some are able to be implemented using programming. Cancellation and Force Completion Patterns The cancellation and force completion patterns are one of the advantages of Activiti over the other open-source products. While Activiti is offering full support for almost all patterns, the other open-source products offer almost no support. Iteration Patterns Activiti offers almost full support for the iteration patterns. The only pattern not supported is the recursive pattern. OpenWFE is the only platform that offers full support for these patterns. Termination Patterns The termination patterns are partially supported by all open-source products. The implicit termination pattern is supported across the board while the explicit termination is not supported by any products. In older versions of Activiti, the explicit termination pattern was supported via a terminate end event but this construct is no longer available in Activiti Designer. 65

6 Conclusions 6.1.8 6.1.9 Trigger Patterns Activiti and Enhyrda Shark do not support any of the trigger patterns. jbpm and OpenWFE only support the Transient Trigger pattern. Control-flow patterns The overall conclusion based on an evaluation of the control-flow patterns is that Activiti offers good support in comparison to that offered by the other open-source products. But there are some areas especially in the state-based patterns, trigger patterns and advanced branching and synchronization pattern that are not supported by Activiti. On the other hand an investigation of the Cancellation and Force Completion Patterns shows that Activiti is superior to the other platforms and offers almost full support. It is important to evaluate what kind of processes are going to be developed before choosing Activiti since there are other offerings, not dealt with in this study, that are able to offer more direct support for some specific needs. It is always better to have direct support for the patterns used in a process than to rely on custom code or messy diagrams which can lead to logical errors and problems when improving the process during the redesigning phase. 6.2 Extended Activiti Explorer One important aspect of this evaluation was to evaluate Activiti as an open-source product with the possibility of extending the code. This was conducted by developing two significant extensions and by fixing some bugs and minor improvements. When this project started, the extensions were made to Activiti 5.8 and by the end of the project, version 5.9 had been released and all the changes were merged in to this version without any difficulties. Since Activiti is releasing newer versions several times a year it can prove to be time consuming to maintain an extended version. From version 5.8 and 5.9 the majority of the improvements have been to the engine and not the Activiti Explorer module, in fact only two Java files have been changed. The source code of Activiti is well structured and it uses good naming conventions which makes it easy to navigate and to understand. However, as with many software systems, it relies on underlying frameworks such as Spring and Vaadin. In order to better understand the source code it is important to have a more in-depth understanding of these frameworks. 66

6 Conclusions 6.2.1 6.2.2 6.2.3 Support for multiple companies The solution presented here has the advantage that it enables multiple companies in the same web application. One of the drawbacks involves scaling since there are limits associated with one server and, once this limit has been reached, it will be necessary to install one or more additional servers. Another problem is the amount of changes required to implement this feature as it will prove be time consuming to merge this feature for each new version of Activiti. Another solution would be to install each company as a separate web application. This requires more work and takes up more disk space and uses one administrator application per company. By using the Activiti company deployment manager it is easy to assemble all company users and processes in addition to creating a customized appearance by choosing a color and new logotypes. Support for custom layout in task forms Only four classes were changed and one was added to support the custom form tasks. The discovery involved in relation to the classes which were handling the form rendering and how it was possible to add the changes, this was facilitated by the naming and good organization of the packages and classes. The solution is relatively easy to use for a process developer and the helper tool makes it somewhat easier. The drawbacks associated with this solution are that XML editing is time consuming and the XML parsing is necessary every time a user task is executed, which consumes computer resources. The default behaviour makes the extended version of Activiti fully compatible with processes created for the original version. By creating blocks with common fields it is possible to build standard templates that can be used by several tasks, because the blocks are not displayed if they are empty and fields missing from the layout XML file will be displayed at the bottom of the form. Support for a business payment model The payment model is very simple and it allows a pay per process instance and payment for each executed user task. Of course, it is also possible to charge a fixed price per month per process. When updating a process, both the old and new processes are listed separately in the invoice XML making it possible to have different charges, for example, taking out an extra charge for a new improved process. When starting a 67

6 Conclusions new process it is always the newest version available that is started (user cannot choose) but previously started processes when a new version is deployed, will not change. Only processes that were started during the selected month are listed in the invoice XML. What is still missing is a means of integrating the invoice into billing software but since it is in an XML format it should be easy to make a converter that converts it to any desired format for a specific product. 6.2.4 Improvements and bug fixes When fixing bugs and making minor improvements it is vital to possess knowledge of the Vaadin framework. The source code for the Activiti Engine was also used as a source of information for the internal functionality in the engine. 68

7 Future work 7 Future work Here are some suggestions for future work that were not investigated because of time constraints. 7.1 Workflow pattern evaluation To better understand Activities capabilities it should be evaluated against the other workflow pattern perspectives provided by the workflow patterns initiative: Workflow Resource Patterns Workflow Data Patterns Exception Handeling Patterns Presentation Patterns 7.2 Multiple companies To improve the scaling and administration, the engine should be separated from the graphical user interface. There is already an Activiti REST web application module but it is still labelled as being experimental. With this type of a setup one admin application can be used for all companies, even if they are installed on different machines, as long as they are accessible from the network. In relation to application to application communication there is no requirement for a single web application to control all engines and they can also be deployed as separate web applications. 7.3 Custom form layout To improve the solution, an eclipse plugin can be developed that integrates with Activiti Designer and provides the process developer with the ability to build the forms by using a graphical user interface with drag and drop components. To speed up the rendering of the task forms, the layout definitions can be parsed when they are deployed and saved in a binary format. The binary format has to be compact and to be read in a straightforward manner when creating the specific form for the user task in order to improve performance. 69

Terminology References [1] R. Medina-Mora, T. Winograd, and R. Flores, ActionWorkflow as the Enterprise Integration Technology, Bulletin of the Technical Committee on Data Engineering, IEEE Computer Society, Vol. 16, No.2 June 1993. [2] D. Georgakopoulos, M. Hornick, and A. Sheth. An Overview of Workflow Management: From process Modeling to Workflow Automation Infrastructure. Distributed and Parallel Databases, 3(2):119-153, April 1995. [3] The Workflow Patterns Initiative, Main page of the initiative site, http://www.workflowpatterns.com/ Retrieved 2012-06-13. [4] W.M.P van der Aalst, A.H.M. ter Hofstede, B. Kiepuszewski, and A.P. Barros. Workflow Patterns. Distributed and Parallel Databases, 14(3):5-51, July 2003. [5] N. Russell, A.H.M. ter Hofstede, W.M.P. van der Aalst, and N. Mulyar. Workflow Control-Flow Patterns: A Revised View. BPM Center Report BPM-06-22, BPMcenter.org, 2006. [6] Alexander, Christopher. A Pattern Language: Towns, Buildings, Construction. Oxford University Press. 1977. [7] Erich Gamma, Richard Helm, Ralph Johnson, John Vlissides. Design Patterns: Elements of Reusable Object-Oriented Software, 1994 [8] Mathias Weske. Business Process Management: Concepts, Languages, Architectures. Springer 2007 [9] Activiti, Activiti website, http://www.activiti.org/. Retrieved 2012-06-13 [10] P. Wohed, B. Andersson, A.H.M. ter Hofstede, N.C. Russell, and W.M.P. van der Aalst. Patterns-based Evaluation of Open Source 70

Terminology BPM Systems: The Cases of jbpm, OpenWFE, and Enhydra Shark. BPM Center Report BPM-07-12, BPMcenter.org, 2007. [11] jbpm, jbpm website, http://www.jboss.org/jbpm, Retrieved 2012-06-13 [12] OpenWFE, OpenWFE website, http://sourceforge.net/projects/openwfe/, Retrieved 2012-06-13 [13] Enhydra Shark, Enhydra shark website, http://sourceforge.net/projects/sharkwf/, Retrieved 2012-02-23 [14] Apache 2.0 License, Information about the Apache 2.0 license, http://www.apache.org/licenses/license-2.0 Retrieved 2012-06- 13 [15] Spring Framework, Spring framework website, http://www.springsource.org/ Retrieved 2012-06-13 [16] Vaadin Framework, Vaadin framework website, https://vaadin.com/home Retrieved 2012-06-13 [17] Google Web Toolkit, Google Web Toolkit website, https://developers.google.com/web-toolkit/ Retrieved 2012-06-13 [18] Tijs Rademakers, Activiti in Action: Executable business processes in BPMN 2.0, Manning Publications 2012. [19] Nicolas Frankel, Learning Vaadin, Packt Publishing 2011. [20] Object Management Group, The BPMN 2.0 specification, http://www.omg.org/spec/bpmn/2.0/ Retrieved 2012-06-13 [21] Alfresco, Alfresco website, http://www.alfresco.com/ Retrieved 2012-06-13 [22] Eclipse, Eclipse project website, http://www.eclipse.org/ Retrieved 2012-06-13 [23] Activiti Designer, Documentation about Activiti Desiger, http://www.activiti.org/userguide/index.html#activitidesigner Retrieved 2012-06-13 71

Terminology [24] The Workflow patterns, Information about workflow patterns, http://www.workflowpatterns.com/patterns/ Retrieved 2012-06- 13 [25] The Wokflow Patterns, Information about the Control-Flow Patterns, http://www.workflowpatterns.com/patterns/control/ Retrieved 2012-06-13 [26] Activiti subversion repository, The Activiti source code, http://svn.codehaus.org/activiti/ Retrieved 2012-06-13 [27] Activiti Explorer, Information about Activiti Explorer, http://www.activiti.org/userguide/index.html#activitiexplorer Retrieved 2012-06-13 [28] Marko Grönroos, Book of Vaadin - 4th Edition, Vaadin Ltd 2012-06-11 [29] Activiti User Guide, Information about Activiti, http://www.activiti.org/userguide/index.html Retrieved 2012-06- 13 [30] The Workflow Patterns Initiative, Information about opensource product evaluations, http://www.workflowpatterns.com/evaluations/opensource/ Retrieved 2012-06-13 72

Appendix A: Process constricts in Activiti Designer Appendix A: Process constricts in Activiti Designer Here are the constructs found in Activiti Designer 5.8 that are used when modeling the patterns. Connection Sequence flow is used to connect activities, gateways and events to each other. The connection is in the direction of the arrow, its graphical notation is shown in figure 52. Event Figure 52: Sequence Flow Start Event is used to define the starting point for the process. It can take values to be written into process variables and the name of the process variable to contain the name of the process initiator. Its graphical notation is shown in figure 53. Figure 53: Start Event End Event is used to define where a process branch ends. The process ends first when all threads have reached an end event. The graphical notation (figure 54) is similar to Start Event but with a thicker boarder. 73

Appendix A: Process constricts in Activiti Designer Figure 54: End Event Error End Event is an end event that throws an error inside a process that can be caught by the error boundary event. Its graphical notation is shown in figure 55. Figure 55: Error End Event Timer Start Event is used to start a process at a specific time or time intervals. Its graphical notation is shown in figure 56. Task Figure 56: Timer Start Event In the task category there are automated tasks and manual tasks that represent a piece of work that is part of the process. The only ones used when modeling the control-flow patterns are the user task and the sub process. User task is used to model a task that has to be completed by a human actor. The User Task can be used to write process variables with values provided by the user. It is possible to create multiple instances of a task by setting the properties in the multi-instance tab. Its graphical notation is shown in figure 57. 74

Appendix A: Process constricts in Activiti Designer Figure 57: User Task Sub Process can be used to construct a process inside a process. On the sub process boundary events can be attached for error handling and timers. The graphical notation is shown in figure 58. Gateway Figure 58: Sub Process Parallel Gateway is used to execute activities in parallel or to make sure that all incoming activities have to be completed before the subsequent activity is executed. Its graphical notation is shown in figure 59. Figure 59: Parallel Gateway Exclusive gateway is used for selecting one outgoing sequence flow based on conditional logic. Each incoming thread will result in a thread 75

Appendix A: Process constricts in Activiti Designer being passed to the subsequent activity. Its graphical notation is shown in figure 60. Figure 60: Exclusive Gateway Inclusive Gateway is used for conditional logic such as the Exclusive Gateway but the difference being that more than one outgoing sequence flow can be used. The subsequent activity will be executed first when all incoming branches that were split with an inclusive gateway earlier in the process have been activated. Its graphical notation is shown in figure 61. Boundary Event Figure 61: Inclusive Gateway Error Boundary Event is used to catch errors that are thrown inside the activity where it is defined. Its graphical notation is shown in figure 62. Figure 62: Error Boundary Event Timer Boundary Event is used to attach a timer to an activity that starts when the activity is executed and fires when the specified time is reached. When the timer fires the execution of the activity is halted and the sequence flow following the boundary event is executed. Its graphical notation is shown in figure 63. 76

Appendix A: Process constricts in Activiti Designer Intermediate Event Figure 63: Timer Boundary Event Timer Catching Event is used to create a timer to delay the execution of the subsequent activity. When the timer is executed the countdown starts and the subsequent activity is executed first when the countdown has reached zero. Its graphical notation is shown in figure 64. Figure 64: Timer Catching Event 77

Appendix B: Control-flow patterns definitions Appendix B: Control-flow patterns definitions This chapter consists of a brief explanation of the 43 control-flow workflow patterns with their original definition. Pattern 1 Sequence An activity in a workflow process is enabled after the completion of a preceding activity in the same process. [5] Synonyms Sequential routing, serial routing [5]. Pattern 2 Parallel split The divergence of a branch into two or more parallel branches each of which execute concurrently. [5] Synonyms AND-split, parallel routing, parallel split, fork [5]. Pattern 3 Synchronization The convergence of two or more branches into a single subsequent branch such that the thread of control is passed to the subsequent branch when all input branches have been enabled. [5] Synonyms AND-join, rendezvous, synchronizer [5]. Pattern 4 - Exclusive Choice The divergence of a branch into two or more branches. When the incoming branch is enabled, the thread of control is immediately passed to precisely one of the outgoing branches based on the outcome of a logical expression associated with the branch. [5] Synonyms XOR-split, exclusive OR-split, conditional routing, switch, decision, case statement [5]. 78

Appendix B: Control-flow patterns definitions Pattern 5 - Simple Merge The convergence of two or more branches into a single subsequent branch. Each enablement of an incoming branch results in the thread of control being passed to the subsequent branch. [5] Synonyms XOR-join, exclusive OR-join, asynchronous join, merge [5]. Pattern 6 - Multi-Choice The divergence of a branch into two or more branches. When the incoming branch is enabled, the thread of control is immediately passed to one or more of the outgoing branches based the outcome of distinct logical expressions associated with each of the branches. [5] Synonyms Conditional routing, selection, OR-split, multiple choice [5]. Pattern 7 - Structured Synchronizing Merge The convergence of two or more branches (which diverged earlier in the process at a uniquely identifiable point) into a single subsequent branch. The thread of control is passed to the subsequent branch when each active incoming branch has been enabled. [5] Synonyms Synchronizing join, synchronizer [5]. Pattern 8 - Multi-Merge The convergence of two or more branches into a single subsequent branch. Each enablement of an incoming branch results in the thread of control being passed to the subsequent branch. [5] Pattern 9 - Structured Discriminator The convergence of two or more branches into a single subsequent branch following a corresponding divergence earlier in the process model. The thread of control is passed to the subsequent branch when the first incoming branch has been enabled. Subsequent enablements of incoming branches do not result in the thread of control being passed on. The discriminator construct resets when all incoming branches have been enabled. [5] 79

Appendix B: Control-flow patterns definitions Synonyms 1-out-of-M join [5]. Pattern 10 Arbitrary Cycles The ability to represent cycles in a process model that have more than one entry or exit point. [5] Synonyms Unstructured loop, iteration, cycle [5]. Pattern 11 - Implicit Termination A given process (or sub-process) instance should terminate when there are no remaining work items that are able to be done either now or at any time in the future. [5] Pattern 12 - Multiple Instances without Synchronization Within a given process instance, multiple instances of an activity can be created. These instances are independent of each other and run concurrently. There is no requirement to synchronize them upon completion. [5] Synonyms Multi threading without synchronization, spawn off facility [5]. Pattern 13 - Multiple Instances with a priori Design-Time Knowledge Within a given process instance, multiple instances of an activity can be created. The required number of instances is known at design time. These instances are independent of each other and run concurrently. It is necessary to synchronize the activity instances at completion before any subsequent activities can be triggered. [5] Pattern 14 - Multiple Instances with a priori Run-Time Knowledge Within a given process instance, multiple instances of an activity can be created. The required number of instances may depend on a number of runtime factors, including state data, resource availability and interprocess communications, but is known before the activity instances must be created. Once initiated, these instances are independent of each 80

Appendix B: Control-flow patterns definitions other and run concurrently. It is necessary to synchronize the instances at completion before any subsequent activities can be triggered. [5] Pattern 15 - Multiple instances without a priori run-time knowledge Within a given process instance, multiple instances of an activity can be created. The required number of instances may depend on a number of runtime factors, including state data, resource availability and interprocess communications and is not known until the final instance has completed. Once initiated, these instances are independent of each other and run concurrently. At any time, whilst instances are running, it is possible for additional instances to be initiated. It is necessary to synchronize the instances at completion before any subsequent activities can be triggered. [5] Pattern 16 - Deferred Choice A point in a workflow process where one of several branches is chosen based on interaction with the operating environment. Prior to the decision, all branches present possible future courses of execution. The decision is made by initiating the first activity in one of the branches i.e. there is no explicit choice but rather a race between different branches. After the decision is made, execution alternatives in branches other than the one selected are withdrawn. [5] Synonyms External choice, implicit choice, deferred XOR-split [5]. Pattern 17 - Interleaved Parallel Routing A set of activities has a partial ordering defining the requirements with respect to the order in which they must be executed. Each activity in the set must be executed once and they can be completed in any order that accords with the partial order. However, as an additional requirement, no two activities can be executed at the same time (i.e. no two activities can be active for the same process instance at the same time). [5] Pattern 18 Milestone An activity is only enabled when the process instance (of which it is part) is in a specific state (typically in a parallel branch). The state is assumed to be a specific execution point (also known as a milestone) in the process model. When this execution point is reached the nominated 81

Appendix B: Control-flow patterns definitions activity can be enabled. If the process instance has progressed beyond this state, then the activity cannot be enabled now or at any future time (i.e. the deadline has expired). Note that the execution does not influence the state itself, i.e. unlike normal control-flow dependencies it is a test rather than a trigger. [5] Synonyms Test arc, deadline, state condition, withdraw message [5]. Pattern 19 - Cancel Activity An enabled activity is withdrawn prior to it commencing execution. If the activity has started, it is disabled and, where possible, the currently running instance is halted and removed. [5] Synonyms Withdraw activity. Pattern 20 - Cancel Case A complete process instance is removed. This includes currently executing activities, those which may execute at some future time and all subprocesses. The process instance is recorded as having completed unsuccessfully. [5] Synonyms Withdraw case. Pattern 21 - Structured Loop The ability to execute an activity or sub-process repeatedly. The loop has either a pre-test or post-test condition associated with it that is either evaluated at the beginning or end of the loop to determine whether it should continue. The looping structure has a single entry and exit point. [5] Pattern 22 - Recursion The ability of an activity to invoke itself during its execution or an ancestor in terms of the overall decomposition structure with which it is associated. [5] 82

Appendix B: Control-flow patterns definitions Pattern 23 - Transient Trigger The ability for an activity to be triggered by a signal from another part of the process or from the external environment. These triggers are transient in nature and are lost if not acted on immediately by the receiving activity. [5] Pattern 24 - Persistent Trigger The ability for an activity to be triggered by a signal from another part of the process or from the external environment. These triggers are persistent in form and are retained by the workflow until they can be acted on by the receiving activity. [5] Pattern 25 - Cancel Region The ability to disable a set of activities in a process instance. If any of the activities are already executing, then they are withdrawn. The activities need not be a connected subset of the overall process model. [5] Pattern 26 - Cancel Multiple Instance Activity Within a given process instance, multiple instances of an activity can be created. The required number of instances is known at design time. These instances are independent of each other and run concurrently. At any time, the multiple instance activity can be cancelled and any instances which have not completed are withdrawn. This does not affect activity instances that have already completed. [5] Pattern 27 - Complete Multiple Instance Activity Within a given process instance, multiple instances of an activity can be created. The required number of instances is known at design time. These instances are independent of each other and run concurrently. It is necessary to synchronize the instances at completion before any subsequent activities can be triggered. During the course of execution, it is possible that the activity needs to be forcibly completed such that any remaining instances are withdrawn and the thread of control is passed to subsequent activities. [5] Pattern 28 - Blocking Discriminator The convergence of two or more branches into a single subsequent branch following one or more corresponding divergences earlier in the process model. The thread of control is passed to the subsequent branch 83

Appendix B: Control-flow patterns definitions when the first active incoming branch has been enabled. The discriminator construct resets when all active incoming branches have been enabled once for the same process instance. Subsequent enablements of incoming branches are blocked until the discriminator has reset. [5] Pattern 29 - Cancelling Discriminator The convergence of two or more branches into a single subsequent branch following one or more corresponding divergences earlier in the process model. The thread of control is passed to the subsequent branch when the first active incoming branch has been enabled. Triggering the discriminator also cancels the execution of all of the other incoming branches and resets the construct. [5] Pattern 30 - Structured Partial Join The convergence of M branches into a single subsequent branch following a corresponding divergence earlier in the process model. The thread of control is passed to the subsequent branch when N of the incoming branches have been enabled. Subsequent enablements of incoming branches do not result in the thread of control being passed on. The join construct resets when all active incoming branches have been enabled. [5] Pattern 31 - Blocking Partial Join The convergence of two or more branches into a single subsequent branch following one or more corresponding divergences earlier in the process model. The thread of control is passed to the subsequent branch when N of the incoming branches have been enabled. The join construct resets when all active incoming branches have been enabled once for the same process instance. Subsequent enablements of incoming branches are blocked until the join has reset. [5] Pattern 32 - Cancelling Partial Join The convergence of two or more branches into a single subsequent branch following one or more corresponding divergences earlier in the process model. The thread of control is passed to the subsequent branch when N of the incoming branches have been enabled. Triggering the join also cancels the execution of all of the other incoming branches and resets the construct. [5] 84

Appendix B: Control-flow patterns definitions Pattern 33 - Generalized AND-Join The convergence of two or more branches into a single subsequent branch such that the thread of control is passed to the subsequent branch when all input branches have been enabled. Additional triggers received on one or more branches between firings of the join persist and are retained for future firings. [5] Pattern 34 - Static Partial Join for Multiple Instances Within a given process instance, multiple concurrent instances of an activity can be created. The required number of instances is known when the first activity instance commences. Once N of the activity instances have completed, the next activity in the process is triggered. Subsequent completions of the remaining M-N instances are inconsequential. [5] Pattern 35 - Cancelling Partial Join for Multiple Instances Within a given process instance, multiple concurrent instances of an activity can be created. The required number of instances is known when the first activity instance commences. Once N of the activity instances have completed, the next activity in the process is triggered and the remaining M-N instances are cancelled. [5] Pattern 36 - Dynamic Partial Join for Multiple Instances Within a given process instance, multiple concurrent instances of an activity can be created. The required number of instances may depend on a number of runtime factors, including state data, resource availability and inter-process communications and is not known until the final instance has completed. At any time, whilst instances are running, it is possible for additional instances to be initiated providing the ability to do so has not been disabled. A completion condition is specified which is evaluated each time an instance of the activity completes. Once the completion condition evaluates to true, the next activity in the process is triggered. Subsequent completions of the remaining activity instances are inconsequential and no new instances can be created. [5] Pattern 37 - Acyclic Synchronizing Merge The convergence of two or more branches which diverged earlier in the process into a single subsequent branch. The thread of control is passed to the subsequent branch when each active incoming branch has been 85

Appendix B: Control-flow patterns definitions enabled. Determination of how many branches require synchronization is made on the basis of information locally available to the merge construct. This may be communicated directly to the merge by the preceding diverging construct or alternatively it can be determined on the basis of local data such as the threads of control arriving at the merge. [5] Pattern 38 - General Synchronizing Merge The convergence of two or more branches which diverged earlier in the process into a single subsequent branch. The thread of control is passed to the subsequent branch when each active incoming branch has been enabled or it is not possible that the branch will be enabled at any future time. [5] Pattern 39 - Critical Section Two or more connected subgraphs of a process model are identified as critical sections. At runtime for a given process instance, only activities in one of these critical sections can be active at any given time. Once execution of the activities in one critical section commences, it must complete before another critical section can commence. Pattern 40 - Interleaved Routing Each member of a set of activities must be executed once. They can be executed in any order but no two activities can be executed at the same time (i.e. no two activities can be active for the same process instance at the same time). Once all of the activities have completed, the next activity in the process can be initiated. [5] Pattern 41 - Thread Merge At a given point in a process, a nominated number of execution threads in a single branch of the same process instance should be merged together into a single thread of execution. [5] Pattern 42 - Thread Split At a given point in a process, a nominated number of execution threads can be initiated in a single branch of the same process instance. [5] Pattern 43 - Explicit Termination A given process (or sub-process) instance should terminate when it reaches a nominated state. Typically this is denoted by a specific end 86

Appendix B: Control-flow patterns definitions node. When this end node is reached, any remaining work in the process instance is cancelled and the overall process instance is recorded as having completed successfully. [5] 87

Appendix C: New Features Appendix C: New Features Adding multiple company support 1. Changed class org.activiti.explorer.ui.login.explorerloginform 1. Added field companycaption [String] 2. Added in constructor companycaption = i18nmanager.getmessage(messages.login_company); 3. Changed getloginhtml to include input field for company. 2. Changed class org.activiti.explorer.messages 1. Added under //login static final String LOGIN_COMPANY = "login.company"; 3. Changed class messages.properties 1. Added under #login, login.company = Company 4. Changed class org.activiti.explorer.identity.loggedinuser 1. Added method String getcompany(); 5. Changed class org.activiti.explorer.identity.loggedinuserimpl 1. Added field protected String company; 2. Changed constructor to include company public LoggedInUserImpl(String company, User user, String password) 3. Added method String getcompany(); 6. Added class org.activiti.cloud.cloudprocessengines (see added classes section) 7. Changed class org.activiti.explorer.ui.login.loginhandler 1. Added parameter to method authenticate, LoggedInUser authenticate(string company, String username, String password); 8. Changed class org.activiti.explorer.ui.login.defaultloginhandler 1. Deleted field private IdentityService identityservice and setter; 2. Added parameter to method authenticate, public LoggedInUserImpl authenticate(string company, String username, String password) 3. Added company check and retrieving the identityservice for the given company using ProcessEngines for authentication. 9. Changed class org.activiti.explorer.ui.login.loginpage 1. Deleted field identityservice 2. Added in method ActivitiLoginListener.onLogin code for retrieving the company name 88

Appendix C: New Features 3. Added company parameter to call to login handler, loginhandler.authenticate(company, username, password); 4. Added settheme to company name in method ActivitiLoginListener.onLogin 10. Changed class org.activiti.explorer.ui.profile.changepasswordpopupwindow 1. Deleted field identityservice 2. Added in method handlepasswordchange IdentityService identityservice = CloudProcessEngines.getIdentityService(); 3. Change authenticate in method handlepasswordchange to include company. 11. Changed class org.activiti.explorer.defaultviewmanager 1. Deleted field taskservice 2. Deleted field historyservice 3. Deleted field identityservice 4. Added in method showtaskpage, TaskService taskservice = CloudProcessEngines.getTaskService(); 5. Added in method showtaskpage, HistoryService historyservice = CloudProcessEngines.getHistoryService(); 6. Added in method getgroupids, IdentityService identityservice = CloudProcessEngines.getIdentityService(); 12. Changed class org.activiti.explorer.navigation.tasknavigator 1. Deleted field taskservice 2. Deleted field historyservice 3. Deleted field identityservice 4. Added in method directtospecifictaskpage 1. TaskService taskservice = CloudProcessEngines.getTaskService(); 2. HistoryService historyservice = CloudProcessEngines.getHistoryService(); 3. IdentityService identityservice = CloudProcessEngines.getIdentityService(); 5. Added in getgroupids IdentityService identityservice = CloudProcessEngines.getIdentityService(); 13. Changed class org.activiti.explorer.ui.alfresco.processinstancetablelazyquery 1. Deleted field runtimeservice 2. Added in method constructquery RuntimeService runtimeservice = CloudProcessEngines.getRuntimeService(); 89

Appendix C: New Features 14. Changed class org.activiti.explorer.ui.content.createattachmentpopupwindow 1. Deleted field taskservice 15. Changed class org.activiti.explorer.ui.content.file.imageattachmentrenderer 1. Change in getdetailcomponent TaskService taskservice = ProcessEngines.getDefaultProcessEngine().getTaskService(); TaskService taskservice = CloudProcessEngines.getTaskService(); taskservice = ProcessEngines.getDefaultProcessEngine().getTaskService(); taskservice = CloudProcessEngines.getTaskService(); 16. Changed class org.activiti.explorer.ui.content.url.urlattachmenteditorcomponent 1. Deleted in constructor taskservice = ProcessEngines.getDefaultProcessEngine().getTaskService(); 17. Changed class org.activiti.explorer.ui.custom.tasklistheader 1. Deleted field taskservice 2. Added in method initkeyboardlistener TaskService taskservice = CloudProcessEngines.getTaskService(); 18. Changed class org.activiti.explorer.ui.custom.userprofilelink 1. Deleted field identityservice 19. Changed class org.activiti.explorer.ui.form.formpropertiesform 1. Deleted field formservice 20. Changed class org.activiti.explorer.ui.management.db.databasedetailpanel 1. Deleted field managementservice 2. Added in method addtabledata, ManagementService managementservice = CloudProcessEngines.getManagementService(); 21. Changed class org.activiti.explorer.ui.management.db.databasepage 1. Deleted field managementservice 2. Added in method populatetablelist, ManagementService managementservice = CloudProcessEngines.getManagementService(); 22. Changed class org.activiti.explorer.ui.management.db.tabledataquery 1. Deleted field managementservice 23. Changed class org.activiti.explorer.ui.management.deployment.deletedeploymentpopup Window 1. Deleted field repositoryservice 90

Appendix C: New Features 2. Deleted field runtimeservice 3. Added in method adddeletewarning 1. RuntimeService runtimeservice = CloudProcessEngines.getRuntimeService(); 2. RepositoryService repositoryservice = CloudProcessEngines.getRepositoryService(); 4. Added in method addbuttons, RepositoryService repositoryservice = CloudProcessEngines.getRepositoryService(); 24. Changed class org.activiti.explorer.ui.management.deployment.deploymentdetailpanel 1. Deleted field repositoryservice 2. Added in methods constructor, addprocessdefinitionlinks, addresourcelinks 1. RepositoryService repositoryservice = CloudProcessEngines.getRepositoryService(); 25. Changed class org.activiti.explorer.ui.management.deployment.deploymentlistquery 1. Deleted field repositoryservice 2. Added in methods loaditems, loadsingleresult, size 1. RepositoryService repositoryservice = CloudProcessEngines.getRepositoryService(); 26. Changed class org.activiti.explorer.ui.management.deployment.deploymentuploadreceive r 1. Deleted field repositoryservice 2. Added in method deployuploadedfile, RepositoryService repositoryservice = CloudProcessEngines.getRepositoryService(); 27. Changed class org.activiti.explorer.ui.management.identity.groupdetailpanel 1. Deleted field identityservice 2. Added in methods constructor, initsavebutton, initdeletebutton, initaddmembersbutton 1. IdentityService identityservice = CloudProcessEngines.getIdentityService(); 28. Changed class org.activiti.explorer.ui.management.identity.grouplistquery 1. Deleted field identityservice 2. Added in methods size, loaditems, loadsingleresult 1. IdentityService identityservice = 91

Appendix C: New Features CloudProcessEngines.getIdentityService(); 29. Changed class org.activiti.explorer.ui.management.identity.groupmembersquery 1. Deleted field identityservice 2. Added in methods size, loaditems, GroupMemberItem 1. IdentityService identityservice = CloudProcessEngines.getIdentityService(); 30. Changed class org.activiti.explorer.ui.management.identity.newgrouppopupwindow 1. Deleted field identityservice 2. Added in methods initinputfields, creategroup 1. IdentityService identityservice = CloudProcessEngines.getIdentityService(); 31. Changed class org.activiti.explorer.ui.management.identity.newuserpopupwindow 1. Deleted field identityservice 2. Added in methods initinputfields, createuser 1. IdentityService identityservice = CloudProcessEngines.getIdentityService(); 32. Changed class org.activiti.explorer.ui.management.identity.userdetailpanel 1. Deleted field identityservice 2. Added in methods constructor, loadpicture, initsavebutton, initdeletebutton, initaddgroupsbutton, initgroupstable 1. IdentityService identityservice = CloudProcessEngines.getIdentityService(); 33. Changed class org.activiti.explorer.ui.management.identity.userlistquery 1. Deleted field identityservice 2. Added in methods size, loaditems, loadsingleresult 1. IdentityService identityservice = CloudProcessEngines.getIdentityService(); 34. Changed class org.activiti.explorer.ui.management.job.jobdetailpanel 1. Deleted field managementservice 2. Added in methods constructor, addactions, addjobstate 1. ManagementService managementservice = CloudProcessEngines.getManagementService(); 35. Changed class org.activiti.explorer.ui.management.job.joblistquery 92

Appendix C: New Features 1. Deleted field repositoryservice [ManagementService] 2. Added in methods size, loaditems, loadsingleresult 1. ManagementService managementservice = CloudProcessEngines.getManagementService(); 36. Changed class org.activiti.explorer.ui.management.process.deleteprocessinstanceclicklist ener 1. Changed in method buttonclick RuntimeService runtimeservice = ProcessEngines.getDefaultProcessEngine().getRuntimeService(); RuntimeService runtimeservice = CloudProcessEngines.getRuntimeService(); 37. Changed class org.activiti.explorer.ui.management.process.processinstancedetailpanel 1. Deleted fields runtimeservice, repositoryservice, taskservice, historyservice, identityservice 2. Added in method addprocessimage 1. RepositoryService repositoryservice = CloudProcessEngines.getRepositoryService(); 2. RuntimeService runtimeservice = CloudProcessEngines.getRuntimeService(); 3. Added in method addtasks, HistoryService historyservice = CloudProcessEngines.getHistoryService(); 4. Added in method gettaskassigneecomponent, IdentityService identityservice = CloudProcessEngines.getIdentityService(); 5. Added in method addvariables, RuntimeService runtimeservice = CloudProcessEngines.getRuntimeService(); 6. Added in method getprocessinstance, RuntimeService runtimeservice = CloudProcessEngines.getRuntimeService(); 7. Added in method gethistoricprocessinstance, HistoryService historyservice = CloudProcessEngines.getHistoryService(); 8. Added in method getprocessdefinition, RepositoryService repositoryservice = CloudProcessEngines.getRepositoryService(); 38. Changed class org.activiti.explorer.ui.management.process.processinstancelistquery 1. Deleted fields runtimeservice, repositoryservice 2. Added in method constructquery, RuntimeService runtimeservice = CloudProcessEngines.getRuntimeService(); 93

Appendix C: New Features 3. Added in method getprocessdefinitionname, RepositoryService repositoryservice = CloudProcessEngines.getRepositoryService(); 39. Changed class org.activiti.explorer.ui.process.myprocessinstancespage 1. Deleted fields historyservice, repositoryservice 2. Added in method createlazyloadingquery 1. RepositoryService repositoryservice = CloudProcessEngines.getRepositoryService(); 2. HistoryService historyservice = CloudProcessEngines.getHistoryService(); 40. Changed class org.activiti.explorer.ui.process.processdefinitiondetailpanel 1. Deleted fields formservice, repositoryservice 2. Added in constructor RepositoryService repositoryservice = CloudProcessEngines.getRepositoryService(); 3. Added in method showprocessstartform FormService formservice = CloudProcessEngines.getFormService(); 41. Changed class org.activiti.explorer.ui.process.processdefinitioninfocomponent 1. Deleted field repositoryservice 2. Added in initimage RepositoryService repositoryservice = CloudProcessEngines.getRepositoryService(); 42. Changed class org.activiti.explorer.ui.process.processdefinitionpage 1. Deleted field repositoryservice 2. Added in method createlist, RepositoryService repositoryservice = CloudProcessEngines.getRepositoryService(); 43. Changed class org.activiti.explorer.ui.process.listener.startprocessinstanceclicklistener 1. Deleted fields runtimeservice, taskservice, formservice 2. Added in method buttonclick 1. FormService formservice = CloudProcessEngines.getFormService(); 2. RuntimeService runtimeservice = CloudProcessEngines.getRuntimeService(); 3. TaskService taskservice = CloudProcessEngines.getTaskService(); 44. Changed class org.activiti.explorer.ui.profile.profilepanel 1. Deleted field identityservice 2. Added in methods loadprofiledata, initchangepicturebutton, initsaveprofilebutton 94

Appendix C: New Features 1. IdentityService identityservice = CloudProcessEngines.getIdentityService(); 45. Changed class org.activiti.explorer.ui.task.archivedpage 1. Changed in method createdetailcomponent HistoryService historyservice = ProcessEngines.getDefaultProcessEngine().getHistoryService(); HistoryService historyservice = CloudProcessEngines.getHistoryService(); 46. Changed class org.activiti.explorer.ui.task.historictaskdetailpanel 1. Deleted fields historyservice, taskservice 2. Added in methods initparenttasklink, initsubtasks 1. HistoryService historyservice = CloudProcessEngines.getHistoryService(); 3. Added in method initrelatedcontent, TaskService taskservice = CloudProcessEngines.getTaskService(); 47. Changed class org.activiti.explorer.ui.task.newcasepopupwindow 1. Deleted field historyservice, taskservice 2. Added in method handleformsubmit, TaskService taskservice = CloudProcessEngines.getTaskService(); 48. Changed class org.activiti.explorer.ui.task.subtaskcomponent 1. Deleted fields taskservice, historyservice 2. Added in method initaddsubtaskpanelkeyboardactions, TaskService taskservice = CloudProcessEngines.getTaskService(); 3. Added in methods initsubtasks, refreshsubtasks 1. HistoryService historyservice = CloudProcessEngines.getHistoryService(); 49. Changed class org.activiti.explorer.ui.task.taskdetailpanel 1. Deleted fields taskservice, formservice, repositoryservice 2. Added in methods initheader, initclaimbutton, initdescription, initparenttasklink, inittaskform, canuserclaimtask 1. TaskService taskservice = CloudProcessEngines.getTaskService(); 3. Added in method initprocesslink, RepositoryService repositoryservice = CloudProcessEngines.getRepositoryService(); 4. Added in method inittaskform, final FormService formservice = CloudProcessEngines.getFormService(); 50. Changed class org.activiti.explorer.ui.task.taskeventspanel 95

Appendix C: New Features 1. Deleted fields identityservice, taskservice 2. Added in methods addtaskevents, addnewcomment 1. TaskService taskservice = CloudProcessEngines.getTaskService(); 3. Added in method addtaskeventpicture, IdentityService identityservice = CloudProcessEngines.getIdentityService(); 51. Changed class org.activiti.explorer.ui.task.taskinvolvedpeoplecomponent 1. Deleted field taskservice 2. Added in methods initaddpeoplebutton, initinvolvedpeople, refreshpeoplegrid, refreshassignee, refreshowner 1. TaskService taskservice = CloudProcessEngines.getTaskService(); 52. Changed class org.activiti.explorer.ui.task.taskmenubar 1. Deleted field identityservice 2. Added in method inititems, IdentityService identityservice = CloudProcessEngines.getIdentityService(); 53. Changed class org.activiti.explorer.ui.task.taskpage 1. Deleted field taskservice 2. Added in method createdetailcomponent, TaskService taskservice = CloudProcessEngines.getTaskService(); 54. Changed class org.activiti.explorer.ui.task.taskrelatedcontentcomponent 1. Deleted field taskservice 2. Added in methods refreshtaskattachments, confirmed 1. TaskService taskservice = CloudProcessEngines.getTaskService(); 55. Changed class org.activiti.explorer.ui.task.userdetailscomponent 1. Deleted field identityservice 2. Added in methods constructor, adduserpicture 1. IdentityService identityservice = CloudProcessEngines.getIdentityService(); 56. Changed class org.activiti.explorer.ui.task.data.abstracttasklistquery 1. Deleted field taskservice 57. Changed class org.activiti.explorer.ui.task.data.archivedlistquery 1. Deleted field historyservice 2. Added in method createquery, HistoryService historyservice = CloudProcessEngines.getHistoryService(); 58. Changed class org.activiti.explorer.ui.task.data.inboxlistquery 1. Added in method getquery, TaskService taskservice = 96

Appendix C: New Features CloudProcessEngines.getTaskService(); 59. Changed class org.activiti.explorer.ui.task.data.involvedlistquery 1. Added in method getquery, TaskService taskservice = CloudProcessEngines.getTaskService(); 60. Changed class org.activiti.explorer.ui.task.data.queuedlistquery 1. Deleted field taskservice 2. Added in method getquery, TaskService taskservice = CloudProcessEngines.getTaskService(); 61. Changed class org.activiti.explorer.ui.task.data.taskslistquery 1. Added in method getquery, TaskService taskservice = CloudProcessEngines.getTaskService(); 62. Changed class org.activiti.explorer.ui.task.listener.changeownershiplistener 1. Change in method buttonclick 1. ProcessEngines.getDefaultProcessEngine().getTaskService().setOwner( task.getid(), selecteduser); 2. CloudProcessEngines.getTaskService().setOwner(task.getId(), selecteduser); 63. Changed class org.activiti.explorer.ui.task.listener.deletesubtaskclicklistener 1. Change in method click final TaskService taskservice = ProcessEngines.getDefaultProcessEngine().getTaskService(); final TaskService taskservice = CloudProcessEngines.getTaskService(); 64. Changed class org.activiti.explorer.ui.task.listener.reassignassigneelistener 1. Change in method buttonclick ProcessEngines.getDefaultProcessEngine().getTaskService().setAssign ee(task.getid(), selecteduser); CloudProcessEngines.getTaskService().setAssignee(task.getId(), selecteduser); 65. Changed class org.activiti.explorer.ui.task.listener.removeinvolvedpersonlistener 1. Deleted fields taskservice, identityservice 2. Added in method buttonclick 1. IdentityService identityservice = CloudProcessEngines.getIdentityService(); 2. TaskService taskservice = CloudProcessEngines.getTaskService(); 97

Appendix C: New Features 66. Changed class org.activiti.explorer.form.userformtype 1. Change in method convertformvaluetomodelvalue long count = ProcessEngines.getDefaultProcessEngine().getIdentityService().create UserQuery().userId(propertyValue).count(); long count = CloudProcessEngines.getIdentityService().createUserQuery().userId(p ropertyvalue).count(); 67. Changed class org.activiti.explorer.ui.content.genericattachmentrenderer 1. Change in method getdetailcomponent 1. TaskService taskservice = ProcessEngines.getDefaultProcessEngine().getTaskService(); 2. TaskService taskservice = CloudProcessEngines.getTaskService(); 68. Changed class org.activiti.explorer.ui.content.email.emaildetailpanel 1. Deleted field taskservice 2. Added in constructor TaskService taskservice = CloudProcessEngines.getTaskService(); 69. Changed class org.activiti.explorer.ui.content.file.fileattachmenteditorcomponent 1. Deleted field taskservice 2. Added in method getattachment, TaskService taskservice = CloudProcessEngines.getTaskService(); 70. Changed package org.activiti.explorer.cache 1. Delete all clasdes except for UserCache 2. Add class NoUserCache (see added classes section) 71. Changed package org.activiti.explorer.demo 1. Delete all classes (DemoDataGenerator). 72. Changed xml file applicationcontext.xml 1. Delete bean repositoryservice 2. Delete bean runtimeservice 3. Delete bean taskservice 4. Delete bean historyservice 5. Delete bean managementservice 6. Delete bean identityservice 7. Delete bean demodatagenerator 98

Appendix C: New Features 8. Delete bean datasource 9. Delete bean transactionmanager 10. Delete in activitiloginhandler <property name="identityservice" ref="identityservice" /> 11. Change bean processengine <bean id="processengine" class="org.activiti.spring.processenginefactorybean" destroymethod="destroy"> <bean id="processengine" class="org.activiti.cloud.cloudprocessengines" destroymethod="destroy"> 12. Change bean processengineconfiguration to <bean id="processengineconfiguration" class="org.activiti.spring.springprocessengineconfiguration"> <property name="jdbcdriver" value="${jdbc.driver" /> <property name="jdbcurl" value="${jdbc.url" /> <property name="jdbcusername" value="${jdbc.username" /> <property name="jdbcpassword" value="${jdbc.password" /> <property name="databaseschemaupdate" value="true" /> <property name="jobexecutoractivate" value="true" /> <property name="customformtypes"> <list> <ref bean="userformtype" /> <ref bean="textareafromtype" /> </list> </property> </bean> 73. Changed xml file activiti-ui-context.xml 1. Change bean usercache <bean name="usercache" class="org.activiti.explorer.cache.nousercache" /> Textarea component 1. Added class org.activiti.explorer.form.textareaformtype (see added classes section) 2. Added class org.activiti.explorer.ui.form.textareaformpropertyrenderer (see added classes section) 3. Changed xml applicationcontext.xml Added bean <bean id="textareafromtype" class="org.activiti.explorer.form.textareaformtype"/> Added in bean processengineconfiguration under customformtypes <ref bean="textareafromtype" /> 4. Changed xml activiti-ui-context.xml 99

Appendix C: New Features Added in bean formpropertyrenderermanager under propertyrenderers <bean class="org.activiti.explorer.ui.form.textareaformpropertyrenderer" /> Custom task forms 1. Added class org.activiti.explorer.ui.form.formtemplateparser (see added classes section) 2. Changed class org.activiti.explorer.ui.form.formpropertiescomponent 1. Added field processinstanceid [String] 2. Added field formkey [String] 3. Deleted field form [Form] 4. Changed type of field propertycomponents to protected Map<FormProperty, Field>; 5. Changed Constructor to public FormPropertiesComponent(String processinstanceid, String formkey) 6. Deleted method initform 7. Deleted method setformenabled 8. Changed method setformproperties to public void setformproperties(list<formproperty> formproperties) { this.formproperties = formproperties; removeallcomponents(); if (propertycomponents == null) { propertycomponents = new LinkedHashMap<FormProperty, Field>(); else { propertycomponents.clear(); for (FormProperty formproperty : this.formproperties) { FormPropertyRenderer renderer = getrenderer(formproperty); propertycomponents.put(formproperty, renderer.getpropertyfield(formproperty)); FormTemplateParser formparser = new FormTemplateParser(processInstanceId, formkey); VerticalLayout mainformlayout = formparser.getformlayout(propertycomponents); if (mainformlayout!= null) { addcomponent(mainformlayout); 100

Appendix C: New Features 9. Changed method getformpropertyvalues to public Map<String, String> getformpropertyvalues() throws InvalidValueException { for (FormProperty formproperty : propertycomponents.keyset()) { Field field = propertycomponents.get(formproperty); field.validate(); Map<String, String> formpropertyvalues = new HashMap<String, String>(); for (FormProperty formproperty : propertycomponents.keyset()) { if (formproperty.iswritable()) { Field field = propertycomponents.get(formproperty); FormPropertyRenderer renderer = getrenderer(formproperty); String fieldvalue = renderer.getfieldvalue(formproperty, field); formpropertyvalues.put(formproperty.getid(), fieldvalue); return formpropertyvalues; 3. Changed class org.activiti.explorer.ui.form.formpropertiesform 1. Added field processinstanceid [String] 2. Added field formkey [String] 3. Changed Constructor to public FormPropertiesForm(String processinstanceid, String formkey) (set fields) 4. Changed method initformpropertiescomponent formpropertiescomponent = new FormPropertiesComponent(); formpropertiescomponent = new FormPropertiesComponent(processInstanceId, formkey); 5. Added in method initlisteners (to catch block) 1. submitformbutton.setcomponenterror(new UserError(ive.getMessage())); 4. Changed class org.activiti.explorer.ui.process.processdefinitiondetailpanel 1. Changed method showprocessstartform processdefinitionstartform = new FormPropertiesForm(); processdefinitionstartform = new FormPropertiesForm(null, 101

Appendix C: New Features startformdata.getformkey()); 5. Changed class org.activiti.explorer.ui.task.taskdetailpanel 1. Changed method inittaskform taskform = new FormPropertiesForm(); taskform = new FormPropertiesForm(task.getProcessInstanceId(), formdata.getformkey()); 6. Added in css styles.css table.divider { padding:0px; margin:0px; width:100%; td.startline { padding:1px; margin:0px; width:16px; td.caption { padding:1px; margin:0px; text-align:left; white-space:nowrap; width:1px; color:#3c3c3c; font:bold 12px Arial, Helvetica, sans-serif; td.endline { padding:1px; margin:0px; width:auto; Activiti custom form dtd <?xml version="1.0" encoding="utf-8"?> <!ELEMENT form (block row column field divider a img br)*> <!ELEMENT block (row column field divider a img br)*> <!ELEMENT row (field a img space)*> <!ELEMENT column (field divider a img br)*> <!ELEMENT field EMPTY> <!ELEMENT divider (#PCDATA)> <!ELEMENT a (#PCDATA img)*> <!ELEMENT img EMPTY> 102

Appendix C: New Features <!ELEMENT br EMPTY> <!ELEMENT space EMPTY> <!ATTLIST block type (divider panel) #REQUIRED caption CDATA #IMPLIED style CDATA #IMPLIED> <!ATTLIST field id CDATA #REQUIRED description CDATA #IMPLIED> <!ATTLIST row expand (true false) #IMPLIED> <!ATTLIST a href CDATA #IMPLIED var CDATA #IMPLIED> <!ATTLIST img src CDATA #REQUIRED alt CDATA #IMPLIED height CDATA #IMPLIED width CDATA #IMPLIED> Added Classes org.activiti.cloud.cloudprocessengines package org.activiti.cloud; import java.sql.connection; import java.sql.drivermanager; import java.sql.resultset; import java.sql.statement; import java.util.arraylist; import java.util.list; import org.activiti.cloud.admin.company; import org.activiti.engine.formservice; import org.activiti.engine.historyservice; import org.activiti.engine.identityservice; import org.activiti.engine.managementservice; import org.activiti.engine.processengine; import org.activiti.engine.processengineconfiguration; import org.activiti.engine.processengines; import org.activiti.engine.repositoryservice; import org.activiti.engine.runtimeservice; import org.activiti.engine.taskservice; import org.activiti.explorer.explorerapp; import org.activiti.spring.springprocessengineconfiguration; import org.apache.commons.dbcp.basicdatasource; import org.springframework.jdbc.datasource.datasourcetransactionmanager; /** * @author Handles all connections to Activiti Process Engines. * One Engine is started and registered per company. */ public class CloudProcessEngines { 103

Appendix C: New Features private static SpringProcessEngineConfiguration processengineconfiguration; public CloudProcessEngines() { public synchronized static void startprocessengine(processengine processengine) { ProcessEngines.registerProcessEngine(processEngine); public synchronized static boolean startprocessengine(string company) { Connection connect = null; Statement statement = null; ResultSet resultset = null; String driverclassname = processengineconfiguration.getjdbcdriver(); String url = processengineconfiguration.getjdbcurl(); String username = processengineconfiguration.getjdbcusername(); String password = processengineconfiguration.getjdbcpassword(); try { Class.forName(driverClassName); connect = DriverManager.getConnection(url + "user=" + username + "&password=" + password); statement = connect.createstatement(); statement.executeupdate("use activiti_cloud"); resultset = statement.executequery("select * FROM `Company` WHERE `CompanyName` = '" + company + "'"); if (resultset.next()) { BasicDataSource datasource = new BasicDataSource(); datasource.setdriverclassname(resultset.getstring("driverclassname")); datasource.seturl(resultset.getstring("url")); datasource.setusername(resultset.getstring("username")); datasource.setpassword(resultset.getstring("password")); datasource.setdefaultautocommit(false); DataSourceTransactionManager transactionmanager = new DataSourceTransactionManager(); transactionmanager.setdatasource(datasource); SpringProcessEngineConfiguration springprocessengineconfiguration = new SpringProcessEngineConfiguration(); springprocessengineconfiguration.setprocessenginename(resultset.getstring("companyname")); 104

Appendix C: New Features springprocessengineconfiguration.setdatasource(datasource); springprocessengineconfiguration.settransactionmanager(transactionmanager); springprocessengineconfiguration.setdatabaseschemaupdate("true"); springprocessengineconfiguration.setjobexecutoractivate(true); springprocessengineconfiguration.setcustomformtypes(processengineconfiguration.getcustomformtypes()); springprocessengineconfiguration.sethistory(processengineconfiguration.history_full); springprocessengineconfiguration.setmailserverhost(resultset.getstring("mailserverhost")); springprocessengineconfiguration.setmailserverusername(resultset.getstring("mailserverusername")); springprocessengineconfiguration.setmailserverpassword(resultset.getstring("mailserverpassword")); springprocessengineconfiguration.setmailserverport(resultset.getint("mailserverport")); springprocessengineconfiguration.setmailserverdefaultfrom(resultset.getstring("mailserverdefaultfrom")); springprocessengineconfiguration.setmailserverusetls(resultset.getboolean("mailserverusetls")); startprocessengine(springprocessengineconfiguration.buildprocessengine()); return true; catch (Exception e) { e.printstacktrace(); return false; public synchronized static void stopprocessengine(string company) { ProcessEngines.unregister(org.activiti.engine.ProcessEngines.getProcessEngine(company)); public static synchronized ProcessEngine getprocessengine() { String company = ExplorerApp.get().getLoggedInUser().getCompany(); return org.activiti.engine.processengines.getprocessengine(company); public static synchronized RepositoryService getrepositoryservice() { return getprocessengine().getrepositoryservice(); public static synchronized RuntimeService getruntimeservice() { return getprocessengine().getruntimeservice(); 105

Appendix C: New Features public static synchronized TaskService gettaskservice() { return getprocessengine().gettaskservice(); public static synchronized HistoryService gethistoryservice() { return getprocessengine().gethistoryservice(); public static synchronized ManagementService getmanagementservice() { return getprocessengine().getmanagementservice(); public static synchronized IdentityService getidentityservice() { return getprocessengine().getidentityservice(); public static synchronized FormService getformservice() { return getprocessengine().getformservice(); public static SpringProcessEngineConfiguration getprocessengineconfiguration() { return processengineconfiguration; public void setprocessengineconfiguration( SpringProcessEngineConfiguration processengineconfiguration) { CloudProcessEngines.processEngineConfiguration = processengineconfiguration; Connection connect = null; Statement statement = null; ResultSet resultset = null; String driverclassname = processengineconfiguration.getjdbcdriver(); String url = processengineconfiguration.getjdbcurl(); String username = processengineconfiguration.getjdbcusername(); String password = processengineconfiguration.getjdbcpassword(); try { Class.forName(driverClassName); connect = DriverManager.getConnection(url + "user=" + username + "&password=" + password); statement = connect.createstatement(); statement.executeupdate("use activiti_cloud"); resultset = statement.executequery("select * FROM Company"); 106

Appendix C: New Features while (resultset.next()) { BasicDataSource datasource = new BasicDataSource(); datasource.setdriverclassname(resultset.getstring("driverclassname")); datasource.seturl(resultset.getstring("url")); datasource.setusername(resultset.getstring("username")); datasource.setpassword(resultset.getstring("password")); datasource.setdefaultautocommit(false); DataSourceTransactionManager transactionmanager = new DataSourceTransactionManager(); transactionmanager.setdatasource(datasource); SpringProcessEngineConfiguration springprocessengineconfiguration = new SpringProcessEngineConfiguration(); springprocessengineconfiguration.setprocessenginename(resultset.getstring("companyname")); springprocessengineconfiguration.setdatasource(datasource); springprocessengineconfiguration.settransactionmanager(transactionmanager); springprocessengineconfiguration.setdatabaseschemaupdate("true"); springprocessengineconfiguration.setjobexecutoractivate(true); springprocessengineconfiguration.setcustomformtypes(processengineconfiguration.getcustomformtypes()); springprocessengineconfiguration.sethistory(processengineconfiguration.history_full); springprocessengineconfiguration.setmailserverhost(resultset.getstring("mailserverhost")); springprocessengineconfiguration.setmailserverusername(resultset.getstring("mailserverusername")); springprocessengineconfiguration.setmailserverpassword(resultset.getstring("mailserverpassword")); springprocessengineconfiguration.setmailserverport(resultset.getint("mailserverport")); springprocessengineconfiguration.setmailserverdefaultfrom(resultset.getstring("mailserverdefaultfrom")); springprocessengineconfiguration.setmailserverusetls(resultset.getboolean("mailserverusetls")); startprocessengine(springprocessengineconfiguration.buildprocessengine()); catch (Exception e) { e.printstacktrace(); public synchronized static List<Company> getcompanies() { List<Company> returlist = new ArrayList<Company>(); 107

Appendix C: New Features Connection connect = null; Statement statement = null; ResultSet resultset = null; String driverclassname = processengineconfiguration.getjdbcdriver(); String url = processengineconfiguration.getjdbcurl(); String username = processengineconfiguration.getjdbcusername(); String password = processengineconfiguration.getjdbcpassword(); try { Class.forName(driverClassName); connect = DriverManager.getConnection(url + "user=" + username + "&password=" + password); statement = connect.createstatement(); statement.executeupdate("use activiti_cloud"); resultset = statement.executequery("select * FROM Company"); while (resultset.next()) { String companyname = resultset.getstring("companyname"); boolean active = (org.activiti.engine.processengines.getprocessengine(companyname)!= null); returlist.add(new Company(companyName, active)); catch (Exception e) { e.printstacktrace(); return returlist; public void destroy() { ProcessEngines.destroy(); org.activiti.explorer.cache.nousercache package org.activiti.explorer.cache; import java.util.arraylist; import java.util.list; import org.activiti.cloud.cloudprocessengines; import org.activiti.engine.identityservice; import org.activiti.engine.identity.user; 108

Appendix C: New Features /** * * @author Simple UserCache implementation that reads the users * from database instead of caching them */ public class NoUserCache implements UserCache { public List<User> findmatchingusers(string prefix) { List<User> usersreturn = new ArrayList<User>(); IdentityService identityservice = CloudProcessEngines.getIdentityService(); List<User> users = identityservice.createuserquery().list(); for (User user : users) { if (user.getid().tolowercase().startswith(prefix.tolowercase()) prefix.equals("")) { usersreturn.add(user); return usersreturn; public User finduser(string userid) { IdentityService identityservice = CloudProcessEngines.getIdentityService(); return identityservice.createuserquery().userid(userid).singleresult(); public void notifyuserdatachanged(string userid) { org.activiti.explorer.form.textareaformtype package org.activiti.explorer.form; import org.activiti.engine.impl.form.abstractformtype; /** * Form type for a textarea component. * @author */ public class TextAreaFormType extends AbstractFormType { public static final String TYPE_NAME = "textarea"; public TextAreaFormType() { public String getname() { return TYPE_NAME; 109

Appendix C: New Features public String getmimetype() { return "text/plain"; public Object convertformvaluetomodelvalue(string propertyvalue) { return propertyvalue; public String convertmodelvaluetoformvalue(object modelvalue) { return (String) modelvalue; org.activiti.explorer.ui.form.textareaformpropertyrenderer package org.activiti.explorer.ui.form; import org.activiti.engine.form.formproperty; import org.activiti.explorer.messages; import org.activiti.explorer.form.textareaformtype; import com.vaadin.ui.field; import com.vaadin.ui.textarea; /** * @author */ public class TextAreaFormPropertyRenderer extends AbstractFormPropertyRenderer { public TextAreaFormPropertyRenderer() { super(textareaformtype.class); @Override public Field getpropertyfield(formproperty formproperty) { TextArea textarea = new TextArea(getPropertyLabel(formProperty)); textarea.setrequired(formproperty.isrequired()); textarea.setenabled(formproperty.iswritable()); textarea.setrequirederror(getmessage(messages.form_field_required, getpropertylabel(formproperty))); if (formproperty.getvalue()!= null) { textarea.setvalue(formproperty.getvalue()); return textarea; 110

Appendix C: New Features org.activiti.explorer.ui.form.formtemplateparser package org.activiti.explorer.ui.form; import java.io.ioexception; import java.io.inputstream; import java.util.arraylist; import java.util.list; import java.util.map; import javax.xml.parsers.documentbuilder; import javax.xml.parsers.documentbuilderfactory; import org.activiti.cloud.cloudprocessengines; import org.activiti.engine.form.formproperty; import org.activiti.engine.repository.processdefinition; import org.activiti.engine.runtime.processinstance; import org.w3c.dom.document; import org.w3c.dom.namednodemap; import org.w3c.dom.node; import org.w3c.dom.nodelist; import com.vaadin.ui.abstractorderedlayout; import com.vaadin.ui.alignment; import com.vaadin.ui.component; import com.vaadin.ui.field; import com.vaadin.ui.formlayout; import com.vaadin.ui.horizontallayout; import com.vaadin.ui.label; import com.vaadin.ui.panel; import com.vaadin.ui.verticallayout; /** * * @author * Creates a VerticalLayout with components from the process descriptor (Map). * The order and placement of the components are read from the form file * (specified in the formkey field of the task). * In the case that the form file does not exits all components are arranged * in a column. */ public class FormTemplateParser { private String formkey; private Document formxml = null; private List<FormProperty> formproperties; private String processinstanceid = null; 111

Appendix C: New Features /** * @param formkey is the name of the file that holds the xml form template. */ public FormTemplateParser(String processinstanceid, String formkey) { this.processinstanceid = processinstanceid; this.formkey = formkey; parsexml(); /** * Parses the form xml and creates a Document. */ private void parsexml() { if (formkey!= null &&!formkey.equals("")) { InputStream is = null; try { // For Activiti Explorer replace CloudProcessEngines with // ProcessEngines.getDefaultProcessEngine() ProcessInstance processinstance = CloudProcessEngines.getRuntimeService().createProcessInstanceQuery().processInstanceId(processInstanceId).singleResult(); ProcessDefinition processdefinition = CloudProcessEngines.getRepositoryService().createProcessDefinitionQuery().processDefinitionId(processInstance.getProcessDefinitionId()).singleResult(); is = CloudProcessEngines.getRepositoryService().getResourceAsStream( processdefinition.getdeploymentid(), formkey); catch (Exception e) { // form key not found in deployment (bar, zip) try { // turn of dtd validation DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); dbf.setvalidating(false); dbf.setfeature("http://xml.org/sax/features/namespaces", false); dbf.setfeature("http://xml.org/sax/features/validation", false); dbf.setfeature( "http://apache.org/xml/features/nonvalidating/load-dtd-grammar", false); dbf.setfeature( "http://apache.org/xml/features/nonvalidating/load-external-dtd", false); DocumentBuilder db = dbf.newdocumentbuilder(); formxml = db.parse(is); catch (Exception e) { formxml = null; finally { 112

Appendix C: New Features try { is.close(); catch (IOException e) { /** * * @param propertycomponents Map file containing all id's and fields. * @return a VerticalLayout containing all the components */ public VerticalLayout getformlayout( Map<FormProperty, Field> propertycomponents) { this.formproperties = new ArrayList<FormProperty>( propertycomponents.keyset()); VerticalLayout mainlayout = new VerticalLayout(); mainlayout.setmargin(true, false, true, false); if (formxml!= null) { NodeList forms = formxml.getelementsbytagname("form"); for (int j = 0; j < forms.getlength(); j++) { Node form = forms.item(j); NodeList blocks = form.getchildnodes(); for (int i = 0; i < blocks.getlength(); i++) { Node block = blocks.item(i); if (block.getnodename().equals("block")) { Component componentblock = getblock(block, propertycomponents); if (componentblock!= null) { mainlayout.addcomponent(componentblock); else if (block.getnodename().equals("row")) { Component componentrow = getrow(block, propertycomponents); if (componentrow!= null) { mainlayout.addcomponent(componentrow); else if (block.getnodename().equals("field")) { Component fieldcomponent = getfield(block, propertycomponents); if (fieldcomponent!= null) { mainlayout.addcomponent(fieldcomponent); else if (block.getnodename().equals("column")) { Component columncomponent = getcolumn(block, propertycomponents); if (columncomponent!= null) { mainlayout.addcomponent(columncomponent); else if (block.getnodename().equals("divider")) { mainlayout.addcomponent(getdividerlabel(block.gettextcontent())); 113

Appendix C: New Features else if (block.getnodename().equals("a")) { mainlayout.addcomponent(htmllink(block)); else if (block.getnodename().equals("br")) { mainlayout.addcomponent(getbr()); else if (block.getnodename().equals("img")) { mainlayout.addcomponent(new Label(imageLink(block), Label.CONTENT_XHTML)); AbstractOrderedLayout othercomponents = getothercomponents( propertycomponents, mainlayout.getcomponentcount() == 0); if (othercomponents.getcomponentcount() > 0) { mainlayout.addcomponent(othercomponents); return mainlayout; AbstractOrderedLayout othercomponents = getothercomponents( propertycomponents, true); if (othercomponents.getcomponentcount() > 0) { mainlayout.addcomponent(othercomponents); return mainlayout; return null; /** * * @param propertycomponents Map file containing all id's and fields. * @param useformlayout if true from layout is used instead of vertical layout * @return vertical or form layout with unused components */ private AbstractOrderedLayout getothercomponents( Map<FormProperty, Field> propertycomponents, boolean useformlayout) { AbstractOrderedLayout componentslayout = null; if (useformlayout) { componentslayout = new FormLayout(); componentslayout.setsizefull(); for (FormProperty formproperty : this.formproperties) { Field field = propertycomponents.get(formproperty); field.setwidth("100%"); componentslayout.addcomponent(field); else { componentslayout = new VerticalLayout(); 114

Appendix C: New Features componentslayout.setwidth("100%"); for (FormProperty formproperty : this.formproperties) { Field field = propertycomponents.get(formproperty); field.setwidth("100%"); componentslayout.addcomponent(field); return componentslayout; /** * * @param block xml node describing the block * @param propertycomponents Map file containing all id's and fields. * @return a vertical layout with a block of field, rows or columns. */ private Component getblock(node block, Map<FormProperty, Field> propertycomponents) { int dividercounter = 0; VerticalLayout layout = new VerticalLayout(); NamedNodeMap blockattributes = block.getattributes(); if (blockattributes.getnameditem("type").getnodevalue().equals("divider")) { Node caption = blockattributes.getnameditem("caption"); if (caption!= null) { layout.addcomponent(getdividerlabel(caption.getnodevalue())); else { layout.addcomponent(getdividerlabel("")); dividercounter++; NodeList rows = block.getchildnodes(); for (int i = 0; i < rows.getlength(); i++) { Node row = rows.item(i); if (row.getnodename().equals("row")) { Component componentrow = getrow(row, propertycomponents); if (componentrow!= null) { layout.addcomponent(componentrow); else if (row.getnodename().equals("field")) { Component fieldcomponent = getfield(row, propertycomponents); if (fieldcomponent!= null) { layout.addcomponent(fieldcomponent); else if (row.getnodename().equals("column")) { Component columncomponent = getcolumn(row, propertycomponents); if (columncomponent!= null) { layout.addcomponent(columncomponent); 115

Appendix C: New Features else if (row.getnodename().equals("divider")) { Label divider = getdividerlabel(row.gettextcontent()); VerticalLayout vl = new VerticalLayout(); vl.addcomponent(divider); vl.setmargin(true, true, false, true); layout.addcomponent(vl); dividercounter++; else if (row.getnodename().equals("a")) { Component link = htmllink(row); VerticalLayout vl = new VerticalLayout(); vl.addcomponent(link); vl.setmargin(true, true, false, true); layout.addcomponent(vl); dividercounter++; else if (row.getnodename().equals("br")) { layout.addcomponent(getbr()); dividercounter++; else if (row.getnodename().equals("img")) { layout.addcomponent(new Label(imageLink(row), Label.CONTENT_XHTML)); dividercounter++; if (layout.getcomponentcount() > dividercounter) { if (blockattributes.getnameditem("type").getnodevalue().equals("panel")) { VerticalLayout vl = new VerticalLayout(); Panel panel = new Panel(); layout.setmargin(true, false, true, false); panel.setcontent(layout); Node caption = blockattributes.getnameditem("caption"); if (caption!= null) { panel.setcaption(caption.getnodevalue()); Node style = blockattributes.getnameditem("style"); if (style!= null) { panel.addstylename(style.getnodevalue()); vl.addcomponent(panel); return vl; return layout; return null; /** * * @param row xml node describing the row 116

Appendix C: New Features * @param propertycomponents Map file containing all id's and fields. * @return Column of fields in a horizontal layout */ private HorizontalLayout getcolumn(node row, Map<FormProperty, Field> propertycomponents) { int dividercounter = 0; FormLayout formlayout = new FormLayout(); NodeList fields = row.getchildnodes(); for (int i = 0; i < fields.getlength(); i++) { Node field = fields.item(i); if (field.getnodename().equals("field")) { HorizontalLayout fieldcomponent = getfield(field, propertycomponents); if (fieldcomponent!= null) { formlayout.addcomponent(fieldcomponent.getcomponent(0)); else if (field.getnodename().equals("a")) { formlayout.addcomponent(htmllink(field)); else if (field.getnodename().equals("divider")) { formlayout.addcomponent(getdividerlabel(field.gettextcontent())); dividercounter++; else if (field.getnodename().equals("divider")) { formlayout.addcomponent(getbr()); dividercounter++; else if (field.getnodename().equals("img")) { formlayout.addcomponent(new Label(imageLink(field), Label.CONTENT_XHTML)); dividercounter++; if (formlayout.getcomponentcount() > dividercounter) { HorizontalLayout outerlayout = new HorizontalLayout(); outerlayout.setwidth("100%"); outerlayout.setmargin(false, true, false, true); outerlayout.addcomponent(formlayout); return outerlayout; return null; /** * * @param row xml node describing the row * @param propertycomponents * Map file containing all id's and fields. * @return VAADIN horizontal layout with a row of fields */ private HorizontalLayout getrow(node row, Map<FormProperty, Field> propertycomponents) { 117

Appendix C: New Features int spaces = 0; HorizontalLayout rowlayout = new HorizontalLayout(); NamedNodeMap rowattributes = row.getattributes(); Node expand = rowattributes.getnameditem("expand"); if (expand == null expand.getnodevalue().equals("true")) { rowlayout.setsizefull(); NodeList fields = row.getchildnodes(); for (int i = 0; i < fields.getlength(); i++) { Node field = fields.item(i); if (field.getnodename().equals("field")) { Component fieldcomponent = getfield(field, propertycomponents); if (fieldcomponent!= null) { rowlayout.addcomponent(fieldcomponent); rowlayout.setcomponentalignment(fieldcomponent, Alignment.BOTTOM_LEFT); else if (field.getnodename().equals("a")) { Component link = htmllink(field); rowlayout.addcomponent(link); rowlayout.setcomponentalignment(link, Alignment.BOTTOM_LEFT); else if (field.getnodename().equals("space")) { rowlayout.addcomponent(getspace()); spaces++; else if (field.getnodename().equals("img")) { rowlayout.addcomponent(new Label(imageLink(field), Label.CONTENT_XHTML)); if (rowlayout.getcomponentcount() > spaces) { return rowlayout; return null; /** * * @param field xml node describing the field * @param propertycomponents * Map file containing all id's and fields. * @return VAADIN field inside a horizontal layout */ private HorizontalLayout getfield(node field, Map<FormProperty, Field> propertycomponents) { NamedNodeMap fieldattributes = field.getattributes(); String id = fieldattributes.getnameditem("id").getnodevalue(); Node description = fieldattributes.getnameditem("description"); Field componentfield = getfieldcomponent(propertycomponents, id); 118

Appendix C: New Features if (componentfield!= null) { HorizontalLayout componentlayout = new HorizontalLayout(); componentlayout.setsizefull(); componentlayout.setmargin(false, true, false, true); if (description!= null &&!description.getnodevalue().equals("")) { componentfield.setdescription(description.getnodevalue()); componentfield.setwidth("100%"); componentlayout.addcomponent(componentfield); return componentlayout; return null; /** * * @param caption label in the divider line * @return VAADIN Label with the divider */ private Label getdividerlabel(string caption) { if (caption!= null &&!caption.equals("")) { StringBuffer sb = new StringBuffer(); sb.append("<table class=\"divider\">"); sb.append("<tr>"); sb.append("<td class=\"startline\"><hr /></td>"); sb.append("<td class=\"caption\">" + caption + "</td>"); sb.append("<td class=\"endline\"><hr /></td>"); sb.append("</tr>"); sb.append("</table>"); return new Label(sb.toString(), Label.CONTENT_XHTML); return new Label("<hr />", Label.CONTENT_XHTML); private Label getspace() { return new Label(" ", Label.CONTENT_XHTML); private Label getbr() { return new Label("<br />", Label.CONTENT_XHTML); /** * * @param propertycomponents Map file containing all id's and fields. * @param name id of the field to be returned * @return VAADIN Field */ 119

Appendix C: New Features private Field getfieldcomponent(map<formproperty, Field> propertycomponents, String name) { for (FormProperty formproperty : propertycomponents.keyset()) { if (formproperty.getid().equals(name)) { formproperties.remove(formproperty); return propertycomponents.get(formproperty); return null; /** * * @param a xml node describing the link * @return VAADIN component describing a html link */ private Component htmllink(node a) { VerticalLayout vl = new VerticalLayout(); NodeList images = a.getchildnodes(); NamedNodeMap linkattributes = a.getattributes(); Node staticlink = linkattributes.getnameditem("href"); Node varlink = linkattributes.getnameditem("var"); String link = null; if (staticlink!= null) { link = staticlink.getnodevalue(); else if (processinstanceid!= null && varlink!= null) { String linkvar = varlink.getnodevalue(); if (linkvar!= null) { Object varvalue = CloudProcessEngines.getRuntimeService().getVariable( processinstanceid, varlink.getnodevalue()); if (varvalue!= null) { link = varvalue.tostring(); String tagcontent = a.gettextcontent(); for (int i = 0; i < images.getlength(); i++) { Node image = images.item(i); if (image.getnodename().endswith("img")) { tagcontent = imagelink(image); break; vl.addcomponent(new Label("<a href=\"" + link + "\" target=\"_blank\">" + tagcontent + "</a>", Label.CONTENT_XHTML)); return vl; 120

Appendix C: New Features /** * * @param img xml node describing a html image tag * @return html image tag */ private String imagelink(node img) { NamedNodeMap imageattributes = img.getattributes(); String src = imageattributes.getnameditem("src").getnodevalue(); Node alt = imageattributes.getnameditem("alt"); Node height = imageattributes.getnameditem("height"); Node width = imageattributes.getnameditem("width"); StringBuffer contentbuffer = new StringBuffer("<img src=\"" + src + "\" border=0 "); if (alt!= null) { contentbuffer.append("alt=\"" + alt.getnodevalue() + "\" "); if (height!= null) { contentbuffer.append("height=\"" + height.getnodevalue() + "\" "); if (width!= null) { contentbuffer.append("width=\"" + width.getnodevalue() + "\" "); contentbuffer.append(" />"); return contentbuffer.tostring(); 121

Appendix D: Improvements and bug fixes Appendix D: Improvements and bug fixes Date Field component improvement 74. Changed class org.activiti.explorer.ui.form.dateformpropertyrenderer 1. Added to method getpropertyfield datefield.setresolution(getresolution(datepattern)); 2. Added method getresolution private int getresolution(string datepattern) { if(datepattern.contains("s")) { return PopupDateField.RESOLUTION_MSEC; else if(datepattern.contains("s")) { return PopupDateField.RESOLUTION_SEC; else if(datepattern.contains("m")) { return PopupDateField.RESOLUTION_MIN; else if(datepattern.contains("h")) { return PopupDateField.RESOLUTION_HOUR; else if(datepattern.contains("d")) { return PopupDateField.RESOLUTION_DAY; else if(datepattern.contains("m")) { return PopupDateField.RESOLUTION_MONTH; else if(datepattern.contains("y")) { return PopupDateField.RESOLUTION_YEAR; return PopupDateField.RESOLUTION_MIN; Enum component improvement Changed class org.activiti.explorer.ui.form.enumformpropertyrenderer Added in method getpropertyfield if(formproperty.isrequired()) { combobox.setnullselectionallowed(false); Change Panel order on user task page Changed class org.activiti.explorer.ui.task.taskdetailpanel Changed execution order in method init to initheader(); initdescriptionandclaimbutton(); initprocesslink(); 122

Appendix D: Improvements and bug fixes inittaskform(); initrelatedcontent(); initparenttasklink(); initpeopledetails(); initsubtasks(); Auto Update GUI on task complete 3. Changed class org.activiti.explorer.ui.form.formpropertiesform 1. Added in method initlisteners ExplorerApp.get().getViewManager().showInboxPage(); Large Screen support Changed css styles.css Deleted line in body segment max-width:1920px; Increase Visibility of disabled fields Changed css styles.css Adding section.v-app.v-textfield.v-disabled,.v-app.v-caption.v-disabled,.v-app.v-textarea.v-disabled,.v-app.v-checkbox.v-disabled { color:black; opacity:0.5; Boolean Component bug Changed class org.activiti.explorer.ui.form.booleanformpropertyrenderer Changed method getpropertyfield 5. checkbox.setvalue(formproperty.getvalue()); 6. checkbox.setvalue(boolean.valueof(formproperty.getvalue())); 123

Appendix E: XML implementation of the supported patterns Appendix E: XML implementation of the supported patterns Pattern 1 Sequence <?xml version="1.0" encoding="utf-8"?> <definitions xmlns="http://www.omg.org/spec/bpmn/20100524/model" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/bpmn/20100524/di" xmlns:omgdc="http://www.omg.org/spec/dd/20100524/dc" xmlns:omgdi="http://www.omg.org/spec/dd/20100524/di" typelanguage="http://www.w3.org/2001/xmlschema" expressionlanguage="http://www.w3.org/1999/xpath" targetnamespace="http://www.activiti.org/patterns"> <process id="pattern1sequence" name="pattern 1 Sequence"> <documentation>implementation of Pattern 1 Sequence</documentation> <startevent id="startevent1" name="start" activiti:initiator="initiator"></startevent> <usertask id="usertask1" name="start Task" activiti:assignee="${initiator"></usertask> <usertask id="usertask2" name="middle Task" activiti:assignee="${initiator"></usertask> <usertask id="usertask3" name="end Task" activiti:assignee="${initiator"></usertask> <endevent id="endevent1" name="end"></endevent> <sequenceflow id="flow1" name="" sourceref="startevent1" targetref="usertask1"></sequenceflow> <sequenceflow id="flow2" name="" sourceref="usertask1" targetref="usertask2"></sequenceflow> <sequenceflow id="flow3" name="" sourceref="usertask2" targetref="usertask3"></sequenceflow> <sequenceflow id="flow4" name="" sourceref="usertask3" targetref="endevent1"></sequenceflow> </process> <bpmndi:bpmndiagram id="bpmndiagram_pattern1sequence"> <bpmndi:bpmnplane bpmnelement="pattern1sequence" id="bpmnplane_pattern1sequence"> <bpmndi:bpmnshape bpmnelement="startevent1" id="bpmnshape_startevent1"> <omgdc:bounds height="35" width="35" x="60" y="240"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="usertask1" id="bpmnshape_usertask1"> <omgdc:bounds height="55" width="105" x="150" y="230"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="usertask2" id="bpmnshape_usertask2"> <omgdc:bounds height="55" width="105" x="310" y="230"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="usertask3" id="bpmnshape_usertask3"> <omgdc:bounds height="55" width="105" x="470" y="230"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="endevent1" id="bpmnshape_endevent1"> 124

Appendix E: XML implementation of the supported patterns <omgdc:bounds height="35" width="35" x="620" y="240"></omgdc:bounds> <bpmndi:bpmnedge bpmnelement="flow1" id="bpmnedge_flow1"> <omgdi:waypoint x="95" y="257"></omgdi:waypoint> <omgdi:waypoint x="150" y="257"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow2" id="bpmnedge_flow2"> <omgdi:waypoint x="255" y="257"></omgdi:waypoint> <omgdi:waypoint x="310" y="257"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow3" id="bpmnedge_flow3"> <omgdi:waypoint x="415" y="257"></omgdi:waypoint> <omgdi:waypoint x="470" y="257"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow4" id="bpmnedge_flow4"> <omgdi:waypoint x="575" y="257"></omgdi:waypoint> <omgdi:waypoint x="620" y="257"></omgdi:waypoint> </bpmndi:bpmnplane> </bpmndi:bpmndiagram> </definitions> Pattern 2 Parallel split <?xml version="1.0" encoding="utf-8"?> <definitions xmlns="http://www.omg.org/spec/bpmn/20100524/model" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/bpmn/20100524/di" xmlns:omgdc="http://www.omg.org/spec/dd/20100524/dc" xmlns:omgdi="http://www.omg.org/spec/dd/20100524/di" typelanguage="http://www.w3.org/2001/xmlschema" expressionlanguage="http://www.w3.org/1999/xpath" targetnamespace="http://www.activiti.org/patterns"> <process id="pattern2parallelsplit" name="pattern 2 Parallel Split"> <documentation>implementation of Pattern 2 Parallel Split</documentation> <startevent id="startevent1" name="start" activiti:initiator="initiator"></startevent> <usertask id="usertask1" name="start Task" activiti:assignee="${initiator"></usertask> <sequenceflow id="flow1" name="" sourceref="startevent1" targetref="usertask1"></sequenceflow> <sequenceflow id="flow2" name="" sourceref="usertask1" targetref="parallelgateway1"></sequenceflow> <parallelgateway id="parallelgateway1" name="parallel Gateway"></parallelGateway> <usertask id="usertask2" name="branch 1 Task" activiti:assignee="${initiator"></usertask> <sequenceflow id="flow3" name="" sourceref="parallelgateway1" targetref="usertask2"></sequenceflow> <usertask id="usertask3" name="branch 2 Task" activiti:assignee="${initiator"></usertask> <sequenceflow id="flow4" name="" sourceref="parallelgateway1" targetref="usertask3"></sequenceflow> <endevent id="endevent3" name="end"></endevent> 125

Appendix E: XML implementation of the supported patterns <sequenceflow id="flow5" name="" sourceref="usertask2" targetref="endevent3"></sequenceflow> <endevent id="endevent4" name="end"></endevent> <sequenceflow id="flow6" name="" sourceref="usertask3" targetref="endevent4"></sequenceflow> </process> <bpmndi:bpmndiagram id="bpmndiagram_pattern2parallelsplit"> <bpmndi:bpmnplane bpmnelement="pattern2parallelsplit" id="bpmnplane_pattern2parallelsplit"> <bpmndi:bpmnshape bpmnelement="startevent1" id="bpmnshape_startevent1"> <omgdc:bounds height="35" width="35" x="73" y="180"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="usertask1" id="bpmnshape_usertask1"> <omgdc:bounds height="55" width="105" x="153" y="170"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="parallelgateway1" id="bpmnshape_parallelgateway1"> <omgdc:bounds height="40" width="40" x="313" y="177"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="usertask2" id="bpmnshape_usertask2"> <omgdc:bounds height="55" width="105" x="390" y="90"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="usertask3" id="bpmnshape_usertask3"> <omgdc:bounds height="55" width="105" x="390" y="250"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="endevent3" id="bpmnshape_endevent3"> <omgdc:bounds height="35" width="35" x="550" y="100"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="endevent4" id="bpmnshape_endevent4"> <omgdc:bounds height="35" width="35" x="550" y="260"></omgdc:bounds> <bpmndi:bpmnedge bpmnelement="flow1" id="bpmnedge_flow1"> <omgdi:waypoint x="108" y="197"></omgdi:waypoint> <omgdi:waypoint x="153" y="197"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow2" id="bpmnedge_flow2"> <omgdi:waypoint x="258" y="197"></omgdi:waypoint> <omgdi:waypoint x="313" y="197"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow3" id="bpmnedge_flow3"> <omgdi:waypoint x="333" y="177"></omgdi:waypoint> <omgdi:waypoint x="333" y="117"></omgdi:waypoint> <omgdi:waypoint x="390" y="117"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow4" id="bpmnedge_flow4"> <omgdi:waypoint x="333" y="217"></omgdi:waypoint> <omgdi:waypoint x="333" y="277"></omgdi:waypoint> <omgdi:waypoint x="390" y="277"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow5" id="bpmnedge_flow5"> 126

Appendix E: XML implementation of the supported patterns <omgdi:waypoint x="495" y="117"></omgdi:waypoint> <omgdi:waypoint x="550" y="117"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow6" id="bpmnedge_flow6"> <omgdi:waypoint x="495" y="277"></omgdi:waypoint> <omgdi:waypoint x="550" y="277"></omgdi:waypoint> </bpmndi:bpmnplane> </bpmndi:bpmndiagram> </definitions> Pattern 3 Synchronization <?xml version="1.0" encoding="utf-8"?> <definitions xmlns="http://www.omg.org/spec/bpmn/20100524/model" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/bpmn/20100524/di" xmlns:omgdc="http://www.omg.org/spec/dd/20100524/dc" xmlns:omgdi="http://www.omg.org/spec/dd/20100524/di" typelanguage="http://www.w3.org/2001/xmlschema" expressionlanguage="http://www.w3.org/1999/xpath" targetnamespace="http://www.activiti.org/patterns"> <process id="pattern3synchronization" name="pattern 3 Synchronization"> <documentation>implementation of Pattern 3 Synchronization</documentation> <startevent id="startevent1" name="start" activiti:initiator="initiator"></startevent> <parallelgateway id="parallelgateway1" name="parallel Gateway"></parallelGateway> <sequenceflow id="flow1" name="" sourceref="startevent1" targetref="parallelgateway1"></sequenceflow> <usertask id="usertask1" name="branch 1 Task" activiti:assignee="${initiator"></usertask> <sequenceflow id="flow2" name="" sourceref="parallelgateway1" targetref="usertask1"></sequenceflow> <usertask id="usertask2" name="branch 2 Task" activiti:assignee="${initiator"></usertask> <sequenceflow id="flow3" name="" sourceref="parallelgateway1" targetref="usertask2"></sequenceflow> <sequenceflow id="flow4" name="" sourceref="usertask1" targetref="parallelgateway2"></sequenceflow> <sequenceflow id="flow5" name="" sourceref="usertask2" targetref="parallelgateway2"></sequenceflow> <usertask id="usertask3" name="end Task" activiti:assignee="${initiator"></usertask> <sequenceflow id="flow6" name="" sourceref="parallelgateway2" targetref="usertask3"></sequenceflow> <endevent id="endevent1" name="end"></endevent> <sequenceflow id="flow7" name="" sourceref="usertask3" targetref="endevent1"></sequenceflow> <parallelgateway id="parallelgateway2" name="parallel Gateway"></parallelGateway> </process> <bpmndi:bpmndiagram id="bpmndiagram_pattern3synchronization"> <bpmndi:bpmnplane bpmnelement="pattern3synchronization" id="bpmnplane_pattern3synchronization"> <bpmndi:bpmnshape bpmnelement="startevent1" id="bpmnshape_startevent1"> 127

Appendix E: XML implementation of the supported patterns <omgdc:bounds height="35" width="35" x="45" y="160"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="parallelgateway1" id="bpmnshape_parallelgateway1"> <omgdc:bounds height="40" width="40" x="125" y="157"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="usertask1" id="bpmnshape_usertask1"> <omgdc:bounds height="55" width="105" x="215" y="60"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="usertask2" id="bpmnshape_usertask2"> <omgdc:bounds height="55" width="105" x="215" y="240"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="usertask3" id="bpmnshape_usertask3"> <omgdc:bounds height="55" width="105" x="460" y="150"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="endevent1" id="bpmnshape_endevent1"> <omgdc:bounds height="35" width="35" x="620" y="160"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="parallelgateway2" id="bpmnshape_parallelgateway2"> <omgdc:bounds height="40" width="40" x="375" y="157"></omgdc:bounds> <bpmndi:bpmnedge bpmnelement="flow1" id="bpmnedge_flow1"> <omgdi:waypoint x="80" y="177"></omgdi:waypoint> <omgdi:waypoint x="125" y="177"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow2" id="bpmnedge_flow2"> <omgdi:waypoint x="145" y="157"></omgdi:waypoint> <omgdi:waypoint x="145" y="87"></omgdi:waypoint> <omgdi:waypoint x="215" y="87"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow3" id="bpmnedge_flow3"> <omgdi:waypoint x="145" y="197"></omgdi:waypoint> <omgdi:waypoint x="145" y="267"></omgdi:waypoint> <omgdi:waypoint x="215" y="267"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow4" id="bpmnedge_flow4"> <omgdi:waypoint x="320" y="87"></omgdi:waypoint> <omgdi:waypoint x="395" y="87"></omgdi:waypoint> <omgdi:waypoint x="395" y="157"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow5" id="bpmnedge_flow5"> <omgdi:waypoint x="320" y="267"></omgdi:waypoint> <omgdi:waypoint x="395" y="267"></omgdi:waypoint> <omgdi:waypoint x="395" y="197"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow6" id="bpmnedge_flow6"> <omgdi:waypoint x="415" y="177"></omgdi:waypoint> <omgdi:waypoint x="460" y="177"></omgdi:waypoint> 128

Appendix E: XML implementation of the supported patterns <bpmndi:bpmnedge bpmnelement="flow7" id="bpmnedge_flow7"> <omgdi:waypoint x="565" y="177"></omgdi:waypoint> <omgdi:waypoint x="620" y="177"></omgdi:waypoint> </bpmndi:bpmnplane> </bpmndi:bpmndiagram> Pattern 4 - Exclusive Choice <?xml version="1.0" encoding="utf-8"?> <definitions xmlns="http://www.omg.org/spec/bpmn/20100524/model" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/bpmn/20100524/di" xmlns:omgdc="http://www.omg.org/spec/dd/20100524/dc" xmlns:omgdi="http://www.omg.org/spec/dd/20100524/di" typelanguage="http://www.w3.org/2001/xmlschema" expressionlanguage="http://www.w3.org/1999/xpath" targetnamespace="http://www.activiti.org/patterns"> <process id="pattern4exclusivechoice" name="pattern 4 Exclusive Choice"> <documentation>implementation of Pattern 4 Exclusive Choice</documentation> <startevent id="startevent1" name="start" activiti:initiator="initiator"></startevent> <usertask id="usertask1" name="start Task" activiti:assignee="${initiator"> <extensionelements> <activiti:formproperty id="choice" name="choice" type="enum" required="true" readable="true" writable="true"> <activiti:value id="1" name="choice 1"></activiti:value> <activiti:value id="2" name="choice 2"></activiti:value> </activiti:formproperty> </extensionelements> </usertask> <exclusivegateway id="exclusivegateway1" name="exclusive Gateway" /> <usertask id="usertask3" name="choice 1" activiti:assignee="${initiator"></usertask> <usertask id="usertask4" name="choice 2" activiti:assignee="${initiator"></usertask> <endevent id="endevent1" name="end"></endevent> <endevent id="endevent2" name="end"></endevent> <sequenceflow id="flow1" name="" sourceref="startevent1" targetref="usertask1"></sequenceflow> <sequenceflow id="flow2" name="" sourceref="usertask1" targetref="exclusivegateway1"></sequenceflow> <sequenceflow id="flow4" name="" sourceref="exclusivegateway1" targetref="usertask3"> <conditionexpression xsi:type="tformalexpression"><![cdata[${choice == 1]]></conditionExpression> </sequenceflow> <sequenceflow id="flow5" name="" sourceref="exclusivegateway1" targetref="usertask4"> <conditionexpression xsi:type="tformalexpression"><![cdata[${choice!= 1]]></conditionExpression> </sequenceflow> <sequenceflow id="flow6" name="" sourceref="usertask3" targetref="endevent1"></sequenceflow> <sequenceflow id="flow7" name="" sourceref="usertask4" targetref="endevent2"></sequenceflow> 129

Appendix E: XML implementation of the supported patterns </process> <bpmndi:bpmndiagram id="bpmndiagram_pattern4exclusivechoice"> <bpmndi:bpmnplane bpmnelement="pattern4exclusivechoice" id="bpmnplane_pattern4exclusivechoice"> <bpmndi:bpmnshape bpmnelement="startevent1" id="bpmnshape_startevent1"> <omgdc:bounds height="35" width="35" x="40" y="150"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="usertask1" id="bpmnshape_usertask1"> <omgdc:bounds height="55" width="105" x="120" y="140"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="exclusivegateway1" id="bpmnshape_exclusivegateway1"> <omgdc:bounds height="40" width="40" x="280" y="147"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="usertask3" id="bpmnshape_usertask3"> <omgdc:bounds height="55" width="105" x="360" y="40"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="usertask4" id="bpmnshape_usertask4"> <omgdc:bounds height="55" width="105" x="360" y="240"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="endevent1" id="bpmnshape_endevent1"> <omgdc:bounds height="35" width="35" x="500" y="50"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="endevent2" id="bpmnshape_endevent2"> <omgdc:bounds height="35" width="35" x="500" y="250"></omgdc:bounds> <bpmndi:bpmnedge bpmnelement="flow1" id="bpmnedge_flow1"> <omgdi:waypoint x="75" y="167"></omgdi:waypoint> <omgdi:waypoint x="120" y="167"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow2" id="bpmnedge_flow2"> <omgdi:waypoint x="225" y="167"></omgdi:waypoint> <omgdi:waypoint x="280" y="167"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow4" id="bpmnedge_flow4"> <omgdi:waypoint x="300" y="147"></omgdi:waypoint> <omgdi:waypoint x="300" y="67"></omgdi:waypoint> <omgdi:waypoint x="360" y="67"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow5" id="bpmnedge_flow5"> <omgdi:waypoint x="300" y="187"></omgdi:waypoint> <omgdi:waypoint x="300" y="267"></omgdi:waypoint> <omgdi:waypoint x="360" y="267"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow6" id="bpmnedge_flow6"> <omgdi:waypoint x="465" y="67"></omgdi:waypoint> <omgdi:waypoint x="500" y="67"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow7" id="bpmnedge_flow7"> <omgdi:waypoint x="465" y="267"></omgdi:waypoint> 130

Appendix E: XML implementation of the supported patterns <omgdi:waypoint x="500" y="267"></omgdi:waypoint> </bpmndi:bpmnplane> </bpmndi:bpmndiagram> </definitions> Pattern 5 - Simple Merge <?xml version="1.0" encoding="utf-8"?> <definitions xmlns="http://www.omg.org/spec/bpmn/20100524/model" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/bpmn/20100524/di" xmlns:omgdc="http://www.omg.org/spec/dd/20100524/dc" xmlns:omgdi="http://www.omg.org/spec/dd/20100524/di" typelanguage="http://www.w3.org/2001/xmlschema" expressionlanguage="http://www.w3.org/1999/xpath" targetnamespace="http://www.activiti.org/patterns"> <process id="pattern5simplemerge" name="pattern 5 Simple Merge"> <documentation>implementation of Pattern 5 Simple Merge</documentation> <startevent id="startevent1" name="start" activiti:initiator="initiator"></startevent> <usertask id="usertask1" name="start Task" activiti:assignee="${initiator"> <extensionelements> <activiti:formproperty id="choice" name="choice" type="enum" required="true" readable="true" writable="true"> <activiti:value id="1" name="choice 1"></activiti:value> <activiti:value id="2" name="choice 2"></activiti:value> <activiti:value id="3" name="choice 1 & 2"></activiti:value> </activiti:formproperty> </extensionelements> </usertask> <sequenceflow id="flow1" name="" sourceref="startevent1" targetref="usertask1"></sequenceflow> <sequenceflow id="flow2" name="" sourceref="usertask1" targetref="inclusivegateway1"></sequenceflow> <usertask id="usertask3" name="choice 1" activiti:assignee="${initiator"></usertask> <sequenceflow id="flow4" name="" sourceref="inclusivegateway1" targetref="usertask3"> <conditionexpression xsi:type="tformalexpression"><![cdata[${choice == 1 choice == 3]]></conditionExpression> </sequenceflow> <usertask id="usertask4" name="choice 2" activiti:assignee="${initiator"></usertask> <sequenceflow id="flow5" name="" sourceref="inclusivegateway1" targetref="usertask4"> <conditionexpression xsi:type="tformalexpression"><![cdata[${choice!= 1]]></conditionExpression> </sequenceflow> <exclusivegateway id="exclusivegateway2" name="exclusive Gateway"></exclusiveGateway> <sequenceflow id="flow6" name="" sourceref="usertask3" targetref="exclusivegateway2"></sequenceflow> <sequenceflow id="flow7" name="" sourceref="usertask4" targetref="exclusivegateway2"></sequenceflow> 131

Appendix E: XML implementation of the supported patterns <usertask id="usertask5" name="end Task" activiti:assignee="${initiator"></usertask> <sequenceflow id="flow8" name="" sourceref="exclusivegateway2" targetref="usertask5"></sequenceflow> <endevent id="endevent1" name="end"></endevent> <sequenceflow id="flow9" name="" sourceref="usertask5" targetref="endevent1"></sequenceflow> <inclusivegateway id="inclusivegateway1" name="inclusive Gateway"></inclusiveGateway> </process> <bpmndi:bpmndiagram id="bpmndiagram_pattern5simplemerge"> <bpmndi:bpmnplane bpmnelement="pattern5simplemerge" id="bpmnplane_pattern5simplemerge"> <bpmndi:bpmnshape bpmnelement="startevent1" id="bpmnshape_startevent1"> <omgdc:bounds height="35" width="35" x="50" y="159"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="usertask1" id="bpmnshape_usertask1"> <omgdc:bounds height="55" width="105" x="130" y="149"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="usertask3" id="bpmnshape_usertask3"> <omgdc:bounds height="55" width="105" x="380" y="49"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="usertask4" id="bpmnshape_usertask4"> <omgdc:bounds height="55" width="105" x="380" y="249"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="exclusivegateway2" id="bpmnshape_exclusivegateway2"> <omgdc:bounds height="40" width="40" x="523" y="156"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="usertask5" id="bpmnshape_usertask5"> <omgdc:bounds height="55" width="105" x="608" y="149"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="endevent1" id="bpmnshape_endevent1"> <omgdc:bounds height="35" width="35" x="768" y="159"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="inclusivegateway1" id="bpmnshape_inclusivegateway1"> <omgdc:bounds height="40" width="40" x="290" y="156"></omgdc:bounds> <bpmndi:bpmnedge bpmnelement="flow1" id="bpmnedge_flow1"> <omgdi:waypoint x="85" y="176"></omgdi:waypoint> <omgdi:waypoint x="130" y="176"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow2" id="bpmnedge_flow2"> <omgdi:waypoint x="235" y="176"></omgdi:waypoint> <omgdi:waypoint x="290" y="176"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow4" id="bpmnedge_flow4"> <omgdi:waypoint x="310" y="156"></omgdi:waypoint> <omgdi:waypoint x="310" y="76"></omgdi:waypoint> <omgdi:waypoint x="380" y="76"></omgdi:waypoint> 132

Appendix E: XML implementation of the supported patterns <bpmndi:bpmnedge bpmnelement="flow5" id="bpmnedge_flow5"> <omgdi:waypoint x="310" y="196"></omgdi:waypoint> <omgdi:waypoint x="310" y="276"></omgdi:waypoint> <omgdi:waypoint x="380" y="276"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow6" id="bpmnedge_flow6"> <omgdi:waypoint x="485" y="76"></omgdi:waypoint> <omgdi:waypoint x="543" y="76"></omgdi:waypoint> <omgdi:waypoint x="543" y="156"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow7" id="bpmnedge_flow7"> <omgdi:waypoint x="485" y="276"></omgdi:waypoint> <omgdi:waypoint x="543" y="276"></omgdi:waypoint> <omgdi:waypoint x="543" y="196"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow8" id="bpmnedge_flow8"> <omgdi:waypoint x="563" y="176"></omgdi:waypoint> <omgdi:waypoint x="608" y="176"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow9" id="bpmnedge_flow9"> <omgdi:waypoint x="713" y="176"></omgdi:waypoint> <omgdi:waypoint x="768" y="176"></omgdi:waypoint> </bpmndi:bpmnplane> </bpmndi:bpmndiagram> </definitions> Pattern 6 - Multi-Choice <?xml version="1.0" encoding="utf-8"?> <definitions xmlns="http://www.omg.org/spec/bpmn/20100524/model" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/bpmn/20100524/di" xmlns:omgdc="http://www.omg.org/spec/dd/20100524/dc" xmlns:omgdi="http://www.omg.org/spec/dd/20100524/di" typelanguage="http://www.w3.org/2001/xmlschema" expressionlanguage="http://www.w3.org/1999/xpath" targetnamespace="http://www.activiti.org/patterns"> <process id="pattern6multichoice" name="pattern 6 Multi Choice"> <documentation>implementation of Pattern 6 Multi Choice</documentation> <startevent id="startevent1" name="start" activiti:initiator="initiator"></startevent> <usertask id="usertask1" name="choice" activiti:assignee="${initiator"> <extensionelements> <activiti:formproperty id="choice" name="choice" type="enum" required="true" readable="true" writable="true"> <activiti:value id="1" name="task 1"></activiti:value> <activiti:value id="2" name="task 2"></activiti:value> <activiti:value id="3" name="task 1 and 2"></activiti:value> </activiti:formproperty> </extensionelements> </usertask> 133

Appendix E: XML implementation of the supported patterns <inclusivegateway id="inclusivegateway1" name="inclusive Gateway" /> <usertask id="usertask2" name="task 1" activiti:assignee="${initiator"></usertask> <usertask id="usertask3" name="task 2" activiti:assignee="${initiator"></usertask> <endevent id="endevent1" name="end"></endevent> <endevent id="endevent2" name="end"></endevent> <sequenceflow id="flow1" name="" sourceref="startevent1" targetref="usertask1"></sequenceflow> <sequenceflow id="flow2" name="" sourceref="usertask1" targetref="inclusivegateway1"></sequenceflow> <sequenceflow id="flow3" name="" sourceref="inclusivegateway1" targetref="usertask2"> <conditionexpression xsi:type="tformalexpression"><![cdata[${choice == 3 choice == 1]]></conditionExpression> </sequenceflow> <sequenceflow id="flow4" name="" sourceref="inclusivegateway1" targetref="usertask3"> <conditionexpression xsi:type="tformalexpression"><![cdata[${choice!= 1]]></conditionExpression> </sequenceflow> <sequenceflow id="flow5" name="" sourceref="usertask2" targetref="endevent1"></sequenceflow> <sequenceflow id="flow6" name="" sourceref="usertask3" targetref="endevent2"></sequenceflow> </process> <bpmndi:bpmndiagram id="bpmndiagram_pattern6multichoice"> <bpmndi:bpmnplane bpmnelement="pattern6multichoice" id="bpmnplane_pattern6multichoice"> <bpmndi:bpmnshape bpmnelement="startevent1" id="bpmnshape_startevent1"> <omgdc:bounds height="35" width="35" x="30" y="140"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="usertask1" id="bpmnshape_usertask1"> <omgdc:bounds height="55" width="105" x="110" y="130"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="inclusivegateway1" id="bpmnshape_inclusivegateway1"> <omgdc:bounds height="40" width="40" x="270" y="137"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="usertask2" id="bpmnshape_usertask2"> <omgdc:bounds height="55" width="105" x="350" y="30"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="usertask3" id="bpmnshape_usertask3"> <omgdc:bounds height="55" width="105" x="350" y="240"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="endevent1" id="bpmnshape_endevent1"> <omgdc:bounds height="35" width="35" x="510" y="40"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="endevent2" id="bpmnshape_endevent2"> <omgdc:bounds height="35" width="35" x="510" y="250"></omgdc:bounds> <bpmndi:bpmnedge bpmnelement="flow1" id="bpmnedge_flow1"> <omgdi:waypoint x="65" y="157"></omgdi:waypoint> 134

Appendix E: XML implementation of the supported patterns <omgdi:waypoint x="110" y="157"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow2" id="bpmnedge_flow2"> <omgdi:waypoint x="215" y="157"></omgdi:waypoint> <omgdi:waypoint x="270" y="157"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow3" id="bpmnedge_flow3"> <omgdi:waypoint x="290" y="137"></omgdi:waypoint> <omgdi:waypoint x="290" y="57"></omgdi:waypoint> <omgdi:waypoint x="350" y="57"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow4" id="bpmnedge_flow4"> <omgdi:waypoint x="290" y="177"></omgdi:waypoint> <omgdi:waypoint x="290" y="267"></omgdi:waypoint> <omgdi:waypoint x="350" y="267"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow5" id="bpmnedge_flow5"> <omgdi:waypoint x="455" y="57"></omgdi:waypoint> <omgdi:waypoint x="510" y="57"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow6" id="bpmnedge_flow6"> <omgdi:waypoint x="455" y="267"></omgdi:waypoint> <omgdi:waypoint x="510" y="267"></omgdi:waypoint> </bpmndi:bpmnplane> </bpmndi:bpmndiagram> </definitions> Pattern 7 - Structured Synchronizing Merge <?xml version="1.0" encoding="utf-8"?> <definitions xmlns="http://www.omg.org/spec/bpmn/20100524/model" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/bpmn/20100524/di" xmlns:omgdc="http://www.omg.org/spec/dd/20100524/dc" xmlns:omgdi="http://www.omg.org/spec/dd/20100524/di" typelanguage="http://www.w3.org/2001/xmlschema" expressionlanguage="http://www.w3.org/1999/xpath" targetnamespace="http://www.activiti.org/patterns"> <process id="pattern7structuredsynchronizingmerge" name="pattern 7 Structured Synchronizing Merge"> <documentation>implementation of Pattern 7 Structured Synchronizing Merge</documentation> <startevent id="startevent1" name="start" activiti:initiator="initiator"></startevent> <usertask id="usertask1" name="choice" activiti:assignee="${initiator"> <extensionelements> <activiti:formproperty id="choice" name="choice" type="enum" required="true" readable="true" writable="true"> <activiti:value id="1" name="task 1"></activiti:value> <activiti:value id="2" name="task 2"></activiti:value> <activiti:value id="3" name="task 1 & 2"></activiti:value> </activiti:formproperty> 135

Appendix E: XML implementation of the supported patterns </extensionelements> </usertask> <sequenceflow id="flow1" name="" sourceref="startevent1" targetref="usertask1"></sequenceflow> <inclusivegateway id="inclusivegateway1" name="inclusive Gateway"></inclusiveGateway> <sequenceflow id="flow2" name="" sourceref="usertask1" targetref="inclusivegateway1"></sequenceflow> <usertask id="usertask2" name="task 1" activiti:assignee="${initiator"></usertask> <sequenceflow id="flow3" name="" sourceref="inclusivegateway1" targetref="usertask2"> <conditionexpression xsi:type="tformalexpression"><![cdata[${choice == 1 choice == 3]]></conditionExpression> </sequenceflow> <usertask id="usertask3" name="task 2" activiti:assignee="${initiator"></usertask> <sequenceflow id="flow4" name="" sourceref="inclusivegateway1" targetref="usertask3"> <conditionexpression xsi:type="tformalexpression"><![cdata[${choice!= 1]]></conditionExpression> </sequenceflow> <sequenceflow id="flow5" name="" sourceref="usertask3" targetref="inclusivegateway2"></sequenceflow> <sequenceflow id="flow6" name="" sourceref="usertask2" targetref="inclusivegateway2"></sequenceflow> <usertask id="usertask4" name="end Task" activiti:assignee="${initiator"></usertask> <sequenceflow id="flow7" name="" sourceref="inclusivegateway2" targetref="usertask4"></sequenceflow> <endevent id="endevent1" name="end"></endevent> <sequenceflow id="flow8" name="" sourceref="usertask4" targetref="endevent1"></sequenceflow> <inclusivegateway id="inclusivegateway2" name="inclusive Gateway"></inclusiveGateway> </process> <bpmndi:bpmndiagram id="bpmndiagram_pattern7structuredsynchronizingmerge"> <bpmndi:bpmnplane bpmnelement="pattern7structuredsynchronizingmerge" id="bpmnplane_pattern7structuredsynchronizingmerge"> <bpmndi:bpmnshape bpmnelement="startevent1" id="bpmnshape_startevent1"> <omgdc:bounds height="35" width="35" x="60" y="150"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="usertask1" id="bpmnshape_usertask1"> <omgdc:bounds height="55" width="105" x="140" y="140"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="inclusivegateway1" id="bpmnshape_inclusivegateway1"> <omgdc:bounds height="40" width="40" x="300" y="147"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="usertask2" id="bpmnshape_usertask2"> <omgdc:bounds height="55" width="105" x="380" y="40"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="usertask3" id="bpmnshape_usertask3"> <omgdc:bounds height="55" width="105" x="380" y="250"></omgdc:bounds> 136

Appendix E: XML implementation of the supported patterns <bpmndi:bpmnshape bpmnelement="usertask4" id="bpmnshape_usertask4"> <omgdc:bounds height="55" width="105" x="605" y="140"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="endevent1" id="bpmnshape_endevent1"> <omgdc:bounds height="35" width="35" x="765" y="150"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="inclusivegateway2" id="bpmnshape_inclusivegateway2"> <omgdc:bounds height="40" width="40" x="520" y="147"></omgdc:bounds> <bpmndi:bpmnedge bpmnelement="flow1" id="bpmnedge_flow1"> <omgdi:waypoint x="95" y="167"></omgdi:waypoint> <omgdi:waypoint x="140" y="167"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow2" id="bpmnedge_flow2"> <omgdi:waypoint x="245" y="167"></omgdi:waypoint> <omgdi:waypoint x="300" y="167"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow3" id="bpmnedge_flow3"> <omgdi:waypoint x="320" y="147"></omgdi:waypoint> <omgdi:waypoint x="320" y="67"></omgdi:waypoint> <omgdi:waypoint x="380" y="67"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow4" id="bpmnedge_flow4"> <omgdi:waypoint x="320" y="187"></omgdi:waypoint> <omgdi:waypoint x="320" y="277"></omgdi:waypoint> <omgdi:waypoint x="380" y="277"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow5" id="bpmnedge_flow5"> <omgdi:waypoint x="485" y="277"></omgdi:waypoint> <omgdi:waypoint x="540" y="277"></omgdi:waypoint> <omgdi:waypoint x="540" y="187"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow6" id="bpmnedge_flow6"> <omgdi:waypoint x="485" y="67"></omgdi:waypoint> <omgdi:waypoint x="540" y="67"></omgdi:waypoint> <omgdi:waypoint x="540" y="147"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow7" id="bpmnedge_flow7"> <omgdi:waypoint x="560" y="167"></omgdi:waypoint> <omgdi:waypoint x="605" y="167"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow8" id="bpmnedge_flow8"> <omgdi:waypoint x="710" y="167"></omgdi:waypoint> <omgdi:waypoint x="765" y="167"></omgdi:waypoint> </bpmndi:bpmnplane> </bpmndi:bpmndiagram> </definitions> 137

Appendix E: XML implementation of the supported patterns Pattern 8 - Multi-Merge <?xml version="1.0" encoding="utf-8"?> <definitions xmlns="http://www.omg.org/spec/bpmn/20100524/model" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/bpmn/20100524/di" xmlns:omgdc="http://www.omg.org/spec/dd/20100524/dc" xmlns:omgdi="http://www.omg.org/spec/dd/20100524/di" typelanguage="http://www.w3.org/2001/xmlschema" expressionlanguage="http://www.w3.org/1999/xpath" targetnamespace="http://www.activiti.org/patterns"> <process id="pattern8multimerge" name="pattern 8 Multi Merge"> <documentation>implementation of Pattern 8 Multi Merge</documentation> <startevent id="startevent1" name="start" activiti:initiator="initiator"></startevent> <usertask id="usertask1" name="choice" activiti:assignee="${initiator"> <extensionelements> <activiti:formproperty id="choice" name="choice" type="enum" required="true" readable="true" writable="true"> <activiti:value id="1" name="task 1"></activiti:value> <activiti:value id="2" name="task 2"></activiti:value> <activiti:value id="3" name="task 1 & 2"></activiti:value> </activiti:formproperty> </extensionelements> </usertask> <sequenceflow id="flow1" name="" sourceref="startevent1" targetref="usertask1"></sequenceflow> <inclusivegateway id="inclusivegateway1" name="inclusive Gateway"></inclusiveGateway> <sequenceflow id="flow2" name="" sourceref="usertask1" targetref="inclusivegateway1"></sequenceflow> <usertask id="usertask2" name="task 1" activiti:assignee="${initiator"></usertask> <sequenceflow id="flow3" name="" sourceref="inclusivegateway1" targetref="usertask2"> <conditionexpression xsi:type="tformalexpression"><![cdata[${choice == 1 choice == 3]]></conditionExpression> </sequenceflow> <usertask id="usertask3" name="task 2" activiti:assignee="${initiator"></usertask> <sequenceflow id="flow4" name="" sourceref="inclusivegateway1" targetref="usertask3"> <conditionexpression xsi:type="tformalexpression"><![cdata[${choice!= 1]]></conditionExpression> </sequenceflow> <sequenceflow id="flow5" name="" sourceref="usertask3" targetref="exclusivegateway1"></sequenceflow> <sequenceflow id="flow6" name="" sourceref="usertask2" targetref="exclusivegateway1"></sequenceflow> <usertask id="usertask4" name="end Task" activiti:assignee="${initiator"></usertask> <sequenceflow id="flow7" name="" sourceref="exclusivegateway1" targetref="usertask4"></sequenceflow> <endevent id="endevent1" name="end"></endevent> <sequenceflow id="flow8" name="" sourceref="usertask4" targetref="endevent1"></sequenceflow> 138

Appendix E: XML implementation of the supported patterns <exclusivegateway id="exclusivegateway1" name="exclusive Gateway"></exclusiveGateway> </process> <bpmndi:bpmndiagram id="bpmndiagram_pattern8multimerge"> <bpmndi:bpmnplane bpmnelement="pattern8multimerge" id="bpmnplane_pattern8multimerge"> <bpmndi:bpmnshape bpmnelement="startevent1" id="bpmnshape_startevent1"> <omgdc:bounds height="35" width="35" x="60" y="150"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="usertask1" id="bpmnshape_usertask1"> <omgdc:bounds height="55" width="105" x="140" y="140"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="inclusivegateway1" id="bpmnshape_inclusivegateway1"> <omgdc:bounds height="40" width="40" x="300" y="147"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="usertask2" id="bpmnshape_usertask2"> <omgdc:bounds height="55" width="105" x="380" y="40"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="usertask3" id="bpmnshape_usertask3"> <omgdc:bounds height="55" width="105" x="380" y="250"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="usertask4" id="bpmnshape_usertask4"> <omgdc:bounds height="55" width="105" x="605" y="140"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="endevent1" id="bpmnshape_endevent1"> <omgdc:bounds height="35" width="35" x="765" y="150"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="exclusivegateway1" id="bpmnshape_exclusivegateway1"> <omgdc:bounds height="40" width="40" x="520" y="147"></omgdc:bounds> <bpmndi:bpmnedge bpmnelement="flow1" id="bpmnedge_flow1"> <omgdi:waypoint x="95" y="167"></omgdi:waypoint> <omgdi:waypoint x="140" y="167"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow2" id="bpmnedge_flow2"> <omgdi:waypoint x="245" y="167"></omgdi:waypoint> <omgdi:waypoint x="300" y="167"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow3" id="bpmnedge_flow3"> <omgdi:waypoint x="320" y="147"></omgdi:waypoint> <omgdi:waypoint x="320" y="67"></omgdi:waypoint> <omgdi:waypoint x="380" y="67"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow4" id="bpmnedge_flow4"> <omgdi:waypoint x="320" y="187"></omgdi:waypoint> <omgdi:waypoint x="320" y="277"></omgdi:waypoint> <omgdi:waypoint x="380" y="277"></omgdi:waypoint> 139

Appendix E: XML implementation of the supported patterns <bpmndi:bpmnedge bpmnelement="flow5" id="bpmnedge_flow5"> <omgdi:waypoint x="485" y="277"></omgdi:waypoint> <omgdi:waypoint x="540" y="277"></omgdi:waypoint> <omgdi:waypoint x="540" y="187"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow6" id="bpmnedge_flow6"> <omgdi:waypoint x="485" y="67"></omgdi:waypoint> <omgdi:waypoint x="540" y="67"></omgdi:waypoint> <omgdi:waypoint x="540" y="147"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow7" id="bpmnedge_flow7"> <omgdi:waypoint x="560" y="167"></omgdi:waypoint> <omgdi:waypoint x="605" y="167"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow8" id="bpmnedge_flow8"> <omgdi:waypoint x="710" y="167"></omgdi:waypoint> <omgdi:waypoint x="765" y="167"></omgdi:waypoint> </bpmndi:bpmnplane> </bpmndi:bpmndiagram> </definitions> Pattern 10 Arbitrary Cycles <?xml version="1.0" encoding="utf-8"?> <definitions xmlns="http://www.omg.org/spec/bpmn/20100524/model" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/bpmn/20100524/di" xmlns:omgdc="http://www.omg.org/spec/dd/20100524/dc" xmlns:omgdi="http://www.omg.org/spec/dd/20100524/di" typelanguage="http://www.w3.org/2001/xmlschema" expressionlanguage="http://www.w3.org/1999/xpath" targetnamespace="http://www.activiti.org/patterns"> <process id="pattern10arbitrarycycles" name="pattern 10 Arbitrary Cycles"> <documentation>implementation of Pattern 10 Arbitrary Cycles</documentation> <startevent id="startevent1" name="start" activiti:initiator="initiator"></startevent> <usertask id="usertask1" name="start Task" activiti:assignee="${initiator"></usertask> <exclusivegateway id="exclusivegateway1" name="exclusive Gateway"></exclusiveGateway> <sequenceflow id="flow2" name="" sourceref="usertask1" targetref="exclusivegateway1"></sequenceflow> <usertask id="usertask2" name="task 1" activiti:assignee="${initiator"></usertask> <sequenceflow id="flow3" name="" sourceref="exclusivegateway1" targetref="usertask2"></sequenceflow> <exclusivegateway id="exclusivegateway2" name="exclusive Gateway"></exclusiveGateway> <sequenceflow id="flow4" name="" sourceref="usertask2" targetref="exclusivegateway2"></sequenceflow> <usertask id="usertask3" name="choice 1" activiti:assignee="${initiator"> <extensionelements> 140

Appendix E: XML implementation of the supported patterns <activiti:formproperty id="goback" name="go back to task 2" type="boolean" required="true" readable="true" writable="true"></activiti:formproperty> </extensionelements> </usertask> <sequenceflow id="flow5" name="" sourceref="exclusivegateway2" targetref="usertask3"></sequenceflow> <exclusivegateway id="exclusivegateway3" name="exclusive Gateway"></exclusiveGateway> <sequenceflow id="flow6" name="" sourceref="usertask3" targetref="exclusivegateway3"></sequenceflow> <usertask id="usertask4" name="choice 2" activiti:assignee="${initiator"> <extensionelements> <activiti:formproperty id="goback" name="go back to task 3" type="boolean" required="true" readable="true" writable="true"></activiti:formproperty> </extensionelements> </usertask> <sequenceflow id="flow7" name="" sourceref="exclusivegateway3" targetref="usertask4"> <conditionexpression xsi:type="tformalexpression"><![cdata[${!goback]]></conditionexpression> </sequenceflow> <exclusivegateway id="exclusivegateway4" name="exclusive Gateway"></exclusiveGateway> <sequenceflow id="flow8" name="" sourceref="usertask4" targetref="exclusivegateway4"></sequenceflow> <usertask id="usertask5" name="end Task" activiti:assignee="${initiator"></usertask> <sequenceflow id="flow9" name="" sourceref="exclusivegateway4" targetref="usertask5"> <conditionexpression xsi:type="tformalexpression"><![cdata[${!goback]]></conditionexpression> </sequenceflow> <endevent id="endevent1" name="end"></endevent> <sequenceflow id="flow10" name="" sourceref="usertask5" targetref="endevent1"></sequenceflow> <usertask id="usertask6" name="choice" activiti:assignee="${initiator"> <extensionelements> <activiti:formproperty id="choice" name="choice" type="enum" required="true" readable="true" writable="true"> <activiti:value id="1" name="start Task"></activiti:value> <activiti:value id="2" name="choice 1"></activiti:value> </activiti:formproperty> </extensionelements> </usertask> <sequenceflow id="flow13" name="" sourceref="startevent1" targetref="usertask6"></sequenceflow> <exclusivegateway id="exclusivegateway5" name="exclusive Gateway"></exclusiveGateway> <sequenceflow id="flow14" name="" sourceref="usertask6" targetref="exclusivegateway5"></sequenceflow> <sequenceflow id="flow15" name="" sourceref="exclusivegateway5" targetref="usertask1"> <conditionexpression xsi:type="tformalexpression"><![cdata[${choice == 1]]></conditionExpression> 141

Appendix E: XML implementation of the supported patterns </sequenceflow> <sequenceflow id="flow16" name="" sourceref="exclusivegateway5" targetref="exclusivegateway2"> <conditionexpression xsi:type="tformalexpression"><![cdata[${choice == 2]]></conditionExpression> </sequenceflow> <sequenceflow id="flow17" name="" sourceref="exclusivegateway4" targetref="exclusivegateway2"> <conditionexpression xsi:type="tformalexpression"><![cdata[${goback]]></conditionexpression> </sequenceflow> <sequenceflow id="flow18" name="" sourceref="exclusivegateway3" targetref="exclusivegateway1"> <conditionexpression xsi:type="tformalexpression"><![cdata[${goback]]></conditionexpression> </sequenceflow> </process> <bpmndi:bpmndiagram id="bpmndiagram_pattern10arbitrarycycles"> <bpmndi:bpmnplane bpmnelement="pattern10arbitrarycycles" id="bpmnplane_pattern10arbitrarycycles"> <bpmndi:bpmnshape bpmnelement="startevent1" id="bpmnshape_startevent1"> <omgdc:bounds height="35" width="35" x="65" y="220"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="usertask1" id="bpmnshape_usertask1"> <omgdc:bounds height="55" width="105" x="425" y="100"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="exclusivegateway1" id="bpmnshape_exclusivegateway1"> <omgdc:bounds height="40" width="40" x="585" y="107"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="usertask2" id="bpmnshape_usertask2"> <omgdc:bounds height="55" width="105" x="670" y="100"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="exclusivegateway2" id="bpmnshape_exclusivegateway2"> <omgdc:bounds height="40" width="40" x="830" y="107"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="usertask3" id="bpmnshape_usertask3"> <omgdc:bounds height="55" width="105" x="915" y="100"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="exclusivegateway3" id="bpmnshape_exclusivegateway3"> <omgdc:bounds height="40" width="40" x="1075" y="107"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="usertask4" id="bpmnshape_usertask4"> <omgdc:bounds height="55" width="105" x="1160" y="100"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="exclusivegateway4" id="bpmnshape_exclusivegateway4"> <omgdc:bounds height="40" width="40" x="1320" y="107"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="usertask5" id="bpmnshape_usertask5"> <omgdc:bounds height="55" width="105" x="1405" y="100"></omgdc:bounds> 142

Appendix E: XML implementation of the supported patterns <bpmndi:bpmnshape bpmnelement="endevent1" id="bpmnshape_endevent1"> <omgdc:bounds height="35" width="35" x="1565" y="110"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="usertask6" id="bpmnshape_usertask6"> <omgdc:bounds height="55" width="105" x="145" y="210"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="exclusivegateway5" id="bpmnshape_exclusivegateway5"> <omgdc:bounds height="40" width="40" x="305" y="217"></omgdc:bounds> <bpmndi:bpmnedge bpmnelement="flow2" id="bpmnedge_flow2"> <omgdi:waypoint x="530" y="127"></omgdi:waypoint> <omgdi:waypoint x="585" y="127"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow3" id="bpmnedge_flow3"> <omgdi:waypoint x="625" y="127"></omgdi:waypoint> <omgdi:waypoint x="670" y="127"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow4" id="bpmnedge_flow4"> <omgdi:waypoint x="775" y="127"></omgdi:waypoint> <omgdi:waypoint x="830" y="127"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow5" id="bpmnedge_flow5"> <omgdi:waypoint x="870" y="127"></omgdi:waypoint> <omgdi:waypoint x="915" y="127"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow6" id="bpmnedge_flow6"> <omgdi:waypoint x="1020" y="127"></omgdi:waypoint> <omgdi:waypoint x="1075" y="127"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow7" id="bpmnedge_flow7"> <omgdi:waypoint x="1115" y="127"></omgdi:waypoint> <omgdi:waypoint x="1160" y="127"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow8" id="bpmnedge_flow8"> <omgdi:waypoint x="1265" y="127"></omgdi:waypoint> <omgdi:waypoint x="1320" y="127"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow9" id="bpmnedge_flow9"> <omgdi:waypoint x="1360" y="127"></omgdi:waypoint> <omgdi:waypoint x="1405" y="127"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow10" id="bpmnedge_flow10"> <omgdi:waypoint x="1510" y="127"></omgdi:waypoint> <omgdi:waypoint x="1565" y="127"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow13" id="bpmnedge_flow13"> <omgdi:waypoint x="100" y="237"></omgdi:waypoint> <omgdi:waypoint x="145" y="237"></omgdi:waypoint> 143

Appendix E: XML implementation of the supported patterns <bpmndi:bpmnedge bpmnelement="flow14" id="bpmnedge_flow14"> <omgdi:waypoint x="250" y="237"></omgdi:waypoint> <omgdi:waypoint x="305" y="237"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow15" id="bpmnedge_flow15"> <omgdi:waypoint x="325" y="217"></omgdi:waypoint> <omgdi:waypoint x="325" y="127"></omgdi:waypoint> <omgdi:waypoint x="425" y="127"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow16" id="bpmnedge_flow16"> <omgdi:waypoint x="345" y="237"></omgdi:waypoint> <omgdi:waypoint x="850" y="237"></omgdi:waypoint> <omgdi:waypoint x="850" y="147"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow17" id="bpmnedge_flow17"> <omgdi:waypoint x="1340" y="147"></omgdi:waypoint> <omgdi:waypoint x="1340" y="237"></omgdi:waypoint> <omgdi:waypoint x="850" y="237"></omgdi:waypoint> <omgdi:waypoint x="850" y="147"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow18" id="bpmnedge_flow18"> <omgdi:waypoint x="1095" y="107"></omgdi:waypoint> <omgdi:waypoint x="1095" y="24"></omgdi:waypoint> <omgdi:waypoint x="850" y="24"></omgdi:waypoint> <omgdi:waypoint x="605" y="24"></omgdi:waypoint> <omgdi:waypoint x="605" y="107"></omgdi:waypoint> </bpmndi:bpmnplane> </bpmndi:bpmndiagram> </definitions> Pattern 11 - Implicit Termination <?xml version="1.0" encoding="utf-8"?> <definitions xmlns="http://www.omg.org/spec/bpmn/20100524/model" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/bpmn/20100524/di" xmlns:omgdc="http://www.omg.org/spec/dd/20100524/dc" xmlns:omgdi="http://www.omg.org/spec/dd/20100524/di" typelanguage="http://www.w3.org/2001/xmlschema" expressionlanguage="http://www.w3.org/1999/xpath" targetnamespace="http://www.activiti.org/patterns"> <process id="pattern11implicittermination" name="pattern 11 Implicit Termination"> <documentation>implementation of Pattern 11 Implicit Termination</documentation> <startevent id="startevent1" name="start" activiti:initiator="initiator"></startevent> <usertask id="usertask1" name="start Task" activiti:assignee="${initiator"></usertask> 144

Appendix E: XML implementation of the supported patterns <sequenceflow id="flow1" name="" sourceref="startevent1" targetref="usertask1"></sequenceflow> <parallelgateway id="parallelgateway1" name="parallel Gateway"></parallelGateway> <sequenceflow id="flow2" name="" sourceref="usertask1" targetref="parallelgateway1"></sequenceflow> <usertask id="usertask2" name="branch 1 Task 1" activiti:assignee="${initiator"></usertask> <sequenceflow id="flow3" name="" sourceref="parallelgateway1" targetref="usertask2"></sequenceflow> <usertask id="usertask3" name="branch 2 Task 1" activiti:assignee="${initiator"></usertask> <sequenceflow id="flow4" name="" sourceref="parallelgateway1" targetref="usertask3"></sequenceflow> <usertask id="usertask4" name="branch 1 Task 2" activiti:assignee="${initiator"></usertask> <sequenceflow id="flow5" name="" sourceref="usertask2" targetref="usertask4"></sequenceflow> <usertask id="usertask5" name="branch 2 Task 2" activiti:assignee="${initiator"></usertask> <sequenceflow id="flow6" name="" sourceref="usertask3" targetref="usertask5"></sequenceflow> <endevent id="endevent1" name="end"></endevent> <sequenceflow id="flow7" name="" sourceref="usertask5" targetref="endevent1"></sequenceflow> <endevent id="endevent2" name="end"></endevent> <sequenceflow id="flow8" name="" sourceref="usertask4" targetref="endevent2"></sequenceflow> </process> <bpmndi:bpmndiagram id="bpmndiagram_pattern11implicittermination"> <bpmndi:bpmnplane bpmnelement="pattern11implicittermination" id="bpmnplane_pattern11implicittermination"> <bpmndi:bpmnshape bpmnelement="startevent1" id="bpmnshape_startevent1"> <omgdc:bounds height="35" width="35" x="50" y="180"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="usertask1" id="bpmnshape_usertask1"> <omgdc:bounds height="55" width="105" x="140" y="170"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="parallelgateway1" id="bpmnshape_parallelgateway1"> <omgdc:bounds height="40" width="40" x="290" y="177"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="usertask2" id="bpmnshape_usertask2"> <omgdc:bounds height="55" width="105" x="361" y="60"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="usertask3" id="bpmnshape_usertask3"> <omgdc:bounds height="55" width="105" x="361" y="280"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="usertask4" id="bpmnshape_usertask4"> <omgdc:bounds height="55" width="105" x="521" y="60"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="usertask5" id="bpmnshape_usertask5"> <omgdc:bounds height="55" width="105" x="521" y="280"></omgdc:bounds> 145

Appendix E: XML implementation of the supported patterns <bpmndi:bpmnshape bpmnelement="endevent1" id="bpmnshape_endevent1"> <omgdc:bounds height="35" width="35" x="681" y="290"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="endevent2" id="bpmnshape_endevent2"> <omgdc:bounds height="35" width="35" x="681" y="70"></omgdc:bounds> <bpmndi:bpmnedge bpmnelement="flow1" id="bpmnedge_flow1"> <omgdi:waypoint x="85" y="197"></omgdi:waypoint> <omgdi:waypoint x="140" y="197"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow2" id="bpmnedge_flow2"> <omgdi:waypoint x="245" y="197"></omgdi:waypoint> <omgdi:waypoint x="290" y="197"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow3" id="bpmnedge_flow3"> <omgdi:waypoint x="310" y="177"></omgdi:waypoint> <omgdi:waypoint x="308" y="87"></omgdi:waypoint> <omgdi:waypoint x="361" y="87"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow4" id="bpmnedge_flow4"> <omgdi:waypoint x="310" y="217"></omgdi:waypoint> <omgdi:waypoint x="310" y="306"></omgdi:waypoint> <omgdi:waypoint x="361" y="307"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow5" id="bpmnedge_flow5"> <omgdi:waypoint x="466" y="87"></omgdi:waypoint> <omgdi:waypoint x="521" y="87"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow6" id="bpmnedge_flow6"> <omgdi:waypoint x="466" y="307"></omgdi:waypoint> <omgdi:waypoint x="521" y="307"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow7" id="bpmnedge_flow7"> <omgdi:waypoint x="626" y="307"></omgdi:waypoint> <omgdi:waypoint x="681" y="307"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow8" id="bpmnedge_flow8"> <omgdi:waypoint x="626" y="87"></omgdi:waypoint> <omgdi:waypoint x="681" y="87"></omgdi:waypoint> </bpmndi:bpmnplane> </bpmndi:bpmndiagram> </definitions> Pattern 12 - Multiple Instances without Synchronization <?xml version="1.0" encoding="utf-8"?> <definitions xmlns="http://www.omg.org/spec/bpmn/20100524/model" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/bpmn/20100524/di" xmlns:omgdc="http://www.omg.org/spec/dd/20100524/dc" 146

Appendix E: XML implementation of the supported patterns xmlns:omgdi="http://www.omg.org/spec/dd/20100524/di" typelanguage="http://www.w3.org/2001/xmlschema" expressionlanguage="http://www.w3.org/1999/xpath" target- Namespace="http://www.activiti.org/patterns"> <process id="pattern12multipleinstanceswithoutsynchronization" name="pattern 12 Multiple Instances without Synchronization"> <documentation>implementation of Pattern 12 Multiple Instances without Synchronization</documentation> <startevent id="startevent1" name="start" activiti:initiator="initiator"></startevent> <usertask id="usertask1" name="start Task" activiti:assignee="${initiator"></usertask> <usertask id="usertask3" name="end Task" activiti:assignee="${initiator"></usertask> <endevent id="endevent1" name="end"></endevent> <usertask id="usertask4" name="multiple Tasks" activiti:assignee="${initiator"> <multiinstanceloopcharacteristics issequential="false"> <loopcardinality>3</loopcardinality> </multiinstanceloopcharacteristics> </usertask> <endevent id="endevent2" name="end"></endevent> <sequenceflow id="flow1" name="" sourceref="startevent1" targetref="usertask1"></sequenceflow> <sequenceflow id="flow4" name="" sourceref="usertask3" targetref="endevent1"></sequenceflow> <sequenceflow id="flow8" name="" sourceref="usertask4" targetref="endevent2"></sequenceflow> <sequenceflow id="flow9" name="" sourceref="usertask1" targetref="parallelgateway1"></sequenceflow> <parallelgateway id="parallelgateway1" name="exclusive Gateway"></parallelGateway> <sequenceflow id="flow10" name="" sourceref="parallelgateway1" targetref="usertask3"></sequenceflow> <sequenceflow id="flow11" name="" sourceref="parallelgateway1" targetref="usertask4"></sequenceflow> </process> <bpmndi:bpmndiagram id="bpmndiagram_pattern12multipleinstanceswithoutsynchronization"> <bpmndi:bpmnplane bpmnelement="pattern12multipleinstanceswithoutsynchronization" id="bpmnplane_pattern12multipleinstanceswithoutsynchronization"> <bpmndi:bpmnshape bpmnelement="startevent1" id="bpmnshape_startevent1"> <omgdc:bounds height="35" width="35" x="40" y="320"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="usertask1" id="bpmnshape_usertask1"> <omgdc:bounds height="55" width="105" x="140" y="310"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="usertask3" id="bpmnshape_usertask3"> <omgdc:bounds height="55" width="105" x="430" y="310"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="endevent1" id="bpmnshape_endevent1"> <omgdc:bounds height="35" width="35" x="600" y="320"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="usertask4" id="bpmnshape_usertask4"> <omgdc:bounds height="55" width="105" x="288" y="200"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="endevent2" id="bpmnshape_endevent2"> <omgdc:bounds height="35" width="35" x="600" y="210"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="parallelgateway1" id="bpmnshape_parallelgateway1"> <omgdc:bounds height="40" width="40" x="320" y="317"></omgdc:bounds> <bpmndi:bpmnedge bpmnelement="flow1" id="bpmnedge_flow1"> <omgdi:waypoint x="75" y="337"></omgdi:waypoint> <omgdi:waypoint x="140" y="337"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow4" id="bpmnedge_flow4"> <omgdi:waypoint x="535" y="337"></omgdi:waypoint> <omgdi:waypoint x="600" y="337"></omgdi:waypoint> 147

Appendix E: XML implementation of the supported patterns <bpmndi:bpmnedge bpmnelement="flow8" id="bpmnedge_flow8"> <omgdi:waypoint x="393" y="227"></omgdi:waypoint> <omgdi:waypoint x="600" y="227"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow9" id="bpmnedge_flow9"> <omgdi:waypoint x="245" y="337"></omgdi:waypoint> <omgdi:waypoint x="320" y="337"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow10" id="bpmnedge_flow10"> <omgdi:waypoint x="360" y="337"></omgdi:waypoint> <omgdi:waypoint x="430" y="337"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow11" id="bpmnedge_flow11"> <omgdi:waypoint x="340" y="317"></omgdi:waypoint> <omgdi:waypoint x="340" y="255"></omgdi:waypoint> </bpmndi:bpmnplane> </bpmndi:bpmndiagram> </definitions> Pattern 13 - Multiple Instances with a priori Design-Time Knowledge <?xml version="1.0" encoding="utf-8"?> <definitions xmlns="http://www.omg.org/spec/bpmn/20100524/model" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/bpmn/20100524/di" xmlns:omgdc="http://www.omg.org/spec/dd/20100524/dc" xmlns:omgdi="http://www.omg.org/spec/dd/20100524/di" typelanguage="http://www.w3.org/2001/xmlschema" expressionlanguage="http://www.w3.org/1999/xpath" targetnamespace="http://www.activiti.org/patterns"> <process id="pattern13multipleinstanceswithaprioridesign-timeknowledge" name="pattern 13 Multiple Instances with a priori Design-Time Knowledge"> <documentation>implementation of Pattern 13 Multiple Instances with a priori Design-Time Knowledge</documentation> <startevent id="startevent1" name="start" activiti:initiator="initiator"></startevent> <usertask id="usertask1" name="start Task" activiti:assignee="${initiator"></usertask> <sequenceflow id="flow1" name="" sourceref="startevent1" targetref="usertask1"></sequenceflow> <usertask id="usertask2" name="multiple Tasks" activiti:assignee="${initiator"> <multiinstanceloopcharacteristics issequential="false"> <loopcardinality>3</loopcardinality> <completioncondition>${nrofactiveinstances == 0</completionCondition> </multiinstanceloopcharacteristics> </usertask> <sequenceflow id="flow2" name="" sourceref="usertask1" targetref="usertask2"></sequenceflow> <usertask id="usertask3" name="end Task" activiti:assignee="${initiator"></usertask> <sequenceflow id="flow3" name="" sourceref="usertask2" targetref="usertask3"></sequenceflow> <endevent id="endevent1" name="end"></endevent> <sequenceflow id="flow4" name="" sourceref="usertask3" targetref="endevent1"></sequenceflow> </process> 148

Appendix E: XML implementation of the supported patterns <bpmndi:bpmndiagram id="bpmndiagram_pattern13multipleinstanceswithaprioridesign-timeknowledge"> <bpmndi:bpmnplane bpmnelement="pattern13multipleinstanceswithaprioridesign- TimeKnowledge" id="bpmnplane_pattern13multipleinstanceswithaprioridesign- TimeKnowledge"> <bpmndi:bpmnshape bpmnelement="startevent1" id="bpmnshape_startevent1"> <omgdc:bounds height="35" width="35" x="40" y="90"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="usertask1" id="bpmnshape_usertask1"> <omgdc:bounds height="55" width="105" x="120" y="80"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="usertask2" id="bpmnshape_usertask2"> <omgdc:bounds height="55" width="105" x="280" y="80"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="usertask3" id="bpmnshape_usertask3"> <omgdc:bounds height="55" width="105" x="440" y="80"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="endevent1" id="bpmnshape_endevent1"> <omgdc:bounds height="35" width="35" x="600" y="90"></omgdc:bounds> <bpmndi:bpmnedge bpmnelement="flow1" id="bpmnedge_flow1"> <omgdi:waypoint x="75" y="107"></omgdi:waypoint> <omgdi:waypoint x="120" y="107"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow2" id="bpmnedge_flow2"> <omgdi:waypoint x="225" y="107"></omgdi:waypoint> <omgdi:waypoint x="280" y="107"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow3" id="bpmnedge_flow3"> <omgdi:waypoint x="385" y="107"></omgdi:waypoint> <omgdi:waypoint x="440" y="107"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow4" id="bpmnedge_flow4"> <omgdi:waypoint x="545" y="107"></omgdi:waypoint> <omgdi:waypoint x="600" y="107"></omgdi:waypoint> </bpmndi:bpmnplane> </bpmndi:bpmndiagram> </definitions> Pattern 14 - Multiple Instances with a priori Run-Time Knowledge <?xml version="1.0" encoding="utf-8"?> <definitions xmlns="http://www.omg.org/spec/bpmn/20100524/model" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/bpmn/20100524/di" xmlns:omgdc="http://www.omg.org/spec/dd/20100524/dc" xmlns:omgdi="http://www.omg.org/spec/dd/20100524/di" typelanguage="http://www.w3.org/2001/xmlschema" expressionlanguage="http://www.w3.org/1999/xpath" targetnamespace="http://www.activiti.org/patterns"> 149

Appendix E: XML implementation of the supported patterns <process id="pattern14multipleinstanceswithapriorirun-timeknowledge" name="pattern 14 Multiple Instances with a priori Run-Time Knowledge"> <documentation>implementation of Pattern 14 Multiple Instances with a priori Run-Time Knowledge</documentation> <startevent id="startevent1" name="start" activiti:initiator="initiator"></startevent> <usertask id="usertask1" name="choice" activiti:assignee="${initiator"> <extensionelements> <activiti:formproperty id="instances" name="number of task instances" type="long" required="true" readable="true" writable="true"></activiti:formproperty> </extensionelements> </usertask> <usertask id="usertask2" name="multiple Tasks" activiti:assignee="${initiator"> <multiinstanceloopcharacteristics issequential="false"> <loopcardinality>${instances</loopcardinality> </multiinstanceloopcharacteristics> </usertask> <usertask id="usertask3" name="end Task" activiti:assignee="${initiator"></usertask> <endevent id="endevent1" name="end"></endevent> <sequenceflow id="flow1" name="" sourceref="startevent1" targetref="usertask1"></sequenceflow> <sequenceflow id="flow2" name="" sourceref="usertask1" targetref="usertask2"></sequenceflow> <sequenceflow id="flow3" name="" sourceref="usertask2" targetref="usertask3"></sequenceflow> <sequenceflow id="flow4" name="" sourceref="usertask3" targetref="endevent1"></sequenceflow> </process> <bpmndi:bpmndiagram id="bpmndiagram_pattern14multipleinstanceswithapriorirun- TimeKnowledge"> <bpmndi:bpmnplane bpmnelement="pattern14multipleinstanceswithapriorirun- TimeKnowledge" id="bpmnplane_pattern14multipleinstanceswithapriorirun- TimeKnowledge"> <bpmndi:bpmnshape bpmnelement="startevent1" id="bpmnshape_startevent1"> <omgdc:bounds height="35" width="35" x="50" y="60"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="usertask1" id="bpmnshape_usertask1"> <omgdc:bounds height="55" width="105" x="130" y="50"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="usertask2" id="bpmnshape_usertask2"> <omgdc:bounds height="55" width="105" x="290" y="50"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="usertask3" id="bpmnshape_usertask3"> <omgdc:bounds height="55" width="105" x="450" y="50"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="endevent1" id="bpmnshape_endevent1"> <omgdc:bounds height="35" width="35" x="610" y="60"></omgdc:bounds> <bpmndi:bpmnedge bpmnelement="flow1" id="bpmnedge_flow1"> <omgdi:waypoint x="85" y="77"></omgdi:waypoint> <omgdi:waypoint x="130" y="77"></omgdi:waypoint> 150

Appendix E: XML implementation of the supported patterns <bpmndi:bpmnedge bpmnelement="flow2" id="bpmnedge_flow2"> <omgdi:waypoint x="235" y="77"></omgdi:waypoint> <omgdi:waypoint x="290" y="77"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow3" id="bpmnedge_flow3"> <omgdi:waypoint x="395" y="77"></omgdi:waypoint> <omgdi:waypoint x="450" y="77"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow4" id="bpmnedge_flow4"> <omgdi:waypoint x="555" y="77"></omgdi:waypoint> <omgdi:waypoint x="610" y="77"></omgdi:waypoint> </bpmndi:bpmnplane> </bpmndi:bpmndiagram> </definitions> Pattern 16 - Deferred Choice <?xml version="1.0" encoding="utf-8"?> <definitions xmlns="http://www.omg.org/spec/bpmn/20100524/model" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/bpmn/20100524/di" xmlns:omgdc="http://www.omg.org/spec/dd/20100524/dc" xmlns:omgdi="http://www.omg.org/spec/dd/20100524/di" typelanguage="http://www.w3.org/2001/xmlschema" expressionlanguage="http://www.w3.org/1999/xpath" targetnamespace="http://www.activiti.org/patterns"> <process id="pattern16deferredchoice" name="pattern 16 Deferred Choice"> <documentation>implementation of Pattern 16 Deferred Choice</documentation> <startevent id="startevent1" name="start" activiti:initiator="initiator"></startevent> <usertask id="usertask1" name="start Task" activiti:assignee="${initiator"></usertask> <subprocess id="subprocess1" name="sub Process"> <startevent id="startevent2" name="start" activiti:initiator="initiator"></startevent> <parallelgateway id="parallelgateway1" name="parallel Gateway"></parallelGateway> <usertask id="usertask3" name="task 2" activiti:assignee="${initiator"></usertask> <endevent id="endevent1" name="errorend"> <erroreventdefinition errorref="errortask2"></erroreventdefinition> </endevent> <endevent id="endevent2" name="errorend"> <erroreventdefinition errorref="errortask1"></erroreventdefinition> </endevent> <sequenceflow id="flow3" name="" sourceref="startevent2" targetref="parallelgateway1"></sequenceflow> <sequenceflow id="flow5" name="" sourceref="parallelgateway1" targetref="usertask3"></sequenceflow> <sequenceflow id="flow6" name="" sourceref="usertask3" targetref="endevent1"></sequenceflow> <intermediatecatchevent id="timerintermediatecatchevent1" name="timercatchevent"> 151

Appendix E: XML implementation of the supported patterns <timereventdefinition> <timeduration>pt30s</timeduration> </timereventdefinition> </intermediatecatchevent> <sequenceflow id="flow12" name="" sourceref="timerintermediatecatchevent1" targetref="endevent2"></sequenceflow> <sequenceflow id="flow13" name="" sourceref="parallelgateway1" targetref="timerintermediatecatchevent1"></sequenceflow> </subprocess> <boundaryevent id="boundaryerror1" cancelactivity="true" attachedtoref="subprocess1"> <erroreventdefinition errorref="errortask1"></erroreventdefinition> </boundaryevent> <boundaryevent id="boundaryerror2" cancelactivity="true" attachedtoref="subprocess1"> <erroreventdefinition errorref="errortask2"></erroreventdefinition> </boundaryevent> <usertask id="usertask4" name="end Task 1" activiti:assignee="${initiator"></usertask> <endevent id="endevent3" name="end"></endevent> <usertask id="usertask5" name="end Task 2" activiti:assignee="${initiator"></usertask> <endevent id="endevent4" name="end"></endevent> <sequenceflow id="flow1" name="" sourceref="startevent1" targetref="usertask1"></sequenceflow> <sequenceflow id="flow2" name="" sourceref="usertask1" targetref="subprocess1"></sequenceflow> <sequenceflow id="flow8" name="" sourceref="boundaryerror1" targetref="usertask4"></sequenceflow> <sequenceflow id="flow9" name="" sourceref="usertask4" targetref="endevent3"></sequenceflow> <sequenceflow id="flow10" name="" sourceref="usertask5" targetref="endevent4"></sequenceflow> <sequenceflow id="flow11" name="" sourceref="boundaryerror2" targetref="usertask5"></sequenceflow> </process> <bpmndi:bpmndiagram id="bpmndiagram_pattern16deferredchoice"> <bpmndi:bpmnplane bpmnelement="pattern16deferredchoice" id="bpmnplane_pattern16deferredchoice"> <bpmndi:bpmnshape bpmnelement="startevent1" id="bpmnshape_startevent1"> <omgdc:bounds height="35" width="35" x="20" y="256"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="usertask1" id="bpmnshape_usertask1"> <omgdc:bounds height="55" width="105" x="100" y="246"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="subprocess1" id="bpmnshape_subprocess1" isexpanded="true"> <omgdc:bounds height="361" width="461" x="260" y="93"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="startevent2" id="bpmnshape_startevent2"> <omgdc:bounds height="35" width="35" x="280" y="253"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="parallelgateway1" id="bpmnshape_parallelgateway1"> 152

Appendix E: XML implementation of the supported patterns <omgdc:bounds height="40" width="40" x="380" y="250"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="usertask3" id="bpmnshape_usertask3"> <omgdc:bounds height="55" width="105" x="460" y="358"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="endevent1" id="bpmnshape_endevent1"> <omgdc:bounds height="35" width="35" x="620" y="368"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="endevent2" id="bpmnshape_endevent2"> <omgdc:bounds height="35" width="35" x="620" y="148"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="timerintermediatecatchevent1" id="bpmnshape_timerintermediatecatchevent1"> <omgdc:bounds height="35" width="35" x="480" y="148"></omgdc:bounds> <bpmndi:bpmnedge bpmnelement="flow3" id="bpmnedge_flow3"> <omgdi:waypoint x="315" y="270"></omgdi:waypoint> <omgdi:waypoint x="380" y="270"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow5" id="bpmnedge_flow5"> <omgdi:waypoint x="400" y="290"></omgdi:waypoint> <omgdi:waypoint x="400" y="385"></omgdi:waypoint> <omgdi:waypoint x="460" y="385"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow6" id="bpmnedge_flow6"> <omgdi:waypoint x="565" y="385"></omgdi:waypoint> <omgdi:waypoint x="620" y="385"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow12" id="bpmnedge_flow12"> <omgdi:waypoint x="515" y="165"></omgdi:waypoint> <omgdi:waypoint x="620" y="165"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow13" id="bpmnedge_flow13"> <omgdi:waypoint x="400" y="250"></omgdi:waypoint> <omgdi:waypoint x="400" y="165"></omgdi:waypoint> <omgdi:waypoint x="480" y="165"></omgdi:waypoint> <bpmndi:bpmnshape bpmnelement="boundaryerror1" id="bpmnshape_boundaryerror1"> <omgdc:bounds height="30" width="30" x="690" y="151"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="boundaryerror2" id="bpmnshape_boundaryerror2"> <omgdc:bounds height="30" width="30" x="690" y="371"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="usertask4" id="bpmnshape_usertask4"> <omgdc:bounds height="55" width="105" x="770" y="138"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="endevent3" id="bpmnshape_endevent3"> <omgdc:bounds height="35" width="35" x="930" y="148"></omgdc:bounds> 153

Appendix E: XML implementation of the supported patterns <bpmndi:bpmnshape bpmnelement="usertask5" id="bpmnshape_usertask5"> <omgdc:bounds height="55" width="105" x="770" y="358"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="endevent4" id="bpmnshape_endevent4"> <omgdc:bounds height="35" width="35" x="930" y="368"></omgdc:bounds> <bpmndi:bpmnedge bpmnelement="flow1" id="bpmnedge_flow1"> <omgdi:waypoint x="55" y="273"></omgdi:waypoint> <omgdi:waypoint x="100" y="273"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow2" id="bpmnedge_flow2"> <omgdi:waypoint x="205" y="273"></omgdi:waypoint> <omgdi:waypoint x="260" y="273"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow8" id="bpmnedge_flow8"> <omgdi:waypoint x="705" y="181"></omgdi:waypoint> <omgdi:waypoint x="770" y="165"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow9" id="bpmnedge_flow9"> <omgdi:waypoint x="875" y="165"></omgdi:waypoint> <omgdi:waypoint x="930" y="165"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow10" id="bpmnedge_flow10"> <omgdi:waypoint x="875" y="385"></omgdi:waypoint> <omgdi:waypoint x="930" y="385"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow11" id="bpmnedge_flow11"> <omgdi:waypoint x="705" y="401"></omgdi:waypoint> <omgdi:waypoint x="770" y="385"></omgdi:waypoint> </bpmndi:bpmnplane> </bpmndi:bpmndiagram> </definitions> Pattern 19 - Cancel Activity <?xml version="1.0" encoding="utf-8"?> <definitions xmlns="http://www.omg.org/spec/bpmn/20100524/model" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/bpmn/20100524/di" xmlns:omgdc="http://www.omg.org/spec/dd/20100524/dc" xmlns:omgdi="http://www.omg.org/spec/dd/20100524/di" typelanguage="http://www.w3.org/2001/xmlschema" expressionlanguage="http://www.w3.org/1999/xpath" targetnamespace="http://www.activiti.org/patterns"> <process id="pattern19canceltask" name="pattern 19 Cancel Task"> <documentation>implementation of Pattern 19 Cancel Task</documentation> <startevent id="startevent1" name="start" activiti:initiator="initiator"></startevent> <usertask id="usertask1" name="start Task" activiti:assignee="${initiator"></usertask> <subprocess id="subprocess1" name="sub Process"> 154

Appendix E: XML implementation of the supported patterns <startevent id="startevent2" name="start" activiti:initiator="initiator"></startevent> <usertask id="usertask3" name="choice" activiti:assignee="${initiator"> <extensionelements> <activiti:formproperty id="error" name="error" type="boolean" required="true" readable="true" writable="true"></activiti:formproperty> </extensionelements> </usertask> <exclusivegateway id="exclusivegateway1" name="exclusive Gateway"></exclusiveGateway> <endevent id="endevent2" name="end"></endevent> <endevent id="endevent3" name="errorend"> <erroreventdefinition errorref="task2error"></erroreventdefinition> </endevent> <parallelgateway id="parallelgateway1" name="parallel Gateway"></parallelGateway> <usertask id="usertask4" name="task 1" activiti:assignee="${initiator"></usertask> <usertask id="usertask5" name="task 2" activiti:assignee="${initiator"></usertask> <endevent id="endevent5" name="end"></endevent> <sequenceflow id="flow6" name="" sourceref="usertask3" targetref="exclusivegateway1"></sequenceflow> <sequenceflow id="flow7" name="" sourceref="exclusivegateway1" targetref="endevent2"> <conditionexpression xsi:type="tformalexpression"><![cdata[${!error]]></conditionexpression> </sequenceflow> <sequenceflow id="flow8" name="" sourceref="exclusivegateway1" targetref="endevent3"> <conditionexpression xsi:type="tformalexpression"><![cdata[${error]]></conditionexpression> </sequenceflow> <sequenceflow id="flow10" name="" sourceref="startevent2" targetref="parallelgateway1"></sequenceflow> <sequenceflow id="flow11" name="" sourceref="parallelgateway1" targetref="usertask3"></sequenceflow> <sequenceflow id="flow12" name="" sourceref="parallelgateway1" targetref="usertask4"></sequenceflow> <sequenceflow id="flow13" name="" sourceref="usertask4" targetref="usertask5"></sequenceflow> <sequenceflow id="flow14" name="" sourceref="usertask5" targetref="endevent5"></sequenceflow> </subprocess> <boundaryevent id="boundaryerror1" name="" cancelactivity="true" attachedtoref="subprocess1"> <erroreventdefinition errorref="task2error"></erroreventdefinition> </boundaryevent> <usertask id="usertask2" name="end Task" activiti:assignee="${initiator"></usertask> <endevent id="endevent1" name="end"></endevent> <endevent id="endevent4" name="end"></endevent> <sequenceflow id="flow1" name="" sourceref="startevent1" targetref="usertask1"></sequenceflow> 155

Appendix E: XML implementation of the supported patterns <sequenceflow id="flow2" name="" sourceref="usertask1" targetref="subprocess1"></sequenceflow> <sequenceflow id="flow3" name="" sourceref="subprocess1" targetref="usertask2"></sequenceflow> <sequenceflow id="flow4" name="" sourceref="usertask2" targetref="endevent1"></sequenceflow> <sequenceflow id="flow9" name="" sourceref="boundaryerror1" targetref="endevent4"></sequenceflow> </process> <bpmndi:bpmndiagram id="bpmndiagram_pattern19canceltask"> <bpmndi:bpmnplane bpmnelement="pattern19canceltask" id="bpmnplane_pattern19canceltask"> <bpmndi:bpmnshape bpmnelement="startevent1" id="bpmnshape_startevent1"> <omgdc:bounds height="35" width="35" x="40" y="182"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="usertask1" id="bpmnshape_usertask1"> <omgdc:bounds height="55" width="105" x="107" y="172"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="subprocess1" id="bpmnshape_subprocess1" isexpanded="true"> <omgdc:bounds height="300" width="531" x="260" y="50"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="startevent2" id="bpmnshape_startevent2"> <omgdc:bounds height="35" width="35" x="270" y="165"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="usertask3" id="bpmnshape_usertask3"> <omgdc:bounds height="55" width="105" x="420" y="228"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="exclusivegateway1" id="bpmnshape_exclusivegateway1"> <omgdc:bounds height="40" width="40" x="580" y="235"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="endevent2" id="bpmnshape_endevent2"> <omgdc:bounds height="35" width="35" x="665" y="178"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="endevent3" id="bpmnshape_endevent3"> <omgdc:bounds height="35" width="35" x="665" y="298"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="parallelgateway1" id="bpmnshape_parallelgateway1"> <omgdc:bounds height="40" width="40" x="350" y="162"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="usertask4" id="bpmnshape_usertask4"> <omgdc:bounds height="55" width="105" x="420" y="85"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="usertask5" id="bpmnshape_usertask5"> <omgdc:bounds height="55" width="105" x="580" y="85"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="endevent5" id="bpmnshape_endevent5"> <omgdc:bounds height="35" width="35" x="730" y="95"></omgdc:bounds> <bpmndi:bpmnedge bpmnelement="flow6" id="bpmnedge_flow6"> 156

Appendix E: XML implementation of the supported patterns <omgdi:waypoint x="525" y="255"></omgdi:waypoint> <omgdi:waypoint x="580" y="255"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow7" id="bpmnedge_flow7"> <omgdi:waypoint x="600" y="235"></omgdi:waypoint> <omgdi:waypoint x="600" y="195"></omgdi:waypoint> <omgdi:waypoint x="665" y="195"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow8" id="bpmnedge_flow8"> <omgdi:waypoint x="600" y="275"></omgdi:waypoint> <omgdi:waypoint x="600" y="315"></omgdi:waypoint> <omgdi:waypoint x="665" y="315"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow10" id="bpmnedge_flow10"> <omgdi:waypoint x="305" y="182"></omgdi:waypoint> <omgdi:waypoint x="350" y="182"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow11" id="bpmnedge_flow11"> <omgdi:waypoint x="370" y="202"></omgdi:waypoint> <omgdi:waypoint x="370" y="255"></omgdi:waypoint> <omgdi:waypoint x="420" y="255"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow12" id="bpmnedge_flow12"> <omgdi:waypoint x="370" y="162"></omgdi:waypoint> <omgdi:waypoint x="370" y="111"></omgdi:waypoint> <omgdi:waypoint x="420" y="112"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow13" id="bpmnedge_flow13"> <omgdi:waypoint x="525" y="112"></omgdi:waypoint> <omgdi:waypoint x="580" y="112"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow14" id="bpmnedge_flow14"> <omgdi:waypoint x="685" y="112"></omgdi:waypoint> <omgdi:waypoint x="730" y="112"></omgdi:waypoint> <bpmndi:bpmnshape bpmnelement="boundaryerror1" id="bpmnshape_boundaryerror1"> <omgdc:bounds height="30" width="30" x="446" y="330"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="usertask2" id="bpmnshape_usertask2"> <omgdc:bounds height="55" width="105" x="850" y="172"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="endevent1" id="bpmnshape_endevent1"> <omgdc:bounds height="35" width="35" x="1010" y="182"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="endevent4" id="bpmnshape_endevent4"> <omgdc:bounds height="35" width="35" x="443" y="405"></omgdc:bounds> <bpmndi:bpmnedge bpmnelement="flow1" id="bpmnedge_flow1"> <omgdi:waypoint x="75" y="199"></omgdi:waypoint> 157

Appendix E: XML implementation of the supported patterns <omgdi:waypoint x="107" y="199"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow2" id="bpmnedge_flow2"> <omgdi:waypoint x="212" y="199"></omgdi:waypoint> <omgdi:waypoint x="260" y="200"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow3" id="bpmnedge_flow3"> <omgdi:waypoint x="791" y="200"></omgdi:waypoint> <omgdi:waypoint x="850" y="199"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow4" id="bpmnedge_flow4"> <omgdi:waypoint x="955" y="199"></omgdi:waypoint> <omgdi:waypoint x="1010" y="199"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow9" id="bpmnedge_flow9"> <omgdi:waypoint x="461" y="360"></omgdi:waypoint> <omgdi:waypoint x="460" y="405"></omgdi:waypoint> </bpmndi:bpmnplane> </bpmndi:bpmndiagram> </definitions> Pattern 20 - Cancel Case <?xml version="1.0" encoding="utf-8"?> <definitions xmlns="http://www.omg.org/spec/bpmn/20100524/model" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/bpmn/20100524/di" xmlns:omgdc="http://www.omg.org/spec/dd/20100524/dc" xmlns:omgdi="http://www.omg.org/spec/dd/20100524/di" typelanguage="http://www.w3.org/2001/xmlschema" expressionlanguage="http://www.w3.org/1999/xpath" targetnamespace="http://www.activiti.org/patterns"> <process id="pattern20cancelcase" name="pattern 20 Cancel Case"> <documentation>implementation of Pattern 20 Cancel Case.</documentation> <startevent id="startevent1" name="start" activiti:initiator="initiator"></startevent> <subprocess id="subprocess1" name="sub Process"> <startevent id="startevent2" name="start"></startevent> <usertask id="usertask1" name="start Task" activiti:assignee="${initiator"></usertask> <parallelgateway id="parallelgateway1" name="parallel Gateway"></parallelGateway> <usertask id="usertask2" name="task 1" activiti:assignee="${initiator"></usertask> <usertask id="usertask3" name="choice" activiti:assignee="${initiator"> <extensionelements> <activiti:formproperty id="cancel" name="cancel" type="boolean" required="true" readable="true" writable="true"></activiti:formproperty> </extensionelements> </usertask> 158

Appendix E: XML implementation of the supported patterns <usertask id="usertask4" name="end Task" activiti:assignee="${initiator"></usertask> <exclusivegateway id="exclusivegateway1" name="exclusive Gateway"></exclusiveGateway> <endevent id="endevent3" name="end"></endevent> <endevent id="endevent4" name="end"></endevent> <endevent id="endevent5" name="errorend"> <erroreventdefinition errorref="cancelerror"></erroreventdefinition> </endevent> <sequenceflow id="flow4" name="" sourceref="startevent2" targetref="usertask1"></sequenceflow> <sequenceflow id="flow5" name="" sourceref="usertask1" targetref="parallelgateway1"></sequenceflow> <sequenceflow id="flow6" name="" sourceref="parallelgateway1" targetref="usertask2"></sequenceflow> <sequenceflow id="flow7" name="" sourceref="parallelgateway1" targetref="usertask3"></sequenceflow> <sequenceflow id="flow8" name="" sourceref="usertask2" targetref="usertask4"></sequenceflow> <sequenceflow id="flow9" name="" sourceref="usertask3" targetref="exclusivegateway1"></sequenceflow> <sequenceflow id="flow11" name="" sourceref="usertask4" targetref="endevent4"></sequenceflow> <sequenceflow id="flow12" name="" sourceref="exclusivegateway1" targetref="endevent5"> <conditionexpression xsi:type="tformalexpression"><![cdata[${cancel ]]></conditionexpression> </sequenceflow> <sequenceflow id="flow13" name="" sourceref="exclusivegateway1" targetref="endevent3"> <conditionexpression xsi:type="tformalexpression"><![cdata[ ${!cancel ]]></conditionexpression> </sequenceflow> </subprocess> <boundaryevent id="boundaryerror1" name="error" cancelactivity="true" attachedtoref="subprocess1"> <erroreventdefinition errorref="cancelerror"></erroreventdefinition> </boundaryevent> <endevent id="endevent1" name="end"></endevent> <sequenceflow id="flow1" name="" sourceref="startevent1" targetref="subprocess1"></sequenceflow> <sequenceflow id="flow2" name="" sourceref="subprocess1" targetref="endevent1"></sequenceflow> <endevent id="endevent6" name="end"></endevent> <sequenceflow id="flow14" name="" sourceref="boundaryerror1" targetref="endevent6"></sequenceflow> </process> <bpmndi:bpmndiagram id="bpmndiagram_pattern20cancelcase"> <bpmndi:bpmnplane bpmnelement="pattern20cancelcase" id="bpmnplane_pattern20cancelcase"> <bpmndi:bpmnshape bpmnelement="startevent1" id="bpmnshape_startevent1"> <omgdc:bounds height="35" width="35" x="40" y="173"></omgdc:bounds> 159

Appendix E: XML implementation of the supported patterns <bpmndi:bpmnshape bpmnelement="subprocess1" id="bpmnshape_subprocess1" isexpanded="true"> <omgdc:bounds height="321" width="711" x="140" y="30"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="startevent2" id="bpmnshape_startevent2"> <omgdc:bounds height="35" width="35" x="160" y="176"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="usertask1" id="bpmnshape_usertask1"> <omgdc:bounds height="55" width="105" x="240" y="166"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="parallelgateway1" id="bpmnshape_parallelgateway1"> <omgdc:bounds height="40" width="40" x="400" y="173"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="usertask2" id="bpmnshape_usertask2"> <omgdc:bounds height="55" width="105" x="480" y="80"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="usertask3" id="bpmnshape_usertask3"> <omgdc:bounds height="55" width="105" x="480" y="250"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="usertask4" id="bpmnshape_usertask4"> <omgdc:bounds height="55" width="105" x="640" y="80"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="exclusivegateway1" id="bpmnshape_exclusivegateway1"> <omgdc:bounds height="40" width="40" x="630" y="257"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="endevent3" id="bpmnshape_endevent3"> <omgdc:bounds height="35" width="35" x="710" y="220"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="endevent4" id="bpmnshape_endevent4"> <omgdc:bounds height="35" width="35" x="790" y="90"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="endevent5" id="bpmnshape_endevent5"> <omgdc:bounds height="35" width="35" x="710" y="297"></omgdc:bounds> <bpmndi:bpmnedge bpmnelement="flow4" id="bpmnedge_flow4"> <omgdi:waypoint x="195" y="193"></omgdi:waypoint> <omgdi:waypoint x="240" y="193"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow5" id="bpmnedge_flow5"> <omgdi:waypoint x="345" y="193"></omgdi:waypoint> <omgdi:waypoint x="400" y="193"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow6" id="bpmnedge_flow6"> <omgdi:waypoint x="420" y="173"></omgdi:waypoint> <omgdi:waypoint x="420" y="108"></omgdi:waypoint> <omgdi:waypoint x="480" y="107"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow7" id="bpmnedge_flow7"> 160

Appendix E: XML implementation of the supported patterns <omgdi:waypoint x="420" y="213"></omgdi:waypoint> <omgdi:waypoint x="420" y="276"></omgdi:waypoint> <omgdi:waypoint x="480" y="277"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow8" id="bpmnedge_flow8"> <omgdi:waypoint x="585" y="107"></omgdi:waypoint> <omgdi:waypoint x="640" y="107"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow9" id="bpmnedge_flow9"> <omgdi:waypoint x="585" y="277"></omgdi:waypoint> <omgdi:waypoint x="630" y="277"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow11" id="bpmnedge_flow11"> <omgdi:waypoint x="745" y="107"></omgdi:waypoint> <omgdi:waypoint x="790" y="107"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow12" id="bpmnedge_flow12"> <omgdi:waypoint x="650" y="297"></omgdi:waypoint> <omgdi:waypoint x="650" y="314"></omgdi:waypoint> <omgdi:waypoint x="710" y="314"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow13" id="bpmnedge_flow13"> <omgdi:waypoint x="650" y="257"></omgdi:waypoint> <omgdi:waypoint x="650" y="237"></omgdi:waypoint> <omgdi:waypoint x="710" y="237"></omgdi:waypoint> <bpmndi:bpmnshape bpmnelement="boundaryerror1" id="bpmnshape_boundaryerror1"> <omgdc:bounds height="30" width="30" x="803" y="330"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="endevent1" id="bpmnshape_endevent1"> <omgdc:bounds height="35" width="35" x="920" y="173"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="endevent6" id="bpmnshape_endevent6"> <omgdc:bounds height="35" width="35" x="800" y="400"></omgdc:bounds> <bpmndi:bpmnedge bpmnelement="flow1" id="bpmnedge_flow1"> <omgdi:waypoint x="75" y="190"></omgdi:waypoint> <omgdi:waypoint x="140" y="190"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow2" id="bpmnedge_flow2"> <omgdi:waypoint x="851" y="190"></omgdi:waypoint> <omgdi:waypoint x="920" y="190"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow14" id="bpmnedge_flow14"> <omgdi:waypoint x="818" y="360"></omgdi:waypoint> <omgdi:waypoint x="817" y="400"></omgdi:waypoint> </bpmndi:bpmnplane> </bpmndi:bpmndiagram> 161

Appendix E: XML implementation of the supported patterns </definitions> Pattern 21 - Structured Loop (post-test) <?xml version="1.0" encoding="utf-8"?> <definitions xmlns="http://www.omg.org/spec/bpmn/20100524/model" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/bpmn/20100524/di" xmlns:omgdc="http://www.omg.org/spec/dd/20100524/dc" xmlns:omgdi="http://www.omg.org/spec/dd/20100524/di" typelanguage="http://www.w3.org/2001/xmlschema" expressionlanguage="http://www.w3.org/1999/xpath" targetnamespace="http://www.activiti.org/patterns"> <process id="pattern21structuredloop" name="pattern 21 Structured Loop"> <documentation>implementation of Pattern 21 Structured Loop</documentation> <startevent id="startevent1" name="start" activiti:initiator="initiator"></startevent> <usertask id="usertask1" name="while" activiti:assignee="${initiator"> <extensionelements> <activiti:formproperty id="repeat" name="repeat" type="boolean" required="true" readable="true" writable="true"></activiti:formproperty> </extensionelements> </usertask> <exclusivegateway id="exclusivegateway1" name="exclusive Gateway"></exclusiveGateway> <usertask id="usertask2" name="loop Task 1" activiti:assignee="${initiator"></usertask> <exclusivegateway id="exclusivegateway2" name="exclusive Gateway"></exclusiveGateway> <usertask id="usertask4" name="end task" activiti:assignee="${initiator"></usertask> <endevent id="endevent1" name="end"></endevent> <sequenceflow id="flow2" name="" sourceref="usertask1" targetref="exclusivegateway1"></sequenceflow> <sequenceflow id="flow3" name="" sourceref="exclusivegateway1" targetref="usertask2"> <conditionexpression xsi:type="tformalexpression"><![cdata[${repeat]]></conditionexpression> </sequenceflow> <sequenceflow id="flow5" name="" sourceref="startevent1" targetref="exclusivegateway2"></sequenceflow> <sequenceflow id="flow6" name="" sourceref="exclusivegateway2" targetref="usertask1"></sequenceflow> <sequenceflow id="flow8" name="" sourceref="exclusivegateway1" targetref="usertask4"> <conditionexpression xsi:type="tformalexpression"><![cdata[${!repeat]]></conditionexpression> </sequenceflow> <sequenceflow id="flow9" name="" sourceref="usertask4" targetref="endevent1"></sequenceflow> <sequenceflow id="flow10" name="" sourceref="usertask2" targetref="exclusivegateway2"></sequenceflow> </process> <bpmndi:bpmndiagram id="bpmndiagram_pattern21structuredloop"> <bpmndi:bpmnplane bpmnelement="pattern21structuredloop" id="bpmnplane_pattern21structuredloop"> 162

Appendix E: XML implementation of the supported patterns <bpmndi:bpmnshape bpmnelement="startevent1" id="bpmnshape_startevent1"> <omgdc:bounds height="35" width="35" x="35" y="50"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="usertask1" id="bpmnshape_usertask1"> <omgdc:bounds height="55" width="105" x="230" y="40"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="exclusivegateway1" id="bpmnshape_exclusivegateway1"> <omgdc:bounds height="40" width="40" x="660" y="47"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="usertask2" id="bpmnshape_usertask2"> <omgdc:bounds height="55" width="105" x="415" y="140"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="exclusivegateway2" id="bpmnshape_exclusivegateway2"> <omgdc:bounds height="40" width="40" x="145" y="47"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="usertask4" id="bpmnshape_usertask4"> <omgdc:bounds height="55" width="105" x="745" y="40"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="endevent1" id="bpmnshape_endevent1"> <omgdc:bounds height="35" width="35" x="905" y="50"></omgdc:bounds> <bpmndi:bpmnedge bpmnelement="flow2" id="bpmnedge_flow2"> <omgdi:waypoint x="335" y="67"></omgdi:waypoint> <omgdi:waypoint x="660" y="67"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow3" id="bpmnedge_flow3"> <omgdi:waypoint x="680" y="87"></omgdi:waypoint> <omgdi:waypoint x="680" y="167"></omgdi:waypoint> <omgdi:waypoint x="520" y="167"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow5" id="bpmnedge_flow5"> <omgdi:waypoint x="70" y="67"></omgdi:waypoint> <omgdi:waypoint x="145" y="67"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow6" id="bpmnedge_flow6"> <omgdi:waypoint x="185" y="67"></omgdi:waypoint> <omgdi:waypoint x="230" y="67"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow8" id="bpmnedge_flow8"> <omgdi:waypoint x="700" y="67"></omgdi:waypoint> <omgdi:waypoint x="745" y="67"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow9" id="bpmnedge_flow9"> <omgdi:waypoint x="850" y="67"></omgdi:waypoint> <omgdi:waypoint x="905" y="67"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow10" id="bpmnedge_flow10"> <omgdi:waypoint x="415" y="167"></omgdi:waypoint> 163

Appendix E: XML implementation of the supported patterns <omgdi:waypoint x="165" y="167"></omgdi:waypoint> <omgdi:waypoint x="165" y="87"></omgdi:waypoint> </bpmndi:bpmnplane> </bpmndi:bpmndiagram> </definitions> Pattern 21 - Structured Loop (pre-test) <?xml version="1.0" encoding="utf-8"?> <definitions xmlns="http://www.omg.org/spec/bpmn/20100524/model" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/bpmn/20100524/di" xmlns:omgdc="http://www.omg.org/spec/dd/20100524/dc" xmlns:omgdi="http://www.omg.org/spec/dd/20100524/di" typelanguage="http://www.w3.org/2001/xmlschema" expressionlanguage="http://www.w3.org/1999/xpath" targetnamespace="http://www.activiti.org/patterns"> <process id="pattern21structuredloop2" name="pattern 21 Structured Loop 2"> <documentation>implementation of Pattern 21 Structured Loop 2</documentation> <startevent id="startevent1" name="start" activiti:initiator="initiator"></startevent> <exclusivegateway id="exclusivegateway1" name="exclusive Gateway"></exclusiveGateway> <usertask id="usertask1" name="loop Task 1" activiti:assignee="${initiator"></usertask> <sequenceflow id="flow2" name="" sourceref="exclusivegateway1" targetref="usertask1"></sequenceflow> <usertask id="usertask2" name="repeat" activiti:assignee="${initiator"> <extensionelements> <activiti:formproperty id="repeat" name="repeat" type="boolean" required="true" readable="true" writable="true"></activiti:formproperty> </extensionelements> </usertask> <sequenceflow id="flow3" name="" sourceref="usertask1" targetref="usertask2"></sequenceflow> <exclusivegateway id="exclusivegateway2" name="exclusive Gateway"></exclusiveGateway> <sequenceflow id="flow4" name="" sourceref="usertask2" targetref="exclusivegateway2"></sequenceflow> <sequenceflow id="flow5" name="" sourceref="exclusivegateway2" targetref="exclusivegateway1"> <conditionexpression xsi:type="tformalexpression"><![cdata[${repeat]]></conditionexpression> </sequenceflow> <usertask id="usertask3" name="end Task" activiti:assignee="${initiator"></usertask> <sequenceflow id="flow6" name="" sourceref="exclusivegateway2" targetref="usertask3"> <conditionexpression xsi:type="tformalexpression"><![cdata[${!repeat]]></conditionexpression> </sequenceflow> <endevent id="endevent1" name="end"></endevent> <sequenceflow id="flow7" name="" sourceref="usertask3" targetref="endevent1"></sequenceflow> 164

Appendix E: XML implementation of the supported patterns <usertask id="usertask4" name="start Task" activiti:assignee="${initiator"></usertask> <sequenceflow id="flow8" name="" sourceref="startevent1" targetref="usertask4"></sequenceflow> <sequenceflow id="flow9" name="" sourceref="usertask4" targetref="exclusivegateway1"></sequenceflow> </process> <bpmndi:bpmndiagram id="bpmndiagram_pattern21structuredloop2"> <bpmndi:bpmnplane bpmnelement="pattern21structuredloop2" id="bpmnplane_pattern21structuredloop2"> <bpmndi:bpmnshape bpmnelement="startevent1" id="bpmnshape_startevent1"> <omgdc:bounds height="35" width="35" x="40" y="50"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="exclusivegateway1" id="bpmnshape_exclusivegateway1"> <omgdc:bounds height="40" width="40" x="271" y="47"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="usertask1" id="bpmnshape_usertask1"> <omgdc:bounds height="55" width="105" x="356" y="40"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="usertask2" id="bpmnshape_usertask2"> <omgdc:bounds height="55" width="105" x="521" y="40"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="exclusivegateway2" id="bpmnshape_exclusivegateway2"> <omgdc:bounds height="40" width="40" x="676" y="47"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="usertask3" id="bpmnshape_usertask3"> <omgdc:bounds height="55" width="105" x="761" y="40"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="endevent1" id="bpmnshape_endevent1"> <omgdc:bounds height="35" width="35" x="931" y="50"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="usertask4" id="bpmnshape_usertask4"> <omgdc:bounds height="55" width="105" x="120" y="40"></omgdc:bounds> <bpmndi:bpmnedge bpmnelement="flow2" id="bpmnedge_flow2"> <omgdi:waypoint x="311" y="67"></omgdi:waypoint> <omgdi:waypoint x="356" y="67"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow3" id="bpmnedge_flow3"> <omgdi:waypoint x="461" y="67"></omgdi:waypoint> <omgdi:waypoint x="521" y="67"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow4" id="bpmnedge_flow4"> <omgdi:waypoint x="626" y="67"></omgdi:waypoint> <omgdi:waypoint x="676" y="67"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow5" id="bpmnedge_flow5"> <omgdi:waypoint x="696" y="87"></omgdi:waypoint> <omgdi:waypoint x="696" y="154"></omgdi:waypoint> 165

Appendix E: XML implementation of the supported patterns <omgdi:waypoint x="487" y="154"></omgdi:waypoint> <omgdi:waypoint x="291" y="154"></omgdi:waypoint> <omgdi:waypoint x="291" y="87"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow6" id="bpmnedge_flow6"> <omgdi:waypoint x="716" y="67"></omgdi:waypoint> <omgdi:waypoint x="761" y="67"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow7" id="bpmnedge_flow7"> <omgdi:waypoint x="866" y="67"></omgdi:waypoint> <omgdi:waypoint x="931" y="67"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow8" id="bpmnedge_flow8"> <omgdi:waypoint x="75" y="67"></omgdi:waypoint> <omgdi:waypoint x="120" y="67"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow9" id="bpmnedge_flow9"> <omgdi:waypoint x="225" y="67"></omgdi:waypoint> <omgdi:waypoint x="271" y="67"></omgdi:waypoint> </bpmndi:bpmnplane> </bpmndi:bpmndiagram> </definitions> Pattern 25 - Cancel Region <?xml version="1.0" encoding="utf-8"?> <definitions xmlns="http://www.omg.org/spec/bpmn/20100524/model" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/bpmn/20100524/di" xmlns:omgdc="http://www.omg.org/spec/dd/20100524/dc" xmlns:omgdi="http://www.omg.org/spec/dd/20100524/di" typelanguage="http://www.w3.org/2001/xmlschema" expressionlanguage="http://www.w3.org/1999/xpath" targetnamespace="http://www.activiti.org/patterns"> <process id="pattern25cancelregion" name="pattern 25 Cancel Region"> <documentation>implementation of Pattern 25 Cancel Region</documentation> <startevent id="startevent1" name="start" activiti:initiator="initiator"></startevent> <usertask id="usertask1" name="start Task" activiti:assignee="${initiator"></usertask> <subprocess id="subprocess1" name="sub Process"> <startevent id="startevent2" name="start" activiti:initiator="initiator"></startevent> <usertask id="usertask2" name="sub Task 1" activiti:assignee="${initiator"> <extensionelements> <activiti:formproperty id="cancel" name="cancel" type="boolean" required="true" readable="true" writable="true"></activiti:formproperty> </extensionelements> </usertask> <usertask id="usertask3" name="sub Task 2" activiti:assignee="${initiator"> 166

Appendix E: XML implementation of the supported patterns <extensionelements> <activiti:formproperty id="cancel" name="cancel" type="boolean" variable="cancel" required="true" readable="true" writable="true"></activiti:formproperty> </extensionelements> </usertask> <endevent id="endevent1" name="end"></endevent> <exclusivegateway id="exclusivegateway1" name="exclusive Gateway"></exclusiveGateway> <exclusivegateway id="exclusivegateway2" name="exclusive Gateway"></exclusiveGateway> <endevent id="endevent2" name="errorend"> <erroreventdefinition errorref="cancelerror"></erroreventdefinition> </endevent> <endevent id="endevent3" name="errorend"> <erroreventdefinition errorref="cancelerror"></erroreventdefinition> </endevent> <parallelgateway id="parallelgateway1" name="parallel Gateway"></parallelGateway> <usertask id="usertask5" name="parallel Sub Task" activiti:assignee="${initiator"> <extensionelements> <activiti:formproperty id="cancel2" name="cancel" type="boolean" required="true" readable="true" writable="true"></activiti:formproperty> </extensionelements> </usertask> <exclusivegateway id="exclusivegateway3" name="exclusive Gateway"></exclusiveGateway> <endevent id="endevent6" name="end"></endevent> <endevent id="endevent7" name="errorend"> <erroreventdefinition errorref="cancelerror"></erroreventdefinition> </endevent> <sequenceflow id="flow6" name="" sourceref="usertask2" targetref="exclusivegateway1"></sequenceflow> <sequenceflow id="flow7" name="" sourceref="exclusivegateway1" targetref="usertask3"> <conditionexpression xsi:type="tformalexpression"><![cdata[${!cancel]]></conditionexpression> </sequenceflow> <sequenceflow id="flow8" name="" sourceref="usertask3" targetref="exclusivegateway2"></sequenceflow> <sequenceflow id="flow9" name="" sourceref="exclusivegateway2" targetref="endevent1"> <conditionexpression xsi:type="tformalexpression"><![cdata[${!cancel]]></conditionexpression> </sequenceflow> <sequenceflow id="flow10" name="" sourceref="exclusivegateway2" targetref="endevent2"> <conditionexpression xsi:type="tformalexpression"><![cdata[${cancel]]></conditionexpression> </sequenceflow> <sequenceflow id="flow11" name="" sourceref="exclusivegateway1" targetref="endevent3"> <conditionexpression xsi:type="tformalexpression"><![cdata[${cancel]]></conditionexpression> 167

Appendix E: XML implementation of the supported patterns </sequenceflow> <sequenceflow id="flow15" name="" sourceref="startevent2" targetref="parallelgateway1"></sequenceflow> <sequenceflow id="flow16" name="" sourceref="parallelgateway1" targetref="usertask2"></sequenceflow> <sequenceflow id="flow17" name="" sourceref="parallelgateway1" targetref="usertask5"></sequenceflow> <sequenceflow id="flow18" name="" sourceref="usertask5" targetref="exclusivegateway3"></sequenceflow> <sequenceflow id="flow19" name="" sourceref="exclusivegateway3" targetref="endevent6"> <conditionexpression xsi:type="tformalexpression"><![cdata[${!cancel2]]></conditionexpression> </sequenceflow> <sequenceflow id="flow20" name="" sourceref="exclusivegateway3" targetref="endevent7"> <conditionexpression xsi:type="tformalexpression"><![cdata[${cancel2]]></conditionexpression> </sequenceflow> </subprocess> <boundaryevent id="boundaryerror1" name="" cancelactivity="true" attachedtoref="subprocess1"> <erroreventdefinition errorref="cancelerror"></erroreventdefinition> </boundaryevent> <usertask id="usertask4" name="end Task" activiti:assignee="${initiator"></usertask> <endevent id="endevent4" name="end"></endevent> <endevent id="endevent5" name="end"></endevent> <sequenceflow id="flow1" name="" sourceref="startevent1" targetref="usertask1"></sequenceflow> <sequenceflow id="flow2" name="" sourceref="usertask1" targetref="subprocess1"></sequenceflow> <sequenceflow id="flow12" name="" sourceref="subprocess1" targetref="usertask4"></sequenceflow> <sequenceflow id="flow13" name="" sourceref="usertask4" targetref="endevent4"></sequenceflow> <sequenceflow id="flow14" name="" sourceref="boundaryerror1" targetref="endevent5"></sequenceflow> </process> <bpmndi:bpmndiagram id="bpmndiagram_pattern25cancelregion"> <bpmndi:bpmnplane bpmnelement="pattern25cancelregion" id="bpmnplane_pattern25cancelregion"> <bpmndi:bpmnshape bpmnelement="startevent1" id="bpmnshape_startevent1"> <omgdc:bounds height="35" width="35" x="20" y="165"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="usertask1" id="bpmnshape_usertask1"> <omgdc:bounds height="55" width="105" x="90" y="155"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="subprocess1" id="bpmnshape_subprocess1" isexpanded="true"> <omgdc:bounds height="326" width="751" x="230" y="20"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="startevent2" id="bpmnshape_startevent2"> <omgdc:bounds height="35" width="35" x="250" y="165"></omgdc:bounds> 168

Appendix E: XML implementation of the supported patterns <bpmndi:bpmnshape bpmnelement="usertask2" id="bpmnshape_usertask2"> <omgdc:bounds height="55" width="105" x="450" y="53"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="usertask3" id="bpmnshape_usertask3"> <omgdc:bounds height="55" width="105" x="690" y="53"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="endevent1" id="bpmnshape_endevent1"> <omgdc:bounds height="35" width="35" x="920" y="63"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="exclusivegateway1" id="bpmnshape_exclusivegateway1"> <omgdc:bounds height="40" width="40" x="600" y="60"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="exclusivegateway2" id="bpmnshape_exclusivegateway2"> <omgdc:bounds height="40" width="40" x="840" y="60"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="endevent2" id="bpmnshape_endevent2"> <omgdc:bounds height="35" width="35" x="843" y="145"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="endevent3" id="bpmnshape_endevent3"> <omgdc:bounds height="35" width="35" x="603" y="145"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="parallelgateway1" id="bpmnshape_parallelgateway1"> <omgdc:bounds height="40" width="40" x="330" y="162"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="usertask5" id="bpmnshape_usertask5"> <omgdc:bounds height="55" width="105" x="450" y="255"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="exclusivegateway3" id="bpmnshape_exclusivegateway3"> <omgdc:bounds height="40" width="40" x="610" y="262"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="endevent6" id="bpmnshape_endevent6"> <omgdc:bounds height="35" width="35" x="695" y="302"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="endevent7" id="bpmnshape_endevent7"> <omgdc:bounds height="35" width="35" x="695" y="228"></omgdc:bounds> <bpmndi:bpmnedge bpmnelement="flow6" id="bpmnedge_flow6"> <omgdi:waypoint x="555" y="80"></omgdi:waypoint> <omgdi:waypoint x="600" y="80"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow7" id="bpmnedge_flow7"> <omgdi:waypoint x="640" y="80"></omgdi:waypoint> <omgdi:waypoint x="690" y="80"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow8" id="bpmnedge_flow8"> 169

Appendix E: XML implementation of the supported patterns <omgdi:waypoint x="795" y="80"></omgdi:waypoint> <omgdi:waypoint x="840" y="80"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow9" id="bpmnedge_flow9"> <omgdi:waypoint x="880" y="80"></omgdi:waypoint> <omgdi:waypoint x="920" y="80"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow10" id="bpmnedge_flow10"> <omgdi:waypoint x="860" y="100"></omgdi:waypoint> <omgdi:waypoint x="860" y="145"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow11" id="bpmnedge_flow11"> <omgdi:waypoint x="620" y="100"></omgdi:waypoint> <omgdi:waypoint x="620" y="145"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow15" id="bpmnedge_flow15"> <omgdi:waypoint x="285" y="182"></omgdi:waypoint> <omgdi:waypoint x="330" y="182"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow16" id="bpmnedge_flow16"> <omgdi:waypoint x="350" y="162"></omgdi:waypoint> <omgdi:waypoint x="350" y="80"></omgdi:waypoint> <omgdi:waypoint x="450" y="80"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow17" id="bpmnedge_flow17"> <omgdi:waypoint x="350" y="202"></omgdi:waypoint> <omgdi:waypoint x="350" y="282"></omgdi:waypoint> <omgdi:waypoint x="450" y="282"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow18" id="bpmnedge_flow18"> <omgdi:waypoint x="555" y="282"></omgdi:waypoint> <omgdi:waypoint x="610" y="282"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow19" id="bpmnedge_flow19"> <omgdi:waypoint x="630" y="302"></omgdi:waypoint> <omgdi:waypoint x="631" y="319"></omgdi:waypoint> <omgdi:waypoint x="695" y="319"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow20" id="bpmnedge_flow20"> <omgdi:waypoint x="630" y="262"></omgdi:waypoint> <omgdi:waypoint x="631" y="245"></omgdi:waypoint> <omgdi:waypoint x="695" y="245"></omgdi:waypoint> <bpmndi:bpmnshape bpmnelement="boundaryerror1" id="bpmnshape_boundaryerror1"> <omgdc:bounds height="30" width="30" x="943" y="330"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="usertask4" id="bpmnshape_usertask4"> <omgdc:bounds height="55" width="105" x="1032" y="155"></omgdc:bounds> 170

Appendix E: XML implementation of the supported patterns <bpmndi:bpmnshape bpmnelement="endevent4" id="bpmnshape_endevent4"> <omgdc:bounds height="35" width="35" x="1171" y="165"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="endevent5" id="bpmnshape_endevent5"> <omgdc:bounds height="35" width="35" x="940" y="405"></omgdc:bounds> <bpmndi:bpmnedge bpmnelement="flow1" id="bpmnedge_flow1"> <omgdi:waypoint x="55" y="182"></omgdi:waypoint> <omgdi:waypoint x="90" y="182"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow2" id="bpmnedge_flow2"> <omgdi:waypoint x="195" y="182"></omgdi:waypoint> <omgdi:waypoint x="230" y="183"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow12" id="bpmnedge_flow12"> <omgdi:waypoint x="981" y="183"></omgdi:waypoint> <omgdi:waypoint x="1032" y="182"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow13" id="bpmnedge_flow13"> <omgdi:waypoint x="1137" y="182"></omgdi:waypoint> <omgdi:waypoint x="1171" y="182"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow14" id="bpmnedge_flow14"> <omgdi:waypoint x="958" y="360"></omgdi:waypoint> <omgdi:waypoint x="957" y="405"></omgdi:waypoint> </bpmndi:bpmnplane> </bpmndi:bpmndiagram> </definitions> Pattern 26 - Cancel Multiple Instance Activity <?xml version="1.0" encoding="utf-8"?> <definitions xmlns="http://www.omg.org/spec/bpmn/20100524/model" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/bpmn/20100524/di" xmlns:omgdc="http://www.omg.org/spec/dd/20100524/dc" xmlns:omgdi="http://www.omg.org/spec/dd/20100524/di" typelanguage="http://www.w3.org/2001/xmlschema" expressionlanguage="http://www.w3.org/1999/xpath" targetnamespace="http://www.activiti.org/patterns"> <process id="pattern26cancelmultipleinstancetask" name="pattern 26 Cancel Multiple Instance Task"> <documentation>implementation of Pattern 26 Cancel Multiple Instance Task</documentation> <startevent id="startevent1" name="start" activiti:initiator="initiator"></startevent> <usertask id="usertask1" name="start Task" activiti:assignee="${initiator"></usertask> <usertask id="usertask3" name="end Task" activiti:assignee="${initiator"></usertask> <endevent id="endevent1" name="end"></endevent> <subprocess id="subprocess1" name="sub Process"> <multiinstanceloopcharacteristics issequential="false"> 171

Appendix E: XML implementation of the supported patterns <loopcardinality>3</loopcardinality> </multiinstanceloopcharacteristics> <startevent id="startevent2" name="start" activiti:initiator="initiator"></startevent> <usertask id="usertask4" name="user Task" activiti:assignee="${initiator"> <extensionelements> <activiti:formproperty id="cancel" name="cancel" type="boolean" required="true" readable="true" writable="true"></activiti:formproperty> </extensionelements> </usertask> <exclusivegateway id="exclusivegateway1" name="exclusive Gateway"></exclusiveGateway> <endevent id="endevent2" name="end"></endevent> <endevent id="endevent3" name="errorend"> <erroreventdefinition errorref="cancelerror"></erroreventdefinition> </endevent> <sequenceflow id="flow5" name="" sourceref="startevent2" targetref="usertask4"></sequenceflow> <sequenceflow id="flow6" name="" sourceref="usertask4" targetref="exclusivegateway1"></sequenceflow> <sequenceflow id="flow7" name="" sourceref="exclusivegateway1" targetref="endevent2"> <conditionexpression xsi:type="tformalexpression"><![cdata[${!cancel]]></conditionexpression> </sequenceflow> <sequenceflow id="flow8" name="" sourceref="exclusivegateway1" targetref="endevent3"> <conditionexpression xsi:type="tformalexpression"><![cdata[${cancel]]></conditionexpression> </sequenceflow> </subprocess> <boundaryevent id="boundaryerror1" name="" cancelactivity="true" attachedtoref="subprocess1"> <erroreventdefinition errorref="cancelerror"></erroreventdefinition> </boundaryevent> <endevent id="endevent4" name="end"></endevent> <sequenceflow id="flow1" name="" sourceref="startevent1" targetref="usertask1"></sequenceflow> <sequenceflow id="flow4" name="" sourceref="usertask3" targetref="endevent1"></sequenceflow> <sequenceflow id="flow10" name="" sourceref="usertask1" targetref="subprocess1"></sequenceflow> <sequenceflow id="flow14" name="" sourceref="boundaryerror1" targetref="endevent4"></sequenceflow> <sequenceflow id="flow15" name="" sourceref="subprocess1" targetref="usertask3"></sequenceflow> </process> <bpmndi:bpmndiagram id="bpmndiagram_pattern26cancelmultipleinstancetask"> <bpmndi:bpmnplane bpmnelement="pattern26cancelmultipleinstancetask" id="bpmnplane_pattern26cancelmultipleinstancetask"> <bpmndi:bpmnshape bpmnelement="startevent1" id="bpmnshape_startevent1"> <omgdc:bounds height="35" width="35" x="50" y="130"></omgdc:bounds> 172

Appendix E: XML implementation of the supported patterns <bpmndi:bpmnshape bpmnelement="usertask1" id="bpmnshape_usertask1"> <omgdc:bounds height="55" width="105" x="130" y="120"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="usertask3" id="bpmnshape_usertask3"> <omgdc:bounds height="55" width="105" x="755" y="120"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="endevent1" id="bpmnshape_endevent1"> <omgdc:bounds height="35" width="35" x="895" y="130"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="subprocess1" id="bpmnshape_subprocess1" isexpanded="true"> <omgdc:bounds height="205" width="421" x="280" y="45"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="startevent2" id="bpmnshape_startevent2"> <omgdc:bounds height="35" width="35" x="305" y="101"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="usertask4" id="bpmnshape_usertask4"> <omgdc:bounds height="55" width="105" x="390" y="91"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="exclusivegateway1" id="bpmnshape_exclusivegateway1"> <omgdc:bounds height="40" width="40" x="545" y="98"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="endevent2" id="bpmnshape_endevent2"> <omgdc:bounds height="35" width="35" x="630" y="101"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="endevent3" id="bpmnshape_endevent3"> <omgdc:bounds height="35" width="35" x="548" y="169"></omgdc:bounds> <bpmndi:bpmnedge bpmnelement="flow5" id="bpmnedge_flow5"> <omgdi:waypoint x="340" y="118"></omgdi:waypoint> <omgdi:waypoint x="390" y="118"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow6" id="bpmnedge_flow6"> <omgdi:waypoint x="495" y="118"></omgdi:waypoint> <omgdi:waypoint x="545" y="118"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow7" id="bpmnedge_flow7"> <omgdi:waypoint x="585" y="118"></omgdi:waypoint> <omgdi:waypoint x="630" y="118"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow8" id="bpmnedge_flow8"> <omgdi:waypoint x="565" y="138"></omgdi:waypoint> <omgdi:waypoint x="565" y="169"></omgdi:waypoint> <bpmndi:bpmnshape bpmnelement="boundaryerror1" id="bpmnshape_boundaryerror1"> <omgdc:bounds height="30" width="30" x="658" y="232"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="endevent4" id="bpmnshape_endevent4"> 173

Appendix E: XML implementation of the supported patterns <omgdc:bounds height="35" width="35" x="655" y="302"></omgdc:bounds> <bpmndi:bpmnedge bpmnelement="flow1" id="bpmnedge_flow1"> <omgdi:waypoint x="85" y="147"></omgdi:waypoint> <omgdi:waypoint x="130" y="147"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow4" id="bpmnedge_flow4"> <omgdi:waypoint x="860" y="147"></omgdi:waypoint> <omgdi:waypoint x="895" y="147"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow10" id="bpmnedge_flow10"> <omgdi:waypoint x="235" y="147"></omgdi:waypoint> <omgdi:waypoint x="280" y="147"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow14" id="bpmnedge_flow14"> <omgdi:waypoint x="673" y="262"></omgdi:waypoint> <omgdi:waypoint x="672" y="302"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow15" id="bpmnedge_flow15"> <omgdi:waypoint x="701" y="147"></omgdi:waypoint> <omgdi:waypoint x="755" y="147"></omgdi:waypoint> </bpmndi:bpmnplane> </bpmndi:bpmndiagram> </definitions> Pattern 27 - Complete Multiple Instance Activity (Boundary event) <?xml version="1.0" encoding="utf-8"?> <definitions xmlns="http://www.omg.org/spec/bpmn/20100524/model" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/bpmn/20100524/di" xmlns:omgdc="http://www.omg.org/spec/dd/20100524/dc" xmlns:omgdi="http://www.omg.org/spec/dd/20100524/di" typelanguage="http://www.w3.org/2001/xmlschema" expressionlanguage="http://www.w3.org/1999/xpath" targetnamespace="http://www.activiti.org/patterns"> <process id="pattern27completemultipleinstancetask" name="pattern 27 Complete Multiple Instance Task"> <documentation>implementation of Pattern 27 Complete Multiple Instance Task</documentation> <startevent id="startevent1" name="start" activiti:initiator="initiator"></startevent> <usertask id="usertask1" name="start Task" activiti:assignee="${initiator"></usertask> <usertask id="usertask2" name="multiple Task" activiti:assignee="${initiator"> <multiinstanceloopcharacteristics issequential="false"> <loopcardinality>5</loopcardinality> <completioncondition>${nrofactiveinstances == 0</completionCondition> </multiinstanceloopcharacteristics> 174

Appendix E: XML implementation of the supported patterns </usertask> <boundaryevent id="boundarytimer1" name="" cancelactivity="true" attachedtoref="usertask2"> <timereventdefinition> <timeduration>pt1m</timeduration> </timereventdefinition> </boundaryevent> <usertask id="usertask3" name="end Task" activiti:assignee="${initiator"></usertask> <endevent id="endevent1" name="end"></endevent> <exclusivegateway id="exclusivegateway1" name="exclusive Gateway"></exclusiveGateway> <sequenceflow id="flow1" name="" sourceref="startevent1" targetref="usertask1"></sequenceflow> <sequenceflow id="flow2" name="" sourceref="usertask1" targetref="usertask2"></sequenceflow> <sequenceflow id="flow4" name="" sourceref="usertask3" targetref="endevent1"></sequenceflow> <sequenceflow id="flow5" name="" sourceref="usertask2" targetref="exclusivegateway1"></sequenceflow> <sequenceflow id="flow6" name="" sourceref="exclusivegateway1" targetref="usertask3"></sequenceflow> <sequenceflow id="flow7" name="" sourceref="boundarytimer1" targetref="exclusivegateway1"></sequenceflow> </process> <bpmndi:bpmndiagram id="bpmndiagram_pattern27completemultipleinstancetask"> <bpmndi:bpmnplane bpmnelement="pattern27completemultipleinstancetask" id="bpmnplane_pattern27completemultipleinstancetask"> <bpmndi:bpmnshape bpmnelement="startevent1" id="bpmnshape_startevent1"> <omgdc:bounds height="35" width="35" x="190" y="190"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="usertask1" id="bpmnshape_usertask1"> <omgdc:bounds height="55" width="105" x="280" y="180"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="usertask2" id="bpmnshape_usertask2"> <omgdc:bounds height="55" width="105" x="430" y="180"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="boundarytimer1" id="bpmnshape_boundarytimer1"> <omgdc:bounds height="30" width="30" x="505" y="224"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="usertask3" id="bpmnshape_usertask3"> <omgdc:bounds height="55" width="105" x="680" y="180"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="endevent1" id="bpmnshape_endevent1"> <omgdc:bounds height="35" width="35" x="840" y="190"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="exclusivegateway1" id="bpmnshape_exclusivegateway1"> <omgdc:bounds height="40" width="40" x="590" y="187"></omgdc:bounds> <bpmndi:bpmnedge bpmnelement="flow1" id="bpmnedge_flow1"> <omgdi:waypoint x="225" y="207"></omgdi:waypoint> 175

Appendix E: XML implementation of the supported patterns <omgdi:waypoint x="280" y="207"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow2" id="bpmnedge_flow2"> <omgdi:waypoint x="385" y="207"></omgdi:waypoint> <omgdi:waypoint x="430" y="207"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow4" id="bpmnedge_flow4"> <omgdi:waypoint x="785" y="207"></omgdi:waypoint> <omgdi:waypoint x="840" y="207"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow5" id="bpmnedge_flow5"> <omgdi:waypoint x="535" y="207"></omgdi:waypoint> <omgdi:waypoint x="590" y="207"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow6" id="bpmnedge_flow6"> <omgdi:waypoint x="630" y="207"></omgdi:waypoint> <omgdi:waypoint x="680" y="207"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow7" id="bpmnedge_flow7"> <omgdi:waypoint x="520" y="254"></omgdi:waypoint> <omgdi:waypoint x="519" y="277"></omgdi:waypoint> <omgdi:waypoint x="610" y="277"></omgdi:waypoint> <omgdi:waypoint x="610" y="239"></omgdi:waypoint> <omgdi:waypoint x="610" y="227"></omgdi:waypoint> </bpmndi:bpmnplane> </bpmndi:bpmndiagram> </definitions> Pattern 27 - Complete Multiple Instance Activity (completion condition) <?xml version="1.0" encoding="utf-8"?> <definitions xmlns="http://www.omg.org/spec/bpmn/20100524/model" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/bpmn/20100524/di" xmlns:omgdc="http://www.omg.org/spec/dd/20100524/dc" xmlns:omgdi="http://www.omg.org/spec/dd/20100524/di" typelanguage="http://www.w3.org/2001/xmlschema" expressionlanguage="http://www.w3.org/1999/xpath" targetnamespace="http://www.activiti.org/patterns"> <process id="pattern27completemultipleinstancetask2" name="pattern 27 Complete Multiple Instance Task 2"> 2 <documentation>implementation of Pattern 27 Complete Multiple Instance Task </documentation> <startevent id="startevent1" name="start" activiti:initiator="initiator"></startevent> <usertask id="usertask1" name="start Task" activiti:assignee="${initiator"></usertask> <usertask id="usertask2" name="multiple Task" activiti:assignee="${initiator"> 176

Appendix E: XML implementation of the supported patterns <extensionelements> <activiti:formproperty id="cancel" name="cancel" type="boolean" required="true" readable="true" writable="true"></activiti:formproperty> </extensionelements> <multiinstanceloopcharacteristics issequential="false"> <loopcardinality>5</loopcardinality> <completioncondition>${cancel nrofactiveinstances == 0</completionCondition> </multiinstanceloopcharacteristics> </usertask> <usertask id="usertask3" name="end Task" activiti:assignee="${initiator"></usertask> <endevent id="endevent1" name="end"></endevent> <sequenceflow id="flow1" name="" sourceref="startevent1" targetref="usertask1"></sequenceflow> <sequenceflow id="flow2" name="" sourceref="usertask1" targetref="usertask2"></sequenceflow> <sequenceflow id="flow3" name="" sourceref="usertask2" targetref="usertask3"></sequenceflow> <sequenceflow id="flow4" name="" sourceref="usertask3" targetref="endevent1"></sequenceflow> </process> <bpmndi:bpmndiagram id="bpmndiagram_pattern27completemultipleinstancetask2"> <bpmndi:bpmnplane bpmnelement="pattern27completemultipleinstancetask2" id="bpmnplane_pattern27completemultipleinstancetask2"> <bpmndi:bpmnshape bpmnelement="startevent1" id="bpmnshape_startevent1"> <omgdc:bounds height="35" width="35" x="30" y="50"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="usertask1" id="bpmnshape_usertask1"> <omgdc:bounds height="55" width="105" x="110" y="40"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="usertask2" id="bpmnshape_usertask2"> <omgdc:bounds height="55" width="105" x="270" y="40"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="usertask3" id="bpmnshape_usertask3"> <omgdc:bounds height="55" width="105" x="430" y="40"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="endevent1" id="bpmnshape_endevent1"> <omgdc:bounds height="35" width="35" x="590" y="50"></omgdc:bounds> <bpmndi:bpmnedge bpmnelement="flow1" id="bpmnedge_flow1"> <omgdi:waypoint x="65" y="67"></omgdi:waypoint> <omgdi:waypoint x="110" y="67"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow2" id="bpmnedge_flow2"> <omgdi:waypoint x="215" y="67"></omgdi:waypoint> <omgdi:waypoint x="270" y="67"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow3" id="bpmnedge_flow3"> <omgdi:waypoint x="375" y="67"></omgdi:waypoint> <omgdi:waypoint x="430" y="67"></omgdi:waypoint> 177

Appendix E: XML implementation of the supported patterns <bpmndi:bpmnedge bpmnelement="flow4" id="bpmnedge_flow4"> <omgdi:waypoint x="535" y="67"></omgdi:waypoint> <omgdi:waypoint x="590" y="67"></omgdi:waypoint> </bpmndi:bpmnplane> </bpmndi:bpmndiagram> </definitions> Pattern 29 - Cancelling Discriminator <?xml version="1.0" encoding="utf-8"?> <definitions xmlns="http://www.omg.org/spec/bpmn/20100524/model" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/bpmn/20100524/di" xmlns:omgdc="http://www.omg.org/spec/dd/20100524/dc" xmlns:omgdi="http://www.omg.org/spec/dd/20100524/di" typelanguage="http://www.w3.org/2001/xmlschema" expressionlanguage="http://www.w3.org/1999/xpath" targetnamespace="http://www.activiti.org/patterns"> <process id="pattern29cancellingdiscriminator" name="pattern 29 Cancelling Discriminator"> <documentation>implementation of Pattern 29 Cancelling Discriminator</documentation> <startevent id="startevent1" name="start" activiti:initiator="initiator"></startevent> <subprocess id="subprocess1" name="sub Process"> <usertask id="usertask1" name="task 1" activiti:assignee="${initiator"></usertask> <startevent id="startevent2" name="start" activiti:initiator="initiator"></startevent> <sequenceflow id="flow2" name="" sourceref="startevent2" targetref="parallelgateway1"></sequenceflow> <parallelgateway id="parallelgateway1" name="parallel Gateway"></parallelGateway> <sequenceflow id="flow3" name="" sourceref="parallelgateway1" targetref="usertask1"></sequenceflow> <usertask id="usertask2" name="task 2" activiti:assignee="${initiator"></usertask> <sequenceflow id="flow4" name="" sourceref="parallelgateway1" targetref="usertask2"></sequenceflow> <exclusivegateway id="exclusivegateway1" name="exclusive Gateway"></exclusiveGateway> <sequenceflow id="flow5" name="" sourceref="usertask1" targetref="exclusivegateway1"></sequenceflow> <sequenceflow id="flow6" name="" sourceref="usertask2" targetref="exclusivegateway1"></sequenceflow> <endevent id="endevent1" name="errorend"> <erroreventdefinition errorref="continue"></erroreventdefinition> </endevent> <sequenceflow id="flow7" name="" sourceref="exclusivegateway1" targetref="endevent1"></sequenceflow> </subprocess> <boundaryevent id="boundaryerror1" attachedtoref="subprocess1"> <erroreventdefinition errorref="continue"></erroreventdefinition> </boundaryevent> <usertask id="usertask3" name="end Task" activiti:assignee="${initiator"></usertask> 178

Appendix E: XML implementation of the supported patterns <sequenceflow id="flow8" name="" sourceref="boundaryerror1" targetref="usertask3"></sequenceflow> <endevent id="endevent2" name="end"></endevent> <sequenceflow id="flow9" name="" sourceref="usertask3" targetref="endevent2"></sequenceflow> <usertask id="usertask4" name="start Task" activiti:assignee="${initiator"></usertask> <sequenceflow id="flow10" name="" sourceref="startevent1" targetref="usertask4"></sequenceflow> <sequenceflow id="flow11" name="" sourceref="usertask4" targetref="subprocess1"></sequenceflow> </process> <bpmndi:bpmndiagram id="bpmndiagram_pattern29cancellingdiscriminator"> <bpmndi:bpmnplane bpmnelement="pattern29cancellingdiscriminator" id="bpmnplane_pattern29cancellingdiscriminator"> <bpmndi:bpmnshape bpmnelement="startevent1" id="bpmnshape_startevent1"> <omgdc:bounds height="35" width="35" x="60" y="139"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="subprocess1" id="bpmnshape_subprocess1"> <omgdc:bounds height="211" width="520" x="300" y="52"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="usertask1" id="bpmnshape_usertask1"> <omgdc:bounds height="55" width="105" x="490" y="72"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="startevent2" id="bpmnshape_startevent2"> <omgdc:bounds height="35" width="35" x="320" y="139"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="parallelgateway1" id="bpmnshape_parallelgateway1"> <omgdc:bounds height="40" width="40" x="400" y="136"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="usertask2" id="bpmnshape_usertask2"> <omgdc:bounds height="55" width="105" x="490" y="192"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="exclusivegateway1" id="bpmnshape_exclusivegateway1"> <omgdc:bounds height="40" width="40" x="640" y="139"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="endevent1" id="bpmnshape_endevent1"> <omgdc:bounds height="35" width="35" x="730" y="142"></omgdc:bounds> <bpmndi:bpmnedge bpmnelement="flow2" id="bpmnedge_flow2"> <omgdi:waypoint x="355" y="156"></omgdi:waypoint> <omgdi:waypoint x="400" y="156"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow3" id="bpmnedge_flow3"> <omgdi:waypoint x="420" y="136"></omgdi:waypoint> <omgdi:waypoint x="420" y="99"></omgdi:waypoint> <omgdi:waypoint x="490" y="99"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow4" id="bpmnedge_flow4"> <omgdi:waypoint x="420" y="176"></omgdi:waypoint> 179

Appendix E: XML implementation of the supported patterns <omgdi:waypoint x="420" y="219"></omgdi:waypoint> <omgdi:waypoint x="490" y="219"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow5" id="bpmnedge_flow5"> <omgdi:waypoint x="595" y="99"></omgdi:waypoint> <omgdi:waypoint x="660" y="99"></omgdi:waypoint> <omgdi:waypoint x="660" y="139"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow6" id="bpmnedge_flow6"> <omgdi:waypoint x="595" y="219"></omgdi:waypoint> <omgdi:waypoint x="660" y="219"></omgdi:waypoint> <omgdi:waypoint x="660" y="179"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow7" id="bpmnedge_flow7"> <omgdi:waypoint x="680" y="159"></omgdi:waypoint> <omgdi:waypoint x="730" y="159"></omgdi:waypoint> <bpmndi:bpmnshape bpmnelement="boundaryerror1" id="bpmnshape_boundaryerror1"> <omgdc:bounds height="30" width="30" x="803" y="145"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="usertask3" id="bpmnshape_usertask3"> <omgdc:bounds height="55" width="105" x="880" y="132"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="endevent2" id="bpmnshape_endevent2"> <omgdc:bounds height="35" width="35" x="1030" y="142"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="usertask4" id="bpmnshape_usertask4"> <omgdc:bounds height="55" width="105" x="140" y="129"></omgdc:bounds> <bpmndi:bpmnedge bpmnelement="flow8" id="bpmnedge_flow8"> <omgdi:waypoint x="818" y="175"></omgdi:waypoint> <omgdi:waypoint x="880" y="159"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow9" id="bpmnedge_flow9"> <omgdi:waypoint x="985" y="159"></omgdi:waypoint> <omgdi:waypoint x="1030" y="159"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow10" id="bpmnedge_flow10"> <omgdi:waypoint x="95" y="156"></omgdi:waypoint> <omgdi:waypoint x="140" y="156"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow11" id="bpmnedge_flow11"> <omgdi:waypoint x="245" y="156"></omgdi:waypoint> <omgdi:waypoint x="300" y="157"></omgdi:waypoint> </bpmndi:bpmnplane> </bpmndi:bpmndiagram> </definitions> 180

Appendix E: XML implementation of the supported patterns Pattern 35 - Cancelling Partial Join for Multiple Instances <?xml version="1.0" encoding="utf-8"?> <definitions xmlns="http://www.omg.org/spec/bpmn/20100524/model" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/bpmn/20100524/di" xmlns:omgdc="http://www.omg.org/spec/dd/20100524/dc" xmlns:omgdi="http://www.omg.org/spec/dd/20100524/di" typelanguage="http://www.w3.org/2001/xmlschema" expressionlanguage="http://www.w3.org/1999/xpath" targetnamespace="http://www.activiti.org/patterns"> <process id="pattern35cancellingpartialjoinformultipleinstances" name="pattern 35 Cancelling Partial Join for Multiple Instances"> <documentation>implementation of Pattern 35 Cancelling Partial Join for Multiple Instances.</documentation> <startevent id="startevent1" name="start" activiti:initiator="initiator"></startevent> <usertask id="usertask1" name="start Task" activiti:assignee="${initiator"> <extensionelements> <activiti:formproperty id="nrinstances" name="nr of instances" type="long" required="true" readable="true" writable="true"></activiti:formproperty> <activiti:formproperty id="nrinstancestocomplete" name="nr of instances to complete" type="long" required="true" readable="true" writable="true"></activiti:formproperty> </extensionelements> </usertask> <usertask id="usertask2" name="multi Task" activiti:assignee="${initiator"> <multiinstanceloopcharacteristics issequential="false"> <loopcardinality>${nrinstances</loopcardinality> <completioncondition>${nrinstancestocomplete == nrofcompletedinstances</completioncondition> </multiinstanceloopcharacteristics> </usertask> <usertask id="usertask3" name="end Task" activiti:assignee="${initiator"></usertask> <endevent id="endevent1" name="end"></endevent> <sequenceflow id="flow1" name="" sourceref="startevent1" targetref="usertask1"></sequenceflow> <sequenceflow id="flow2" name="" sourceref="usertask1" targetref="usertask2"></sequenceflow> <sequenceflow id="flow3" name="" sourceref="usertask2" targetref="usertask3"></sequenceflow> <sequenceflow id="flow4" name="" sourceref="usertask3" targetref="endevent1"></sequenceflow> </process> <bpmndi:bpmndiagram id="bpmndiagram_pattern35cancellingpartialjoinformultipleinstances"> <bpmndi:bpmnplane bpmnelement="pattern35cancellingpartialjoinformultipleinstances" id="bpmnplane_pattern35cancellingpartialjoinformultipleinstances"> <bpmndi:bpmnshape bpmnelement="startevent1" id="bpmnshape_startevent1"> <omgdc:bounds height="35" width="35" x="70" y="80"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="usertask1" id="bpmnshape_usertask1"> <omgdc:bounds height="55" width="105" x="150" y="70"></omgdc:bounds> 181

Appendix E: XML implementation of the supported patterns <bpmndi:bpmnshape bpmnelement="usertask2" id="bpmnshape_usertask2"> <omgdc:bounds height="55" width="105" x="310" y="70"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="usertask3" id="bpmnshape_usertask3"> <omgdc:bounds height="55" width="105" x="470" y="70"></omgdc:bounds> <bpmndi:bpmnshape bpmnelement="endevent1" id="bpmnshape_endevent1"> <omgdc:bounds height="35" width="35" x="630" y="80"></omgdc:bounds> <bpmndi:bpmnedge bpmnelement="flow1" id="bpmnedge_flow1"> <omgdi:waypoint x="105" y="97"></omgdi:waypoint> <omgdi:waypoint x="150" y="97"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow2" id="bpmnedge_flow2"> <omgdi:waypoint x="255" y="97"></omgdi:waypoint> <omgdi:waypoint x="310" y="97"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow3" id="bpmnedge_flow3"> <omgdi:waypoint x="415" y="97"></omgdi:waypoint> <omgdi:waypoint x="470" y="97"></omgdi:waypoint> <bpmndi:bpmnedge bpmnelement="flow4" id="bpmnedge_flow4"> <omgdi:waypoint x="575" y="97"></omgdi:waypoint> <omgdi:waypoint x="630" y="97"></omgdi:waypoint> </bpmndi:bpmnplane> </bpmndi:bpmndiagram> </definitions> 182