Upload
do-duy-trung
View
246
Download
1
Embed Size (px)
Citation preview
BPM & Activiti
Do Duy Trung
BPMN
BPMN = BPM + N
- BPM: Business Process Modeling
- N: Notation
BPMN 1.x
● Notation for business experts to
analyse, document and discuss
business processes.
● Activities, Gateways, Events
Control & Data flow (Sequence
Flow, Data Objects)
● Organisational modelling (Pools,
Lanes)
● No defined execution semantics!
● Calls for a technical language for
business process automation
BPEL
● Standardized XML-based
language for executable,
technical business processes
● Hybrid language: block-
structured & graph-based Well-
defined execution language
● No dead-locks, no lack-of-
synchronization
● Graphs must be acyclic
● Tied to concepts of SOA/Web
Services
● No support for human activities
● No notation!
BPMN + BPEL
● Established Approach
o Business experts create
BPMN models
o IT experts translate them to
BPEL in order to make them
executable
● Problem
o Mapping BPMN to BPEL is
not straight forward Lax vs. strict semantics
Loops / Blocks
Lack of technical details in BPMN models
o Roundtripping is difficult
BPMN 2
● Best of both worlds
o A notation (subset) for BPEL
o A meta model and execution
semantics for BPMN
● Notational support for
Choreographies
● BPMN 2.0 models
o are now interchangeable
o can be executed
o can carry technical details
Types of BPMS
● The “commercial” model
o Standards-based
o Proprietary extension
o Closed-source
o Typically well tested & supported
o Often combined with consulting &
support offerings
● The “open source” model
o Standards-based and/or proprietary
o Source code is available for free
o Tech experts needed to get started
● The “commercial open source” model
o Based on open source
o Sell technical experience, glue code,
consulting & support
o E.g. Intalio, WSO2, Redhat,…
● The “embedded” approach
o Light-weight process engine
o Can be easily integrated into your
application
o Java-centric
o E.g. jBPM, Drools Flow, Activiti
● The “SOA” approach
o Architecture typically more heavy-
weight
o Orchestrates services to achieve a
higher business goal
o Service implementation is hidden by
an interface and is exchangeable
(mostly Web Services).
o E.g. Apache ODE, IBM, Oracle,
SAP,…
Activiti BPM Components
Activiti BPM Components
Activiti
- Modeler: a web-based graphical workflow authoring
- Designer: an Eclipse-plugin for developing workflow
- Engine: the core workflow processor
- Explorer: a web tool to deploy process definitions
- Cycle: a web app for collabration between business
users and software engineers
Database Table Names
● ACT_RE_*: RE → repository: process definitions &
resources (images, rules, etc.).
● ACT_RU_*: RU → runtime: process instances, user
tasks, variables, jobs, etc.
● ACT_ID_*: ID → identity: users, groups, etc.
● ACT_HI_*: HI → history: past process instances,
variables, tasks, etc.
● ACT_GE_*: GE → general data.
Activiti API
Query API
• HistoricProcessInstances:
createHistoricProcessInstanceQuery()
• HistoricVariableInstances:
createHistoricVariableInstanceQuery()
• HistoricActivityInstances:
createHistoricActivityInstanceQuery()
• HistoricDetails:
createHistoricDetailQuery()
• HistoricTaskInstances:
createHistoricTaskInstanceQuery()
→ Get 10 HistoricProcessInstances that are finished
and which took the most time to complete (the longest
duration) of all finished processes with definition ‘XXX‘:
historyService.createHistoricProcessInstanceQuery(
) .finished() .processDefinitionId(“XXX")
.orderByProcessInstanceDuration().desc()
.listPage(0, 10);
→ Get the last Historic Activity Instance of type
'serviceTask' that has been finished in any process that
uses the process definition with id XXX.
historyService.createHistoricActivityInstanceQuery()
.activityType("serviceTask")
.processDefinitionId("XXX") .finished()
.orderByHistoricActivityInstanceEndTime().desc()
.listPage(0, 1);
...
Activiti REST API
Remote communication with Activiti
Embeddable Java Engine vs Standalone Servers
Activiti Usage
Activiti Explorer
Activiti Designer
Activiti Modeler / Activiti Cloud
Demo
Q & A