Introducing Activiti: A Glimpse and (Hopefully) a Hook

D17a00b60f2fed48423cd5016995a3a7?s=47 plexiti GmbH
November 10, 2012

Introducing Activiti: A Glimpse and (Hopefully) a Hook

DevFest Vienna 2012

D17a00b60f2fed48423cd5016995a3a7?s=128

plexiti GmbH

November 10, 2012
Tweet

Transcript

  1. Introducin Rafael Cordones, rafael.cordones@plexiti.com, @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_ limpse_and_a_hook.html
  2. DevFest 2012 – November 10th 2012 | Vienna plexiti ·

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

    pra matic software productions How did I et here? n Some back round information about myself: n Barcelonian by birth, European by choice. Currently livin in Vienna. n Experience workin for small companies developin web-based software products for business customers n Inoculated a ainst 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 si navio, companies that develop products I mention in this presentation. 3
  4. DevFest 2012 – November 10th 2012 | Vienna plexiti ·

    pra matic software productions How did you et here? n How many of you have experience with Java development? n How many of you are familiar with inte ration projects (B2B)? n How many of you are familiar with Activiti, jBPM or other business process en ines? 4
  5. DevFest 2012 – November 10th 2012 | Vienna plexiti ·

    pra matic software productions How did we et 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 ·

    pra matic software productions How did we et here? n The first (never built) eneral-purpose device that could be pro rammed. Charles Babba e's blueprint for the Analytical En ine from the 1830s: 6 Seems it will be built after all! http://plan28.or / Source: http:// re oryreher.com/2010/11/buildin -charles-babba es-analytical-en ine/
  7. DevFest 2012 – November 10th 2012 | Vienna plexiti ·

    pra matic software productions How did we et here? n The first electronic eneral-purpose di ital computer: the ENIAC (1946) 7 Text Source: http://en.wikipedia.or /wiki/ENIAC
  8. DevFest 2012 – November 10th 2012 | Vienna plexiti ·

    pra matic software productions How did we et here? n The first electronic eneral-purpose di ital computer: the ENIAC (1946) 7 Text Source: http://en.wikipedia.or /wiki/ENIAC Flexible plu -in architectures are not that new after all!
  9. DevFest 2012 – November 10th 2012 | Vienna plexiti ·

    pra matic software productions How did we et here? n “Hello World” in Assembly lan ua e 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 lan ua e (or technolo y) allows you to express and evaluate concepts. Sources: http://en.wikipedia.or /wiki/X86_assembly_lan ua e#.22Hello_world. 21.22_pro ram_for_Linux_in_NASM_style_assembly http://en.wikipedia.or /wiki/Java_(pro rammin _lan ua e)#Hello_world
  10. DevFest 2012 – November 10th 2012 | Vienna plexiti ·

    pra matic software productions How did we et here? 9 Source: http://en.wikipedia.or /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 ·

    pra matic software productions How did we et here? 9 Apple Open Shift Amazon Facebook ? Google Source: http://en.wikipedia.or /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 ·

    pra matic software productions How did we et here? 9 Apple Open Shift Amazon Facebook ? Google Source: http://en.wikipedia.or /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 ri ht!
  13. DevFest 2012 – November 10th 2012 | Vienna plexiti ·

    pra matic 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- chan ed-the-world/ or even better, read the book “The Dream Machine: Explorin the Computer A e”!
  14. DevFest 2012 – November 10th 2012 | Vienna plexiti ·

    pra matic 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.or /wiki/ On_the_Internet,_nobody_knows_you're_a_do “On the Internet, nobody knows you’re a do .” “Any fool can write code that a computer can understand. Good pro rammers write code that humans can understand”. -- Martin Fowler
  15. DevFest 2012 – November 10th 2012 | Vienna plexiti ·

    pra matic 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.or /wiki/ On_the_Internet,_nobody_knows_you're_a_do “On the Internet, nobody knows you’re a do .” “Any fool can write code that a computer can understand. Good pro rammers write code that humans can understand”. -- Martin Fowler Which code?! To do what exactly?
  16. DevFest 2012 – November 10th 2012 | Vienna plexiti ·

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

    pra matic software productions Lar e Scale Enterprise Software Development 13 “The Tower of Babel” by Pieter Brue el the Elder (1563). Kunsthistorisches Museum, Vienna.
  18. DevFest 2012 – November 10th 2012 | Vienna plexiti ·

    pra matic software productions n Question: why? One answer: every participant speaks a different lan ua e: n customer’s lan ua e, i.e. the business you are in (insurance, tradin , …) n business analyst lan ua e n pro rammin lan ua e (Java, .NET, Ruby, Python, … idioms) n national lan ua e and culture (Deutsch, En lish, …) 14 From “Understandin Comics: The Invisible Art”. Scott McCloud. 1993. Pa es 194-195. Lar e Scale Enterprise Software Development
  19. DevFest 2012 – November 10th 2012 | Vienna plexiti ·

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

    pra matic 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 oal) for a particular customer or customers.” 16 Source: http://en.wikipedia.org/wiki/Business_process
  21. DevFest 2012 – November 10th 2012 | Vienna plexiti ·

    pra matic software productions When do I need a business process? n Business process modelin acid test*: 1. Lon -runnin : hours, days, weeks, months, years, … 2. Bursty, sleeps most of the time: when awake, a flurry of activities and then finished or to sleep a ain! 3. Persisted state: what happens between different steps or when the application server oes down? 4. Orchestration of system or human communications: who has to do what until when? what happens afterwards? n What about communication? Common shared understandin ? n What about or anizational learnin ? n How lon does it takes us to do X? n Who did what when? 17 * “Essential Business Process Modelin ”, 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 ·

    pra matic software productions Business Process Model and Notation 2.0 n Example: announcin a job position 18 Source: “Praxishandbuch BPMN 2.0” http://www.bpm- uide.de/2012/02/16/praxishandbuch-bpmn-2-0-in-der-3-aufla e/
  23. DevFest 2012 – November 10th 2012 | Vienna plexiti ·

    pra matic software productions Business Process Model and Notation 2.0 n Example: announcin a job position explained… first tastin : 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 ·

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

    pra matic software productions Business Process Model and 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 ·

    pra matic software productions Business Process Model and 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 ·

    pra matic software productions Business Process Model and 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 readin about it, without applyin the information to specific problems and thereby forcin himself to think about what has been read. Furthermore, we all learn best the thin s we have discovered ourselves.” -- Donald Knuth, “The Art of Computer Pro rammin ”* * Via Alexander Daniel: http://lachdrache.wordpress.com/2012/03/11/readin -•-applyin -•-thinkin /
  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 · pra matic software productions Would you like to know more? 22 And THE poster! PDF: http://www.bpmb.de/ima es/BPMN2_0_Poster_EN.pdf Printed: http://www.si navio.com/joomla/de/bpmn-poster.html Get THE book! German: http://www.bpm- uide.de/2012/02/16/ praxishandbuch-bpmn-2-0-in-der-3-aufla e/ En lish: http://www.bpm- uide.de/2012/10/30/real-life- bpmn-2-0-book-now-available-in-en lish/ Get the BPMN 2.0 Examples at: http://www.om .or /c i-bin/doc?dtc/10-06-02
  29. DevFest 2012 – November 10th 2012 | Vienna plexiti ·

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

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

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

    pra matic software productions Business Process Model and 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 understandin . Picture sources: http://en.wikipedia.or
  33. DevFest 2012 – November 10th 2012 | Vienna plexiti ·

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

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

    pra matic software productions Meet Activiti n Li ht-wei ht workflow and Business Process Mana ement (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 Inte rates with Sprin n Has a REST API 26 http://activiti.or
  36. DevFest 2012 – November 10th 2012 | Vienna plexiti ·

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

    pra matic software productions Different People, Different Needs 28 Customer Software developers Business analysts System administrators Activiti Desi ner Activiti En ine Activiti Probe Activiti Modeler Activiti Explorer
  38. DevFest 2012 – November 10th 2012 | Vienna plexiti ·

    pra matic software productions Meet Activiti (demo) n Installin and startin the Activiti demo project n Explorin the packa ed examples n Developin process applications: n What about testin ?! --> unit testin your processes n Connectin the process to your business lo ic (services, …) n Deployin the process and related resources n “Usin ” the process n Monitorin the process 29 Hi! I’m Kermit!
  39. DevFest 2012 – November 10th 2012 | Vienna plexiti ·

    pra matic software productions Meet Activiti (demo) n Installin and startin the Activiti demo project n Explorin the packa ed examples n Developin process applications: n What about testin ?! --> unit testin your processes n Connectin the process to your business lo ic (services, …) n Deployin the process and related resources n “Usin ” the process n Monitorin the process 29 Hi! I’m Kermit! I’m Gonzo!
  40. DevFest 2012 – November 10th 2012 | Vienna plexiti ·

    pra matic software productions Meet Activiti (demo) n Installin and startin the Activiti demo project n Explorin the packa ed examples n Developin process applications: n What about testin ?! --> unit testin your processes n Connectin the process to your business lo ic (services, …) n Deployin the process and related resources n “Usin ” the process n Monitorin the process 29 Hi! I’m Kermit! I’m Gonzo! And I’m Fozzie!
  41. DevFest 2012 – November 10th 2012 | Vienna plexiti ·

    pra matic 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 toolin : desi ner, cockpit, cycle, … n Full featured comparison here: http://www.camunda.com/fox/product/features/ n Development and production support n camunda employs a ood portion of the Activiti core developers n Open Source Community Edition also available! http://www.camunda.com/fox/ n camunda fox open source strate y: http://www.bpm- uide.de/2012/02/17/camunda-fox-open-source-strate y/ 30
  42. DevFest 2012 – November 10th 2012 | Vienna plexiti ·

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

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

    pra matic software productions Conclusions n BPMN 2.0 process dia rams as n means of communication and sharin knowled e between project participants n executable in an open-source business process en ine 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 implementin what brin s value. n There’s no silver bullet! “No Silver Bullet — Essence and Accidents of Software En ineerin ” http://www.cs.nott.ac.uk/~cah/G51ISS/Documents/NoSilverBullet.html “All non-trivial abstractions, to some de ree, are leaky” http://www.joelonsoftware.com/articles/LeakyAbstractions.html 33
  45. DevFest 2012 – November 10th 2012 | Vienna plexiti ·

    pra matic 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 En ine leicht ewichti in die Java-Welt brin t” 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.or / Discount code available on the Activiti website! http://activiti.or /
  46. DevFest 2012 – November 10th 2012 | Vienna plexiti ·

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

    pra matic software productions Answers to Discussion Questions n Q: “Since you are usin EL expressions, are you forced to use JSF?” A: No! Check out this cool An ularJS-based demo for camunda fox by Daniel Meyer and Nico Rehwaldt: Demo: http://showcase-camundafox.rhcloud.com/fruit-shop/app/index.html Code: https:// ithub.com/meyerdan/order-processin -demo n Q: I presume Activiti is only for Java-based projects, or? A: No! Activiti also offers a REST API! http://activiti.or /user uide/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.or /user uide/index.html#N1200A n Q: Is desi nin process models only available as Eclipse plu -in? A: No! See the Activiti Modeler: http://bpmn20inaction.blo spot.nl/2012/09/activiti-modeler- ettin -started-part-1.html Si navio Process Editor: http://www.si navio.com/products/process-editor/process-modelin / 36
  48. DevFest 2012 – November 10th 2012 | Vienna plexiti ·

    pra matic software productions 37 Thanks! Rafael Cordones, rafael.cordones@plexiti.com, @rafacm DevFest 2012, November 10th, 2012, Vienna