View
6.455
Download
0
Category
Tags:
Preview:
DESCRIPTION
Business Process Management (BPM) beyond Web Services with Apache Camel and Activiti at CamelOne 2012 in Boston.
Citation preview
www.mwea.de
BPM beyond Web Services
Kai Wähner
+
www.mwea.de
Kai Wähner
16.05.2012 Seite 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
Contact Email: kai.waehner@mwea.de Blog: www.kai-waehner.de/blog
Twitter: @KaiWaehner Social Networks: Xing, LinkedIn
Consulting Developing Speaking Coaching Writing
www.mwea.de
What is the Key Message?
16.05.2012 Seite 3 Kai Wähner
www.mwea.de
BPM should be used for optimizing business processes!
Key Messages
16.05.2012 Seite 4 Kai Wähner
www.mwea.de
BPM should be used for optimizing business processes!
BPM should NOT be used for systems integration!
Key Messages
16.05.2012 Seite 5 Kai Wähner
www.mwea.de
BPM should be used for optimizing business processes!
BPM should NOT be used for systems integration!
Activiti and Apache Camel are a perfect combination!
Key Messages
16.05.2012 Seite 6 Kai Wähner
www.mwea.de
1) Business Process Management (BPM)
2) Activiti
3) Apache Camel
4) Combination of Activiti and Apache Camel
Agenda
16.05.2012 Seite 7 Kai Wähner
www.mwea.de
1) Business Process Management (BPM)
2) Activiti
3) Apache Camel
4) Combination of Activiti and Apache Camel
Agenda
16.05.2012 Seite 8 Kai Wähner
www.mwea.de
BPM attempts to improve processes continuously. It can therefore be described as a "process optimization process.“
Wikipedia
What is Business Process Management (BPM)?
16.05.2012 Seite 9 Kai Wähner
www.mwea.de
increase efficiency better quality reduce costs
enable new business models
Why BPM?
16.05.2012 Seite 10 Kai Wähner
Business-IT-Alignment
www.mwea.de
How to do BPM?
16.05.2012 Seite 11 Kai Wähner
www.mwea.de
Standards
16.05.2012 Seite 12 Kai Wähner
BPM
BPEL BPMN
XPDL WF-XML
BPEL4People
jPDL
ARIS EPC
www.mwea.de
Standards
16.05.2012 Seite 13 Kai Wähner
BPM
BPEL BPMN
XPDL WF-XML
BPEL4People
jPDL
ARIS EPC
www.mwea.de
BPMN
16.05.2012 Seite 14 Kai Wähner
Business Process Model and Notation (BPMN) is a graphical representation for specifying business processes in a business process model.
Wikipedia
www.mwea.de
• 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)
BPMN 2.0
16.05.2012 Seite 15 Kai Wähner
www.mwea.de
BPMN 2.0
16.05.2012 Seite 16 Kai Wähner
www.mwea.de
BPMN 2.0
16.05.2012 Seite 17 Kai Wähner
20-80 rule
www.mwea.de
• long-running stateful workflows • frequently changing processes • human interaction
When to use BPM?
16.05.2012 Seite 18 Kai Wähner
www.mwea.de
http://www.activevos.com/blog/soa/the-four-myths-of-bpm-projects-what-it-project-teams-need-to-know/2011/01/18/
16.05.2012 Seite 19 Kai Wähner
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
The Four Myths of BPM Projects
www.mwea.de
1) Business Process Management (BPM)
2) Activiti
3) Apache Camel
4) Combination of Activiti and Apache Camel
Agenda
16.05.2012 Seite 20 Kai Wähner
www.mwea.de
Alternatives for BPM
16.05.2012 Seite 21 Kai Wähner
Complexity of Orchestration
Low High
BPM Framework
BPM Suite
No Tool
www.mwea.de
Alternatives for BPM
16.05.2012 Seite 22 Kai Wähner
Complexity of Orchestration
Low High
BPM Framework
BPM Suite
No Tool
Activiti vs. JBoss jBPM vs. Bonita vs. ProcessMaker
www.mwea.de
• open source (Apache License) • BPMN 2.0 process engine • lightweight • easy to use • Java API • developer-focused • embeddable
What is Activiti?
16.05.2012 Seite 23 Kai Wähner
www.mwea.de
Tool Stack
16.05.2012 Seite 24 Kai Wähner
Process Engine
Activiti Modeler Activiti Designer
Activiti Explorer camunda fox style
www.mwea.de
How does Activiti work?
16.05.2012 Seite 25 Kai Wähner
• 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
Services RuntimeService TaskService FormService HistoryService IdentityService ManagementService RepositoryService
Actviti Engine API
16.05.2012 Seite 26 Kai Wähner
Service Tasks (BPMN Standard) Web Service Task 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
<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>
Code Example (BPMN Process)
16.05.2012 Seite 27 Kai Wähner
www.mwea.de
ProcessEngine processEngine = ProcessEngineConfiguration .createStandaloneInMemProcessEngineConfiguration() .buildProcessEngine();
RuntimeService runtimeService = processEngine.getRuntimeService(); RepositoryService repositoryService = processEngine.getRepositoryService(); repositoryService.createDeployment()
.addClasspathResource("bookorder.simple.bpmn20.xml") .deploy(); ProcessInstance processInstance = runtimeService.startProcessInstanceByKey( "simplebookorder");
assertNotNull(processInstance.getId()); System.out.println("id " + processInstance.getId() + " " + processInstance.getProcessDefinitionId());
Code Example (Activiti Java API)
16.05.2012 Seite 28 Kai Wähner
www.mwea.de
Use Case
16.05.2012 Seite 29 Kai Wähner
Start Event
Script Task
Service Task
User Task
End Event
Automatic Automatic Manual
www.mwea.de
Activiti in Action
Live Demo
16.05.2012 Seite 30 Kai Wähner
www.mwea.de
1) Business Process Management (BPM)
2) Activiti
3) Apache Camel
4) Combination of Activiti and Apache Camel
Agenda
16.05.2012 Seite 31 Kai Wähner
www.mwea.de
Apache Camel
16.05.2012 Seite 32 Kai Wähner
www.mwea.de
Apache Camel
16.05.2012 Seite 33 Kai Wähner
Come on, guys! We are at
www.mwea.de
Alternatives for Systems Integration
16.05.2012 Seite 34 Kai Wähner
Complexity of Integration
Low High
Integration-Framework
Enterprise Service Bus (ESB)
No Tool
www.mwea.de
Alternatives for Systems Integration
16.05.2012 Seite 35 Kai Wähner
Complexity of Integration
Low High
Integration-Framework
Enterprise Service Bus (ESB)
No Tool
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
Why Apache Camel?
16.05.2012 Seite 36 Kai Wähner
• Standardized Modeling • Efficient Realization • Developer-focused • Automatic Testing • Many Components • Several DSLs • Awesome Community
www.mwea.de
1) Business Process Management (BPM)
2) Activiti
3) Apache Camel
4) Combination of Activiti and Apache Camel
Agenda
16.05.2012 Seite 37 Kai Wähner
www.mwea.de
Apache Camel + Activiti
16.05.2012 Seite 38 Kai Wähner
www.mwea.de
BPMN Integration
16.05.2012 Seite 39 Kai Wähner
Script Task Service Task
Groovy JavaScript
etc.
Java SOAP Web Service
Everything (from Cobol to Ruby)
www.mwea.de
Reinventing the Wheel ...
16.05.2012 Seite 40 Kai Wähner
www.mwea.de
Spaghetti Solutions
16.05.2012 Seite 41 Kai Wähner
www.mwea.de
Separation of Concerns
16.05.2012 Seite 42 Kai Wähner
www.mwea.de
Both can realize processes. Both can integrate services.
Overlappings?
16.05.2012 Seite 43 Kai Wähner
www.mwea.de
Both can realize processes. Both can integrate services.
Overlappings?
16.05.2012 Seite 44 Kai Wähner
• Support for long running stateful processes • Human workflow integration
www.mwea.de
Both can realize processes. Both can integrate services.
Overlappings?
16.05.2012 Seite 45 Kai Wähner
• 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
Both ...
• ... are lightweight • ... are open source • ... are developer-focused • ... offer combination out-of-the-box
Activiti + Apache Camel
16.05.2012 Seite 46 Kai Wähner
+
www.mwea.de
<serviceTask id="myServiceTask"
activiti:delegateExpression="${camelBehaviour}" />
<sequenceFlow sourceRef="myServiceTask" targetRef="myUserTask" />
Connecting BPMN, Activiti and Camel
16.05.2012 Seite 47 Kai Wähner
<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>
BPMN - Java Service Task
Spring Bean
BPMN Process Instance
CamelContext
www.mwea.de
// 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();
Camel Route using Activiti Component
16.05.2012 Seite 48 Kai Wähner
www.mwea.de
Activiti and Apache Camel combined ...
Live Demo
16.05.2012 Seite 49 Kai Wähner
www.mwea.de
Did you get the Key Message?
16.05.2012 Seite 50 Kai Wähner
www.mwea.de
BPM should be used for optimizing business processes!
BPM should NOT be used for systems integration!
Activiti and Apache Camel are a perfect combination!
Key Messages
16.05.2012 Seite 51 Kai Wähner
www.mwea.de
Did you get the Key Message?
16.05.2012 Seite 52 Kai Wähner
www.mwea.de
Whet your appetite?
16.05.2012 Seite 53 Kai Wähner
www.mwea.de
Become a Part of the Open Source Community
16.05.2012 Seite 54 Kai Wähner
www.mwea.de
= BPM beyond Web Services
Thank you for your Attention. Any Questions?
Kai Wähner
Kai Wähner
MaibornWolff et al: www.mwea.de
Email: kai.waehner@mwea.de Twitter: @KaiWaehner Blog: www.kai-waehner.de/blog
+
Recommended