Following new trends, as microservices architecture style and developer-friendly BPM solutions, we want to present our active open source projects using Grails
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
Introducing Workflow Architectures Using Grails - Greach 2015
1. 10th April 2015
Introducing Workflow
Architectures
USING GRAILS
Rubén Mondéjar
Diputació de Tarragona
Rubén Mondéjar
Diputació de Tarragona
2. About Me
twitter : @Ruuben4
homepage : http://deim.urv.cat/~ruben.mondejar
Working
● Groovy & Grails
● Dev-Friendly BPM
● ITIL v3 / ISO 20000
Teaching / Research
● Software Architectures
● Web Development
● Distributed Systems
[BPM RoundTable Tarragona]
3. Outline
(1) From BPM to Grails
(2) Dev-Friendly BPM
(3) Extending BPMS
(4) Injecting BPM
5. “Everything looks interesting until you do it.
Then you find it's just another job.”
Terry Pratchett
Moving Pictures
Discworld 10th Novel
Quote
6. Motivation
● Starting point: building software architectures
which involves business processes
● Applications perform the expected behaviour,
but implemented with different strategies
● For example, how to handle the data-flow or to
address integration
8. Processes
Collection of related events, activities, and
decisions, that involve a number of actors
and resources, and that collectively lead to an
outcome that is of value to an organization or
its customers
Dumas, La Rosa, Mendling, Reijers, 2013
9. Key Concepts
● BPM (Business Process Management) is
a discipline to automate organizational
processes
● BPMS (... System) is a software
architecture composed by different
components that allow to build and
integrate BPM and applications
● BPMN (... Notation) is a standard
collection of rules and graphical shapes
for drawing process models
BPM
BPMNBPMS
23. Solutions
1. Pure BPMN: designed from the ground up to
follow the spec to the letter
• jBPM, Activiti, Camunda
2. Adapted BPMN: use a BPMN skin but rely on
internal representation
• BonitaSoft, Bizagi, Intalio
3. Non BPMN: proprietary language and semantics
• BPMOne, YAWL, GrailsFlow
28. Dev-Friendly BPM
● Leaves behind the Zero-Code Myth
○ Previous and extended BPM solutions
○ Sandboxing of processes in a suite
● Fits with MicroService Architectures
○ Enable workflow execution into existing applications
○ Embedded or remote execution modes
31. Repository Service
● Naturally, it is the first service that we need
● Manages deployments and process definitions
(BPMN)
● It can also activate or suspend specific deployments
or process definitions
RepositoryService
RuntimeService ManagementService HistoryService
TaskService IdentityService FormService
Keywords: [BPMN] [Process Definition] [Deployment]
32. Runtime Service
● Deals with starting new process instances
● Starts a new process instance in the latest version of
its process definition
● Retrieves all the visible variables from the given
execution
RepositoryService
RuntimeService ManagementService HistoryService
TaskService IdentityService FormService
Keywords: [Versions] [Process Instance] [Variables]
33. Task Service
● Querying and modifying tasks assigned to the
participants : users or groups
● Claiming a task for a specific participant
● Saving or completing a task, typically after filling the
fields of a form
RepositoryService
RuntimeService ManagementService HistoryService
TaskService IdentityService FormService
Keywords: [Participants] [Claim] [Save] [Complete]
34. Management Service
● Allows metadata information retrieval
● Exposes query capabilities and management operations
for jobs
● Used by the engine to handle timers, asynchronous
continuations, or delayed suspension/activation
RepositoryService
RuntimeService ManagementService HistoryService
TaskService IdentityService FormService
Keywords: [Metadata] [Jobs] [Timers]
35. Identify Service
● Manage users and groups, but does not do any
checking at runtime
● Tasks could be assigned to any user, but the engine
does not verify if that user is known to the system
● Synchronization mechanisms are needed
RepositoryService
RuntimeService ManagementService HistoryService
TaskService IdentityService FormService
Keywords: [Users] [Groups] [Synchronization]
36. History Service
● Exposes query capabilities to access historical data
● Log level configuration allows the engine to keep the
necessary data, like which tasks were performed by
whom
● Allows finding all historical variable values from
any given process in each of its executed tasks
RepositoryService
RuntimeService ManagementService HistoryService
TaskService IdentityService FormService
Keywords: [Historical data] [Execution logs] [Variables]
37. Form Service
● Start form is displayed to the user before the
process instance is created
● Task form is displayed when a user has to work with
an assigned task
RepositoryService
RuntimeService ManagementService HistoryService
TaskService IdentityService FormService
Keywords: [Start form] [Task form] [Form key] [Form data]
38. Form Service
● A form key is used to find the view that has to be
rendered
RepositoryService
RuntimeService ManagementService HistoryService
TaskService IdentityService FormService
Keywords: [Start form] [Task form] [Form key] [Form data]
● Alternatively, a form data can be
defined in the BPMN 2.0 process
definition using a proper extension
46. Modeling Tool (MT)
● Based on BPMN.io and Grails
● REST API : Export BPMN models to XML / SVG
● Main goal : customization
● Custom Palette
○ Different frequency-based profiles
○ User reconfiguration
● Custom Tasks
○ Create new task types
○ Phone calls, Signatures, Approvals,
Archiving, Feedback Survey, etc.
47. eXecution Environment (XE)
● Based on Camunda and Grails
● REST Client : Importing Models (from diff. env.)
● Main goal : upper layer
○ Workflow Service : Unifying and extending the
process engine services with aggregated methods
○ REST API : allowing remote access
● Render forms
○ Scaffolded : formData
○ External : formKey
50. Conclusions
● Dev-Friendly BPM : nicest way to build
workflow architectures in Grails
● Extending BPMS : implementing workflow
applications or microservices with Grails
● Integration with BPM : … wait! explicitly or
implicitly?
52. ● The aim of integration is to reach the other side of BPMS
● Detailed Knowledge + Behaviour Modification
Explicit BPM
External Services
param:taskId
callbackUrl
53. Implicit BPM
● What about taking advantage of the MVC pattern to
acquire knowledge and change the behaviour in
runtime?
54. Example
Pet Store (MVC Application, UML)1
Success
Page
Item List
Page
Show
Page
search
shopping
cart
add item
checkoutcheckout
Order
Home
Page
Find
Item
Confirm
Cart
Process
Order
Book
Balance
Save
Purchase
3
Handle
Purchase
Register
Customer
Payment?
customer?
init completed
done
verified
wrong
regular
new
Purchase Workflow (Business Process Model, BPMN 2.0)
cancelled
Accounting (MVC Application, UML)2
Book
Customer
newcustomer
manage
books
Main
Page Show
Page
List
Page
Create
Customer
Edit
Book
55. Example
Book
Balance
Pet Store (MVC Application, UML)
Save
Purchase
1 Accounting (MVC Application, UML)2
3
Handle
Purchase
Register
Customer
Payment?
customer?
init completed
done
verified
wrong
regular
new
Success
Page
Item Book
Customer
List
Page
Show
Page
search
shopping
cart
add item
checkoutcheckout
Order
newcustomer
manage
books
Purchase Workflow (Business Process Model, BPMN 2.0)
Home
Page
Main
Page Show
Page
List
Page
Create
Customer
Edit
Book
Find
Item
Confirm
Cart
Process
Order
A
trigger
B
render C
find
sets
D
perform
E
perform
cancelled
56. PurchaseWorkflow {
in PetStore :
During ”process” action from Order, trigger ”init” event
After ”Save Purchase” task, render ”success” view
in Accounting :
Before ”Book Balance” task, find ”customer” domain by ”nin”
and sets ”exists” attribute
After ”Book Balance” task, perform ”update” action from Book
After ”Register Customer” task,
perform ”create” action from Customer
}
DSL
A
B
C
D
E
Workflow Weaving
58. More Info
● Website : http://implicit-bpm.sf.net
● Source code : http://sf.net/p/implicit-bpm/code
● Research paper :
Implicit BPM: a Business Process Platform for
Transparent Workflow Weaving. Rubén Mondéjar, Pedro
García-López, Carles Pairot, and Enric Brull. In: BPM, pp.
168–183 (2014)