Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Introducing Activiti: A Glimpse and [Hopefully]...

Introducing Activiti: A Glimpse and [Hopefully] a Hook

Given at the Vienna DevFest 2012

Rafael Cordones

November 10, 2012
Tweet

More Decks by Rafael Cordones

Other Decks in Programming

Transcript

  1. Introducing Rafael Cordones, [email protected], @rafacm DevFest 2012, November 10th, 2012,

    Vienna A Glimpse and [Hopefully] a Hook* * “A Glimpse and a Hook“: http://www.randsinrepose.com/archives/2007/02/25/a_glimpse_and_a_hook.html
  2. DevFest 2012 – November 10th 2012 | Vienna plexiti ·

    pragmatic software productions Agenda n Introduction n How did we all get here? n Software Development, Business Processes and the Business Process Modeling Notation (BPMN 2.0) n Meet Activiti… and friends! n Conclusion and discussion 2
  3. DevFest 2012 – November 10th 2012 | Vienna plexiti ·

    pragmatic software productions How did I get here? n Some background information about myself: n Barcelonian by birth, European by choice. Currently living in Vienna. n Experience working for small companies developing web-based software products for business customers n Inoculated against the Not Invented Here syndrome and instead prefer to embrace a Proudly Found Elsewhere attitude! n Java (ecosystem) developer. n Disclosure: I’m a partner at plexiti which is itself a partner with camunda and signavio, companies that develop products I mention in this presentation. 3
  4. DevFest 2012 – November 10th 2012 | Vienna plexiti ·

    pragmatic software productions How did you get here? n How many of you have experience with Java development? n How many of you are familiar with integration projects (B2B)? n How many of you are familiar with Activiti, jBPM or other business process engines? 4
  5. DevFest 2012 – November 10th 2012 | Vienna plexiti ·

    pragmatic software productions How did we get here? n What is a “computer”? 5 Source: “An Illustrated History of Computers”: http://www.computersciencelab.com/ComputerHistory/History.htm
  6. DevFest 2012 – November 10th 2012 | Vienna plexiti ·

    pragmatic software productions How did we get here? n The first (never built) general-purpose device that could be programmed. Charles Babbage's blueprint for the Analytical Engine from the 1830s: 6 Seems it will be built after all! http://plan28.org/ Source: http://gregoryreher.com/2010/11/building-charles-babbages-analytical-engine/
  7. DevFest 2012 – November 10th 2012 | Vienna plexiti ·

    pragmatic software productions How did we get here? n The first electronic general-purpose digital computer: the ENIAC (1946) 7 Text Source: http://en.wikipedia.org/wiki/ENIAC
  8. DevFest 2012 – November 10th 2012 | Vienna plexiti ·

    pragmatic software productions How did we get here? n The first electronic general-purpose digital computer: the ENIAC (1946) 7 Text Source: http://en.wikipedia.org/wiki/ENIAC Flexible plug-in architectures are not that new after all!
  9. DevFest 2012 – November 10th 2012 | Vienna plexiti ·

    pragmatic software productions How did we get here? n “Hello World” in Assembly language for the x86 and Java: 8 section .data str: db 'Hello world!', 0Ah str_len: equ $ - str section .text global _start _start: mov eax, 4 mov ebx, 1 mov ecx, str mov edx, str_len int 80h mov eax, 1 mov ebx, 0 int 80h class HelloWorldApp { public static void main(String[] args) { String msg = "Hello World!"; System.out.println(msg); } } Question: Is this all about lines of code? Answer: No. It’s about the level of abstraction at which a language (or technology) allows you to express and evaluate concepts. Sources: http://en.wikipedia.org/wiki/X86_assembly_language#.22Hello_world. 21.22_program_for_Linux_in_NASM_style_assembly http://en.wikipedia.org/wiki/Java_(programming_language)#Hello_world
  10. DevFest 2012 – November 10th 2012 | Vienna plexiti ·

    pragmatic software productions How did we get here? 9 Source: http://en.wikipedia.org/wiki/Thomas_J._Watson "I think there is a world market for maybe five computers" Mis-attributed to Thomas J. Watson (Chairman of the Board of IBM, 1943)
  11. DevFest 2012 – November 10th 2012 | Vienna plexiti ·

    pragmatic software productions How did we get here? 9 Apple Open Shift Amazon Facebook ? Google Source: http://en.wikipedia.org/wiki/Thomas_J._Watson "I think there is a world market for maybe five computers" Mis-attributed to Thomas J. Watson (Chairman of the Board of IBM, 1943)
  12. DevFest 2012 – November 10th 2012 | Vienna plexiti ·

    pragmatic software productions How did we get here? 9 Apple Open Shift Amazon Facebook ? Google Source: http://en.wikipedia.org/wiki/Thomas_J._Watson "I think there is a world market for maybe five computers" Mis-attributed to Thomas J. Watson (Chairman of the Board of IBM, 1943) He seems to have been almost right!
  13. DevFest 2012 – November 10th 2012 | Vienna plexiti ·

    pragmatic software productions Would you like to know more? 10 Get the whole tour about the history of computers at: http://topdocumentaryfilms.com/the-machine-that- changed-the-world/ or even better, read the book “The Dream Machine: Exploring the Computer Age”!
  14. DevFest 2012 – November 10th 2012 | Vienna plexiti ·

    pragmatic software productions Software Development n Q: Is software development an individual activity? A: It depends. Q: On what? A: On the context. 11 Source: http://en.wikipedia.org/wiki/ On_the_Internet,_nobody_knows_you're_a_dog “On the Internet, nobody knows you’re a dog.” “Any fool can write code that a computer can understand. Good programmers write code that humans can understand”. -- Martin Fowler
  15. DevFest 2012 – November 10th 2012 | Vienna plexiti ·

    pragmatic software productions Software Development n Q: Is software development an individual activity? A: It depends. Q: On what? A: On the context. 11 Source: http://en.wikipedia.org/wiki/ On_the_Internet,_nobody_knows_you're_a_dog “On the Internet, nobody knows you’re a dog.” “Any fool can write code that a computer can understand. Good programmers write code that humans can understand”. -- Martin Fowler Which code?! To do what exactly?
  16. DevFest 2012 – November 10th 2012 | Vienna plexiti ·

    pragmatic software productions Enterprise Software Development 12 Source: http://www.projectcartoon.com
  17. DevFest 2012 – November 10th 2012 | Vienna plexiti ·

    pragmatic software productions Large Scale Enterprise Software Development 13 “The Tower of Babel” by Pieter Bruegel the Elder (1563). Kunsthistorisches Museum, Vienna.
  18. DevFest 2012 – November 10th 2012 | Vienna plexiti ·

    pragmatic software productions n Question: why? One answer: every participant speaks a different language: n customer’s language, i.e. the business you are in (insurance, trading, …) n business analyst language n programming language (Java, .NET, Ruby, Python, … idioms) n national language and culture (Deutsch, English, …) 14 From “Understanding Comics: The Invisible Art”. Scott McCloud. 1993. Pages 194-195. Large Scale Enterprise Software Development
  19. DevFest 2012 – November 10th 2012 | Vienna plexiti ·

    pragmatic software productions Different People, Different Languages 15 Customers Software developers Business analysts System administrators Product owners Sales Support
  20. DevFest 2012 – November 10th 2012 | Vienna plexiti ·

    pragmatic software productions What is a business process? n Definition: “a sequence of related, structured activities or tasks that produce a specific service or product (serve a particular goal) for a particular customer or customers.” 16 Source: http://en.wikipedia.org/wiki/Business_process
  21. DevFest 2012 – November 10th 2012 | Vienna plexiti ·

    pragmatic software productions When do I need a business process? n Business process modeling acid test*: 1. Long-running: hours, days, weeks, months, years, … 2. Bursty, sleeps most of the time: when awake, a flurry of activities and then finished or to sleep again! 3. Persisted state: what happens between different steps or when the application server goes down? 4. Orchestration of system or human communications: who has to do what until when? what happens afterwards? n What about communication? Common shared understanding? n What about organizational learning? n How long does it takes us to do X? n Who did what when? 17 * “Essential Business Process Modeling”, Michael Havey, O’Reilly Press http://shop.oreilly.com/product/9780596008437.do via http://stackoverflow.com/questions/4869734/how-do-you-know-when-you-need-a-bpm-solution
  22. DevFest 2012 – November 10th 2012 | Vienna plexiti ·

    pragmatic software productions Business Process Modeling Notation 2.0 n Example: announcing a job position 18 Source: “Praxishandbuch BPMN 2.0” http://www.bpm-guide.de/2012/02/16/praxishandbuch-bpmn-2-0-in-der-3-auflage/
  23. DevFest 2012 – November 10th 2012 | Vienna plexiti ·

    pragmatic software productions Business Process Modeling Notation 2.0 n Example: announcing a job position explained… first tasting: 19 Start event Sequence flow User (human) task Pool (participant) Lane Gateway (exclusive) Call activity (sub-process) Service task End event Activities
  24. DevFest 2012 – November 10th 2012 | Vienna plexiti ·

    pragmatic software productions Business Process Modeling Notation 2.0 n Great! I just need to learn some new symbols and then … 20
  25. DevFest 2012 – November 10th 2012 | Vienna plexiti ·

    pragmatic software productions Business Process Modeling Notation 2.0 n Great! I just need to learn some new symbols and then … 20 From the movie: “The Matrix” by Larry and Andy Wachowski. 1999. WOAH! I know BPMN 2.0!
  26. DevFest 2012 – November 10th 2012 | Vienna plexiti ·

    pragmatic software productions Business Process Modeling Notation 2.0 21 From the movie: “The Matrix” by Larry and Andy Wachowski. 1999. In your dreams! Mister Anderson
  27. DevFest 2012 – November 10th 2012 | Vienna plexiti ·

    pragmatic software productions Business Process Modeling Notation 2.0 21 From the movie: “The Matrix” by Larry and Andy Wachowski. 1999. In your dreams! Mister Anderson “It is difficult, if not impossible, for anyone to learn a subject purely by reading about it, without applying the information to specific problems and thereby forcing himself to think about what has been read. Furthermore, we all learn best the things we have discovered ourselves.” -- Donald Knuth, “The Art of Computer Programming”* * Via Alexander Daniel: http://lachdrache.wordpress.com/2012/03/11/reading-•-applying-•-thinking/
  28. Activities Conversations Events Gateways Conversation Diagram None: Untyped events, indicate

    start point, state changes or final states. Message: Receiving and sending messages. Timer: Cyclic timer events, points in time, time spans or timeouts. Error: Catching or throwing named errors. Cancel: Reacting to cancelled transactions or triggering cancellation. Compensation: Handling or triggering compensation. Conditional: Reacting to changed business conditions or integrating business rules. Signal: Signalling across differ- ent processes. A signal thrown can be caught multiple times. Multiple: Catching one out of a set of events. Throwing all events defined Link: Off-page connectors. Two corresponding link events equal a sequence flow. Terminate: Triggering the immediate termination of a process. Escalation: Escalating to an higher level of responsibility. Parallel Multiple: Catching all out of a set of parallel events. Start End Intermediate Catching Throwing Event Sub-Process Interrupting Top-Level Event Sub-Process Non-Interrupting Boundary Interrupting Boundary Non- Interrupting Sequence Flow defines the execution order of activities. Conditional Flow has a condition assigned that defines whether or not the flow is used. Default Flow is the default branch to be chosen if all other conditions evaluate to false. Task A Task is a unit of work, the job to be performed. When marked with a symbol it indicates a Sub-Process, an activity that can be refined. Transaction A Transaction is a set of activities that logically belong together; it might follow a specified transaction protocol. Event Sub-Process An Event Sub-Process is placed into a Process or Sub-Process. It is activated when its start event gets triggered and can interrupt the higher level process context or run in parallel (non- interrupting) depending on the start event. Call Activity A Call Activity is a wrapper for a globally defined Sub-Process or Task that is reused in the current process. Task Types Types specify the nature of the action to be performed: Send Task Receive Task User Task Manual Task Business Rule Task Service Task Script Task Markers indicate execution behavior of activities: Activity Markers Sub-Process Marker Loop Marker Parallel MI Marker Sequential MI Marker ~ Ad Hoc Marker Compensation Marker A Communication defines a set of logically related message exchanges. When marked with a symbol it indicates a Sub-Conversation, a compound conversation element. A Forked Conversation Link connects Communications and multiple Participants. A Conversation Link connects Communications and Participants. Inclusive Gateway When splitting, one or more branches are activated. All active incoming branches must complete before merging. Complex Gateway Complex merging and branching behavior that is not captured by other gateways. Exclusive Event-based Gateway (instantiate) Each occurrence of a subsequent event starts a new process instance. Parallel Event-based Gateway (instantiate) The occurrence of all subsequent events starts a new process instance. Pool (collapsed) Multi Instance Pool (collapsed) Communication Sub-Conversation Pool (collapsed) Participant B The order of message exchanges can be specified by combining message flow and sequence flow. Pool Pool Pools (Participants) and Lanes represent responsibilities for activities in a process. A pool or a lane can be an organization, a role, or a system. Lanes subdivide pools or other lanes hierarchically. Lane Task Lane Task Pool Message Flow symbolizes information flow across organizational boundaries. Message flow can be attached to pools, activities, or message events. Data Task Input Out- put Data Store A Data Object represents information flowing through the process, such as business documents, e-mails, or letters. A Data Store is a place where the process can read or write data, e.g., a database or a filing cabinet. It persists beyond the lifetime of the process instance. A Data Input is an external input for the entire process. It can be read by an activity. A Data Output is a variable available as result of the entire process. A Message is used to depict the contents of a communication between two Participants. A Collection Data Object represents a collection of information, e.g., a list of order items. Pool (Collapsed) Collaboration Diagram Pool (Expanded) Lane Lane Choreographies Choreography Diagram A Choreography Task represents an Interaction (Message Exchange) between two Participants. Choreography Task Participant A Participant B A Choreography Sub- Process contains a refined choreography with several Interactions. Multiple Participants Marker denotes a set of Participants of the same kind. Swimlanes BPMN 2.0 - Business Process Model and Notation Collection Ad-hoc Sub-Process Task Task ~ Message Start Event Message Flow Data Object Collapsed Sub-Process Event-based Gateway Escalation End Event Timer Intermediate Event Receive Task Attached Intermediate Timer Event Link Intermediate Event Manual Task End Event Data Store Link Intermediate Event Parallel Multiple Intermediate Event Text Annotation Group Multi Instance Task (Parallel) Message End Event Send Task Parallel Gateway Exclusive Gateway Attached Intermediate Error Event Signal End Event Call Activity Sub-Process Event Sub-Process Conditional Start Event Error End Event Start Event End Event Looped Sub-Process condition http://bpmb.de/poster Participant A Participant C Participant B Choreography Task Participant A Participant B Choreography Task Participant A Participant C Initiating Message Response Message Choreography Task Participant B Participant A When splitting, it routes the sequence flow to exactly one of the outgoing branches. When merging, it awaits one incoming branch to complete before triggering the outgoing flow. Exclusive Gateway Is always followed by catching events or receive tasks. Sequence flow is routed to the subsequent event/task which happens first. Event-based Gateway When used to split the sequence flow, all outgoing branches are activated simultaneously. When merging parallel branches it waits for all incoming branches to complete before triggering the outgoing flow. Parallel Gateway Choreography Sub-Process Participant A Participant C Participant B DevFest 2012 – November 10th 2012 | Vienna plexiti · pragmatic software productions Would you like to know more? 22 And THE poster! PDF: http://www.bpmb.de/images/BPMN2_0_Poster_EN.pdf Printed: http://www.signavio.com/joomla/de/bpmn-poster.html Get THE book! German: http://www.bpm-guide.de/2012/02/16/ praxishandbuch-bpmn-2-0-in-der-3-auflage/ English: http://www.bpm-guide.de/2012/10/30/real-life- bpmn-2-0-book-now-available-in-english/ Get the BPMN 2.0 Examples at: http://www.omg.org/cgi-bin/doc?dtc/10-06-02
  29. DevFest 2012 – November 10th 2012 | Vienna plexiti ·

    pragmatic software productions Business Process Modeling Notation 2.0 n Question: Is this a business process? 23
  30. DevFest 2012 – November 10th 2012 | Vienna plexiti ·

    pragmatic software productions Business Process Modeling Notation 2.0 n Answer: No. It’s a model of a business process! 24 Picture sources: http://en.wikipedia.org
  31. DevFest 2012 – November 10th 2012 | Vienna plexiti ·

    pragmatic software productions Business Process Modeling Notation 2.0 n Answer: No. It’s a model of a business process! 24 Picture sources: http://en.wikipedia.org
  32. DevFest 2012 – November 10th 2012 | Vienna plexiti ·

    pragmatic software productions Business Process Modeling Notation 2.0 n Answer: No. It’s a model of a business process! 24 All models are incomplete! But they serve very well their role as a common shared understanding. Picture sources: http://en.wikipedia.org
  33. DevFest 2012 – November 10th 2012 | Vienna plexiti ·

    pragmatic software productions n The point is not to have a great model, the point is to ship software! n In every moderate to complex software project: 25 Business Process Modeling Notation 2.0
  34. DevFest 2012 – November 10th 2012 | Vienna plexiti ·

    pragmatic software productions n The point is not to have a great model, the point is to ship software! n In every moderate to complex software project: 25 [T]here are known knowns; there are things we know that we know. There are known unknowns; that is to say there are things that, we now know we don't know. But there are also unknown unknowns – there are things we do not know we don't know. --- United States Secretary of Defense, Donald Rumsfeld Business Process Modeling Notation 2.0
  35. DevFest 2012 – November 10th 2012 | Vienna plexiti ·

    pragmatic software productions Meet Activiti n Light-weight workflow and Business Process Management (BPM) platform n Able to execute BPMN 2.0 business processes n For business analysts, developers and system admins n Open-source and distributed under the Apache License 2.0 n Activiti runs in any Java application or web application server n Integrates with Spring n Has a REST API 26 http://activiti.org
  36. DevFest 2012 – November 10th 2012 | Vienna plexiti ·

    pragmatic software productions Meet Activiti n An engine or a platform? Both! 27 Source: http://activiti.org/components.html
  37. DevFest 2012 – November 10th 2012 | Vienna plexiti ·

    pragmatic software productions Different People, Different Needs 28 Customer Software developers Business analysts System administrators Activiti Designer Activiti Engine Activiti Probe Activiti Modeler Activiti Explorer
  38. DevFest 2012 – November 10th 2012 | Vienna plexiti ·

    pragmatic software productions Meet Activiti (demo) n Installing and starting the Activiti demo project n Exploring the packaged examples n Developing process applications: n What about testing?! --> unit testing your processes n Connecting the process to your business logic (services, …) n Deploying the process and related resources n “Using” the process n Monitoring the process 29 Hi! I’m Kermit!
  39. DevFest 2012 – November 10th 2012 | Vienna plexiti ·

    pragmatic software productions Meet Activiti (demo) n Installing and starting the Activiti demo project n Exploring the packaged examples n Developing process applications: n What about testing?! --> unit testing your processes n Connecting the process to your business logic (services, …) n Deploying the process and related resources n “Using” the process n Monitoring the process 29 Hi! I’m Kermit! I’m Gonzo!
  40. DevFest 2012 – November 10th 2012 | Vienna plexiti ·

    pragmatic software productions Meet Activiti (demo) n Installing and starting the Activiti demo project n Exploring the packaged examples n Developing process applications: n What about testing?! --> unit testing your processes n Connecting the process to your business logic (services, …) n Deploying the process and related resources n “Using” the process n Monitoring the process 29 Hi! I’m Kermit! I’m Gonzo! And I’m Fozzie!
  41. DevFest 2012 – November 10th 2012 | Vienna plexiti ·

    pragmatic software productions … and friends: camunda fox n Commercially supported version of Activiti n Focus on the Java EE / CDI environment n JBoss, Glassfish, WAS, … application servers n Improved tooling: designer, cockpit, cycle, … n Full featured comparison here: http://www.camunda.com/fox/product/features/ n Development and production support n camunda employs a good portion of the Activiti core developers n Open Source Community Edition also available! http://www.camunda.com/fox/ n camunda fox open source strategy: http://www.bpm-guide.de/2012/02/17/camunda-fox-open-source-strategy/ 30
  42. DevFest 2012 – November 10th 2012 | Vienna plexiti ·

    pragmatic software productions The Job Announcement Showcase n A kick-start application for your business process-centric project! n Java EE 6 technology stack n camunda fox BPM Platform n Try online at: http://the-job-announcement.com/ n Fork, clone, modify, … at https://github.com/plexiti/the-job- announcement-fox n Feedback highly appreciated! n More to come: http://plexiti.com/blog 31
  43. DevFest 2012 – November 10th 2012 | Vienna plexiti ·

    pragmatic software productions The Job Announcement Showcase n Demo 32
  44. DevFest 2012 – November 10th 2012 | Vienna plexiti ·

    pragmatic software productions Conclusions n BPMN 2.0 process diagrams as n means of communication and sharing knowledge between project participants n executable in an open-source business process engine like Activiti n Question: do we need software developers anymore then?! Answer: Sure! n Zero-code: business analysts will be able to “draw” the processes themselves. Snake oil! n Less-code: software developers can focus on implementing what brings value. n There’s no silver bullet! “No Silver Bullet — Essence and Accidents of Software Engineering” http://www.cs.nott.ac.uk/~cah/G51ISS/Documents/NoSilverBullet.html “All non-trivial abstractions, to some degree, are leaky” http://www.joelonsoftware.com/articles/LeakyAbstractions.html 33
  45. DevFest 2012 – November 10th 2012 | Vienna plexiti ·

    pragmatic software productions Would you like to know more? n For the technical side of process-based application implementation: n “Wie man Workflows mit Activiti als Open Source Process Engine leichtgewichtig in die Java-Welt bringt” by Daniel Meyer and Bernd Rücker http://www.camunda.com/wp-content/uploads/2012/06/JM_6_12_Meyer_R%C3%BCcker_Activiti.pdf 34 “Activiti in Action: Executable business processes in BPMN 2.0” by Tijs Rademakers http://www.bpmnwithactiviti.org/ Discount code available on the Activiti website! http://activiti.org/
  46. DevFest 2012 – November 10th 2012 | Vienna plexiti ·

    pragmatic software productions Discussion 35
  47. DevFest 2012 – November 10th 2012 | Vienna plexiti ·

    pragmatic software productions Answers to Discussion Questions n Q: “Since you are using EL expressions, are you forced to use JSF?” A: No! Check out this cool AngularJS-based demo for camunda fox by Daniel Meyer and Nico Rehwaldt: Demo: http://showcase-camundafox.rhcloud.com/fruit-shop/app/index.html Code: https://github.com/meyerdan/order-processing-demo n Q: I presume Activiti is only for Java-based projects, or? A: No! Activiti also offers a REST API! http://activiti.org/userguide/index.html#N12855 n Q: Must all the application data be also stored in the Activiti database tables? A: Not at all! See here on how to use your JPA-based model entities with Activiti http://activiti.org/userguide/index.html#N1200A n Q: Is designing process models only available as Eclipse plug-in? A: No! See the Activiti Modeler: http://bpmn20inaction.blogspot.nl/2012/09/activiti-modeler-getting-started-part-1.html Signavio Process Editor: http://www.signavio.com/products/process-editor/process-modeling/ 36
  48. DevFest 2012 – November 10th 2012 | Vienna plexiti ·

    pragmatic software productions 37 Thanks! Rafael Cordones, [email protected], @rafacm DevFest 2012, November 10th, 2012, Vienna