2. Kai Wähner
Main Tasks
Evaluation of Technologies and Products
Requirements Engineering
Enterprise Architecture Management
Business Process Management
Architecture and Development of Applications
Planning and Introduction of SOA
Integration of Legacy Applications
Cloud Computing
Consulting
Contact
Developing Email: kai.waehner@mwea.de
Speaking Blog: www.kai-waehner.de/blog
Coaching Twitter: @KaiWaehner
Writing Social Networks: Xing, LinkedIn
www.mwea.de Kai Wähner 16.05.2012 Seite 2
3. What is the Key Message?
www.mwea.de Kai Wähner 16.05.2012 Seite 3
4. Key Messages
BPM should be used for optimizing business processes!
www.mwea.de Kai Wähner 16.05.2012 Seite 4
5. Key Messages
BPM should be used for optimizing business processes!
BPM should NOT be used for systems integration!
www.mwea.de Kai Wähner 16.05.2012 Seite 5
6. Key Messages
BPM should be used for optimizing business processes!
BPM should NOT be used for systems integration!
Activiti and Apache Camel are a perfect combination!
www.mwea.de Kai Wähner 16.05.2012 Seite 6
7. Agenda
1) Business Process Management (BPM)
2) Activiti
3) Apache Camel
4) Combination of Activiti and Apache Camel
www.mwea.de Kai Wähner 16.05.2012 Seite 7
8. Agenda
1) Business Process Management (BPM)
2) Activiti
3) Apache Camel
4) Combination of Activiti and Apache Camel
www.mwea.de Kai Wähner 16.05.2012 Seite 8
9. What is Business Process Management (BPM)?
BPM attempts to improve processes continuously.
It can therefore be described as a "process
optimization process.“
Wikipedia
www.mwea.de Kai Wähner 16.05.2012 Seite 9
10. Why BPM?
increase efficiency
better quality
Business-IT-Alignment
reduce costs
enable new business models
www.mwea.de Kai Wähner 16.05.2012 Seite 10
11. How to do BPM?
www.mwea.de Kai Wähner 16.05.2012 Seite 11
12. Standards
jPDL
BPEL BPMN
BPM XPDL
WF-XML
ARIS EPC
BPEL4People
www.mwea.de Kai Wähner 16.05.2012 Seite 12
13. Standards
jPDL
BPEL BPMN
BPM XPDL
WF-XML
ARIS EPC
BPEL4People
www.mwea.de Kai Wähner 16.05.2012 Seite 13
14. BPMN
Business Process Model and Notation (BPMN) is a graphical
representation for specifying business processes in a business process
model.
Wikipedia
www.mwea.de Kai Wähner 16.05.2012 Seite 14
15. BPMN 2.0
• BPMN is a standard notation for designing business processes
(versus: UML is a standard modeling language best suited for designing and implementing software)
• not just flow charts! sufficient restrictions / constraints => executable!
• standardized XML format
• orchestration and choreography
• extension points => add specific needs without breaking interoperability
• optional mapping of a BPMN subset to BPEL
(restricted to block-structured flows without cycles)
www.mwea.de Kai Wähner 16.05.2012 Seite 15
17. BPMN 2.0
20-80 rule
www.mwea.de Kai Wähner 16.05.2012 Seite 17
18. When to use BPM?
• long-running stateful workflows
• frequently changing processes
• human interaction
www.mwea.de Kai Wähner 16.05.2012 Seite 18
19. The Four Myths of BPM Projects
1) Business analysts will create executable process models
2) Business analysts can create executable process models
3) Business analysts want to create executable process models
4) IT wants business analysts to create executable process models
http://www.activevos.com/blog/soa/the-four-myths-of-bpm-projects-what-it-project-teams-need-to-know/2011/01/18/
www.mwea.de Kai Wähner 16.05.2012 Seite 19
20. Agenda
1) Business Process Management (BPM)
2) Activiti
3) Apache Camel
4) Combination of Activiti and Apache Camel
www.mwea.de Kai Wähner 16.05.2012 Seite 20
21. Alternatives for BPM
BPM Suite
BPM
No Tool
Framework
Complexity of
Orchestration
Low High
www.mwea.de Kai Wähner 16.05.2012 Seite 21
22. Alternatives for BPM
BPM Suite
BPM
No Tool
Framework
Complexity of
Orchestration
Low High
Activiti vs. JBoss jBPM vs. Bonita vs. ProcessMaker
www.mwea.de Kai Wähner 16.05.2012 Seite 22
23. What is Activiti?
• open source (Apache License)
• BPMN 2.0 process engine
• lightweight
• easy to use
• Java API
• developer-focused
• embeddable
www.mwea.de Kai Wähner 16.05.2012 Seite 23
24. Tool Stack
Activiti Modeler Activiti Designer
Process Engine
camunda fox style Activiti Explorer
www.mwea.de Kai Wähner 16.05.2012 Seite 24
25. How does Activiti work?
• BPMN 2.0 process engine
• state machine with one active state
• execution progresses via transitions
• most BPMN 2.0 elements are implemented as a state
• states are connected with leaving and arriving transitions (called sequence flows)
• every state (i.e. its corresponding BPMN 2.0 element) can have a piece of logic attached
(executed when the process instance enters the state)
www.mwea.de Kai Wähner 16.05.2012 Seite 25
26. Actviti Engine API
Services
RuntimeService
TaskService
FormService
HistoryService
IdentityService
Service Tasks (BPMN Standard)
ManagementService Web Service Task
RepositoryService Script Task (e.g. Groovy or JavaScript)
User Task
Business Rule Task
Service Tasks (Activiti Extensions)
Java Tasks
Spring Service Task
... more
www.mwea.de Kai Wähner 16.05.2012 Seite 26
27. Code Example (BPMN Process)
<process id="bookorder" name="Order book">
<startEvent id="startevent1" name="Start"/>
<sequenceFlow id="sequenceflow1" name="Validate order"
sourceRef="startevent1" targetRef="scripttask1"/>
<scriptTask id="scripttask1"
name="Validate order“ scriptFormat="groovy">
<script>out:println "validating order for isbn " + isbn;</script>
</scriptTask>
<sequenceFlow id="sequenceflow2" name="Ending process"
sourceRef="usertask1" targetRef="endevent1"/>
<endEvent id="endevent1" name="End"/>
</process>
www.mwea.de Kai Wähner 16.05.2012 Seite 27
29. Use Case
Start Event Service Task End Event
Script Task User Task
Automatic Automatic Manual
www.mwea.de Kai Wähner 16.05.2012 Seite 29
30. Live Demo
Activiti in Action
www.mwea.de Kai Wähner 16.05.2012 Seite 30
31. Agenda
1) Business Process Management (BPM)
2) Activiti
3) Apache Camel
4) Combination of Activiti and Apache Camel
www.mwea.de Kai Wähner 16.05.2012 Seite 31
33. Apache Camel
Come on, guys! We are at
www.mwea.de Kai Wähner 16.05.2012 Seite 33
34. Alternatives for Systems Integration
Enterprise Service Bus
Integration- (ESB)
No Tool
Framework
Complexity
of Integration
Low High
www.mwea.de Kai Wähner 16.05.2012 Seite 34
35. Alternatives for Systems Integration
Enterprise Service Bus
Integration- (ESB)
No Tool
Framework
Complexity
of Integration
Low High
Apache Camel vs. Spring Integration vs. Mule ESB
http://www.kai-waehner.de/blog/2012/01/10/spoilt-for-choice-which-integration-framework-to-use-spring-integration-mule-esb-or-apache-camel
www.mwea.de Kai Wähner 16.05.2012 Seite 35
36. Why Apache Camel?
• Standardized Modeling
• Efficient Realization
• Developer-focused
• Automatic Testing
• Many Components
• Several DSLs
• Awesome Community
www.mwea.de Kai Wähner 16.05.2012 Seite 36
37. Agenda
1) Business Process Management (BPM)
2) Activiti
3) Apache Camel
4) Combination of Activiti and Apache Camel
www.mwea.de Kai Wähner 16.05.2012 Seite 37
38. Apache Camel + Activiti
www.mwea.de Kai Wähner 16.05.2012 Seite 38
39. BPMN Integration
Script Task Service Task
Groovy Java
JavaScript SOAP Web Service
etc.
Everything
(from Cobol to Ruby)
www.mwea.de Kai Wähner 16.05.2012 Seite 39
43. Overlappings?
Both can realize processes. Both can integrate services.
www.mwea.de Kai Wähner 16.05.2012 Seite 43
44. Overlappings?
Both can realize processes. Both can integrate services.
• Support for long running stateful processes
• Human workflow integration
www.mwea.de Kai Wähner 16.05.2012 Seite 44
45. Overlappings?
Both can realize processes. Both can integrate services.
• Support for long running stateful processes
• Human workflow integration
• Connectivity / Adaptors to connect to external
systems using a variety of different protocols
• Predefined EIP for message routing
http://www.pleus.net/blog/?p=1028
www.mwea.de Kai Wähner 16.05.2012 Seite 45
46. Activiti + Apache Camel
+
Both ...
• ... are lightweight
• ... are open source
• ... are developer-focused
• ... offer combination out-of-the-box
www.mwea.de Kai Wähner 16.05.2012 Seite 46
47. Connecting BPMN, Activiti and Camel
BPMN - Java Service Task
<serviceTask id="myServiceTask"
activiti:delegateExpression="${camelBehaviour}" />
<sequenceFlow sourceRef="myServiceTask" targetRef="myUserTask" />
BPMN Process Instance
Spring Bean
<bean id="camelBehaviour" class="org.activiti.camel.CamelBehaviour">
<constructor-arg index="0">
<list>
<bean class="org.activiti.camel.SimpleContextProvider">
<constructor-arg index="0" value="activitiCamelProcess" />
<constructor-arg index="1" ref="camelContext" />
</bean>
</list>
</constructor-arg>
</bean>
CamelContext
www.mwea.de Kai Wähner 16.05.2012 Seite 47
48. Camel Route using Activiti Component
// Producer => Call Activiti process from Camel
from("direct:start")
.to("activiti:myProcess");
// Consumer => Get called from Activiti process
from("activiti:myProcess:myServiceTask")
.log(LoggingLevel.INFO, "Received message on service task ${property.var1}")
.setProperty("var2").constant("world")
.setBody().properties();
www.mwea.de Kai Wähner 16.05.2012 Seite 48
49. Live Demo
Activiti and Apache Camel combined ...
www.mwea.de Kai Wähner 16.05.2012 Seite 49
50. Did you get the Key Message?
www.mwea.de Kai Wähner 16.05.2012 Seite 50
51. Key Messages
BPM should be used for optimizing business processes!
BPM should NOT be used for systems integration!
Activiti and Apache Camel are a perfect combination!
www.mwea.de Kai Wähner 16.05.2012 Seite 51
52. Did you get the Key Message?
www.mwea.de Kai Wähner 16.05.2012 Seite 52
54. Become a Part of the Open Source Community
www.mwea.de Kai Wähner 16.05.2012 Seite 54
55. Thank you for your Attention. Any Questions?
+ = BPM beyond Web Services
Kai Wähner
MaibornWolff et al: www.mwea.de
Email: kai.waehner@mwea.de
Twitter: @KaiWaehner
Blog: www.kai-waehner.de/blog
www.mwea.de Kai Wähner