{"id":734,"date":"2011-03-27T22:29:00","date_gmt":"2011-03-27T20:29:00","guid":{"rendered":""},"modified":"2023-03-23T14:14:15","modified_gmt":"2023-03-23T13:14:15","slug":"activiti-are-you-ready-for-bpmn-2-0","status":"publish","type":"post","link":"https:\/\/touk.pl\/blog\/2011\/03\/27\/activiti-are-you-ready-for-bpmn-2-0\/","title":{"rendered":"Activiti &#8211; are you ready for BPMN 2.0?"},"content":{"rendered":"<div>\n  From the beginning of this year I got quite involved in project called\u00a0<a href=\"http:\/\/www.activiti.org\/\">Activiti<\/a>. It\u2019s a \u201clight-weight workflow and Business Process Management (BPM) Platform\u201d (according to creators. The project is led by JBPM creators \u2013 Tom Bayens and Joram Barrez and is backed by Alfresco and several other companies. I also contributed some small features :) Activiti has already made some noise in BPM world \u2013 check\u00a0<a href=\"http:\/\/jtonedm.com\/2010\/08\/31\/first-look-alfresco-activiti\/\">this<\/a>,\u00a0<a href=\"http:\/\/www.jorambarrez.be\/blog\/2010\/05\/19\/reactions-to-the-activiti-launch\/\">this<\/a>,\u00a0<a href=\"http:\/\/www.bp-3.com\/blogs\/2010\/05\/will-open-source-software-meet-the-challenge-activiti-enters-the-ring\/\">or this<\/a>, and of course\u00a0<a href=\"http:\/\/www.infoq.com\/news\/2010\/12\/activiti_5_released\">InfoQ<\/a>.\n<\/div>\n<div>\n  So, what\u2019s the fuss all about? What makes Activiti special? Of course \u2013 it depends what are you comparing it with. My experience involves mainly working with open source BPEL implementation, but I think some points remain valid.\n<\/div>\n<p>So, here is my list of distinctive features:<\/p>\n<p><strong>BPMN 2.0 support<\/strong> I took quite a lot of time for this spec to arrive, but it\u2019s finally here. The biggest step ahead comparing with BPMN 1.x is execution model \u2013 no more BPEL, you can use the same diagram for modelling and execution, and it has proper xsd schema! Of course, it won\u2019t solve all round-trip headaches, but I think it\u2019s quite important improvement. XML describing BPMN 2.0 process consists of nodes definitions and transition definitions: Activiti is one of the first BPM engines offering BPMN 2.0 support. Currently not all nodes are supported, but the list includes:<br \/>\n*   exclusive and paralell gateways \u00a0<\/p>\n<ul>\n<li>\n<p>timer boundary and intermediate events (timer start event almost ready) \u00a0 \u00a0<\/p>\n<\/li>\n<li>\n<p>various tasks: script, user, service, manual, rules, receive \u00a0 \u00a0<\/p>\n<\/li>\n<li>\n<p>error events and handling them \u00a0 \u00a0<\/p>\n<\/li>\n<li>\n<p>subprocesses (both embedded or not) \u00a0 \u00a0 Not all of these nodes are fully defined in spec \u2013 e.g. it does not describe how service task invocation should look like. Therefore, Activiti comes with a set of custom extensions. They are meant to be as non-intrusive as possible \u2013 to make processes more portable. One of most commonly used are ones for describing service task behaviour: Another useful extension enables to associate html form and candidate user with user task: One of nice features of BPMN 2.0 is also providing xml schema for describing process diagram \u2013 aka Diagram Interchange. This enables good engines (such as Activiti ;)) to generate process diagram just on the basis of xml definition \u2013 which makes importing processes modelled in some external tool much easier. It looks like this: Maybe not too beautiful, but usable.<\/p>\n<\/li>\n<\/ul>\n<p><strong>Goal of supporting full BPM cycle<\/strong><\/p>\n<div>\n  Do you (still) believe that future tools for creating business processes will allow users to get rid of developers? I do not\u2026 Unless of course, business people will learn how to code ;) Otherwise what we\u2019ll be left with are some nice zero-coding tools which look great on 15minutes (or event 2hours if they\u2019re exprensive enough) but after running into real-life problems will demand extensive hacking.\n<\/div>\n<div>\n  Activiti pursues different goal, and proposes developing\u00a0<a href=\"http:\/\/www.activiti.org\/cycle.html\">process cycle layer<\/a>. Key points of this proposition are: <\/p>\n<ul>\n<li>\n      zero coding solutions won\u2019t work\n    <\/li>\n<li>\n      analysts are needed to model the process, developers are needed to create executable processes, and operations are needed to deploy and monitor them\n    <\/li>\n<li>\n      each of these groups have their own set of tools which they\u2019re familiar with\n    <\/li>\n<li>\n      so let\u2019s not reinvent the wheel but encourage them to collaborate but use their set of tools\n    <\/li>\n<\/ul>\n<p> So, how to achieve this? By creating another web application, of course ;) It\u2019s name is Activiti Cycle and it\u2019s meant to encourage collaboration between business, developers and operations, while allowing each of them to use their own, specific tools in their daily job. It\u2019s more like a federated repository of BPM assets, such as Visio Diagrams, BPMN process definitions, maven process projects, deployment packages and so on. These artifacts can be linked, commented and tracked by various process stakeholders and also transformed.\n<\/p><\/div>\n<p><strong>Easy to embed and extend, also by quasi-REST API<\/strong><\/p>\n<div>\n  One of biggest pains of BPEL based solutions is that they force you to integrate with the rest of you app using webservices. Fortunately, this is no longer the case. You can embed activiti engine in your (for example) Spring application just by importing few jars and configuring it as any other Spring component:\n<\/div>\n<div>\n<\/div>\n<div>\n  This is of course great for running processes that handle some Java tasks. What about user tasks? Activiti comes with decent webapps for handling human tasks and monitoring process state: <strong>Activiti Explorer<\/strong>\u00a0\u2013 screens shows the list of tasks for a given user: \u00a0 <\/p>\n<div>\n    <a href=\"http:\/\/4.bp.blogspot.com\/-gOIMcWbLP9A\/TY-X2oBwHaI\/AAAAAAAAAFg\/3KI-YMf_qgU\/s1600\/activiti.explorer.tasks.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/4.bp.blogspot.com\/-gOIMcWbLP9A\/TY-X2oBwHaI\/AAAAAAAAAFg\/3KI-YMf_qgU\/s320\/activiti.explorer.tasks.png\" alt=\"\" width=\"320\" height=\"184\" border=\"0\" \/><\/a>\n  <\/div>\n<p>  <strong>Activiti Probe<\/strong>\u00a0\u2013 screen shows monitoring process instance: \u00a0 <\/p>\n<div>\n    <a href=\"http:\/\/4.bp.blogspot.com\/-x2okpQjhftg\/TY-Xpmy8xNI\/AAAAAAAAAFY\/W6uePH_VF9Q\/s1600\/activiti.probe.processes.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/4.bp.blogspot.com\/-x2okpQjhftg\/TY-Xpmy8xNI\/AAAAAAAAAFY\/W6uePH_VF9Q\/s320\/activiti.probe.processes.png\" alt=\"\" width=\"320\" height=\"202\" border=\"0\" \/><\/a>\n  <\/div>\n<p> But what if you want to\/have to use some other frontend technology? Webapps that I mentioned before are really thin clients \u2013 all logic is hidden behind Activiti\u2019s quasi-REST API (I use the word quasi not to be beaten by RESTafarians who will surely point out that Activiti API is just RPC over HTTP\u2026). That means you can embed Activiti in you webapps\/OSGi container\/any other environment and integrate with frontend webapps using handy JSON\/HTTP communication. Which looks more or less like this: <\/p>\n<p>  <strong>Using (defacto) standards<\/strong> When you create application using Activiti chances are high that you know many (if not all) building blocks & techniques: <\/p>\n<ul>\n<li>\n      development? Eclipse plugin & maven\n    <\/li>\n<li>\n      connecting components together? you can choose: spring or (for JEE6 lovers) CDI\n    <\/li>\n<li>\n      testing? just do your normal TDD (you do it, right? ;)) using Activiti JUnit testing utils\n    <\/li>\n<\/ul>\n<p> Eclipse plugin includes visual modeler, which enables you to draw executable BPMN 2.0 processes, and fill all needed properties: <\/p>\n<div>\n    <a href=\"http:\/\/3.bp.blogspot.com\/-BjWpaefFFDA\/TY-ZRAvBUtI\/AAAAAAAAAFo\/_U1ExSNyBx8\/s1600\/designer.sequence.condition.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/3.bp.blogspot.com\/-BjWpaefFFDA\/TY-ZRAvBUtI\/AAAAAAAAAFo\/_U1ExSNyBx8\/s320\/designer.sequence.condition.png\" alt=\"\" width=\"320\" height=\"201\" border=\"0\" \/><\/a>\n  <\/div>\n<p> It uses Diagram Interchange format, so process diagram layout will remain the same when displaying process diagram in other applications. Testing is also pretty easy, as Activiti comes with good JUnit support. One of small, but important features is ability to simulate the clock \u2013 very handy when dealing with long running tasks. <\/p>\n<p>  <strong>Good integration capabilities<\/strong> <\/p>\n<div>\n    Activiti comes with capabilities allowing for integration with three most popular open source integration frameworks: <\/p>\n<ul>\n<li>\n        Mule ESB \u2013 integration is written by MuleSoft\n      <\/li>\n<li>\n        SpringIntegration, contributed by SpringSource\n      <\/li>\n<li>\n        last but cetainly not least: Apache Camel \u2013 which is contributed by TouK ;) \u2013 it\u2019s still work in progress, but I hope to write a blog post soon about integrating Camel & Activiti\n      <\/li>\n<\/ul>\n<p> This allows to build processes that are closer to orchestration than simple workflows, containing only (or mostly) human tasks. Each of these integration frameworks comes with a vast collection of adapters using all popular (and not so popular) communication protocols. This allows process engine to concentrate on the process, and not on the communication details.\n  <\/p><\/div>\n<p>  <strong>Summary<\/strong> I think it\u2019s quite impressive set of features for a product that is less than year old. And what are Activiti plans for the future? Tom Bayens recently\u00a0<a href=\"http:\/\/processdevelopments.blogspot.com\/2011\/03\/unveiling-next-steps-of-alfrescos.html\">announced<\/a>\u00a0that Activiti is going to support some sort of Adaptive Case Management \u2013 which is one of top buzzwords in process world. Other goals include: <\/p>\n<ul>\n<li dir=\"ltr\">\n      asynchronous continuations\n    <\/li>\n<li dir=\"ltr\">\n      moving towards full support of BPMN 2.0\n    <\/li>\n<li dir=\"ltr\">\n      extending Activiti Cycle \u2013 check Bernd\u2019s Ruecker\u00a0<a href=\"http:\/\/www.bpm-guide.de\/2011\/03\/22\/the-bpm-roundtrip-with-activiti-cycle\/\">screencast<\/a>\u00a0showing Activiti Cycle approach to handling collaboration between analysts, developers and admins \u2013 it\u2019s quite impressive\n    <\/li>\n<\/ul>\n<p> As for me, I\u2019m finishing adding support for start timer tasks and hope to post something on Activiti-Camel intergration and running Activiti in OSGi environment soon \u2013 especially Apache Servicemix \u2013 so stay tuned. If you\u2019ve found Activiti interesting, please start with 10 minutes\u00a0<\/p>\n<p>  <a href=\"http:\/\/www.activiti.org\/userguide\/index.html#10minutetutorial\">Getting started\u00a0<\/a>guide, and if you know Polish, you can also have a look at my\u00a0<a href=\"http:\/\/www.slideshare.net\/mproch\/activiti-bpmn-20-is-coming\">slides<\/a>\u00a0from Warsaw JUG presentation Thanks for reading my first post on this blog \u2013 hope you liked it.\n<\/div>\n","protected":false},"excerpt":{"rendered":"From the beginning of this year I got quite involved in project called\u00a0Activiti. It\u2019s a \u201clight-weight workflow and&hellip;\n","protected":false},"author":4,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[68],"class_list":{"0":"post-734","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-development-design","7":"tag-java"},"_links":{"self":[{"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/posts\/734","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/comments?post=734"}],"version-history":[{"count":67,"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/posts\/734\/revisions"}],"predecessor-version":[{"id":15642,"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/posts\/734\/revisions\/15642"}],"wp:attachment":[{"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/media?parent=734"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/categories?post=734"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/tags?post=734"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}