{"id":1028,"date":"2011-08-07T09:02:44","date_gmt":"2011-08-07T07:02:44","guid":{"rendered":"http:\/\/www.pleus.net\/blog\/?p=1028"},"modified":"2023-05-24T09:14:24","modified_gmt":"2023-05-24T07:14:24","slug":"combining-activiti-and-camel","status":"publish","type":"post","link":"https:\/\/www.pleus.net\/blog\/?p=1028","title":{"rendered":"Combining Activiti and Camel?"},"content":{"rendered":"<p>It seems that that ServiceMix\/Camel and Activiti are growing together as you can read in the blog post <a href=\"http:\/\/bpmn20inaction.blogspot.com\/2011\/05\/supersize-activiti-with-mule-esb-and.html\" target=\"_blank\" rel=\"noopener\">Supersize Activiti with Mule ESB and Apache Camel<\/a> and <a href=\"http:\/\/forums.activiti.org\/en\/viewtopic.php?f=4&amp;t=562\" target=\"_blank\" rel=\"noopener\">Deploy Activiti as OSGi Bundles<\/a><\/p>\n<p>Activiti has its roots in business process management, whereas Camel comes from the area of enterprise integration. Both allow to describe and automate processes. Activiti uses BPMN, a graphical modeling language with an XML representation for persistence and execution. Camel uses a textual DSL which can also be expressed in XML. Grahpical modeling is also possible with the <a href=\"http:\/\/fusesource.com\/products\/fuse-ide\/\" target=\"_blank\" rel=\"noopener\">Fuse IDE<\/a>.<\/p>\n<p>BPMN example:<\/p>\n<figure id=\"attachment_1069\" aria-describedby=\"caption-attachment-1069\" style=\"width: 300px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/www.pleus.net\/blog\/wp-content\/uploads\/2011\/08\/mediation-and-business.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-1069\" title=\"BPMN process\" src=\"http:\/\/www.pleus.net\/blog\/wp-content\/uploads\/2011\/08\/mediation-and-business.png\" alt=\"BPMN process\" width=\"300\" height=\"393\" srcset=\"https:\/\/www.pleus.net\/blog\/wp-content\/uploads\/2011\/08\/mediation-and-business.png 300w, https:\/\/www.pleus.net\/blog\/wp-content\/uploads\/2011\/08\/mediation-and-business-229x300.png 229w, https:\/\/www.pleus.net\/blog\/wp-content\/uploads\/2011\/08\/mediation-and-business-114x150.png 114w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-1069\" class=\"wp-caption-text\">BPMN process<\/figcaption><\/figure>\n<p>The BPMN XML representation is not intended to be written directly and can be hard to read.<\/p>\n<p>Camel example:<\/p>\n<pre class=\"brush:java\">from(\"file:\/\/start\")\r\n.choice()\r\n  .when(header(\"goldCustomer\").isEqualTo(\"true\"))\r\n    .to(\"bean:processor?method=grantDiscount\")\r\n    .to(\"direct:out\")\r\n  .otherwise()\r\n    .to(\"direct:out\");\r\n\r\nfrom(\"direct:out\")\r\n.to(\"file:\/\/end\");<\/pre>\n<p>Basically both examples are identical. The Camel example is more explicit and shows more technical details which are hidden in the BPMN example.<\/p>\n<p>Especially non technical users tend to think that a graphical process notation is easier to understand because it looks better. It might be true for simple processes like the one above. But for more complex processes textual DSLs are often easier to write and understand.<\/p>\n<p>Activiti and Camel overlap in many areas. Does it make sense to use them side by side anyway? I think yes, because neither Activiti nor Camel is complete in terms of features required by a fully\u00a0featured\u00a0SOA\/BPM runtime. Actually they complement each other\u00a0very well\u00a0in some areas.<\/p>\n<p>Unique features added by Camel:<\/p>\n<ul>\n<li><strong>Connectivity \/ Adaptors<\/strong> to connect to external systems using a variety\u00a0of different protocols\u00a0<\/li>\n<li><strong>Predefined EIP patterns<\/strong> for\u00a0message routing<\/li>\n<\/ul>\n<p>Unique features added by Activiti:<\/p>\n<ul>\n<li>Support for <strong>long running stateful processes<\/strong><\/li>\n<li><strong>Human workflow<\/strong> integration<\/li>\n<\/ul>\n<p>In order to avoid unnecessary complexity it\u00a0helps to recall the difference between mediation- and business processes which I descibed in my <a href=\"http:\/\/www.pleus.net\/blog\/?p=96\">blog post<\/a> from 2006.<\/p>\n<p>For mediation processes\u00a0Camel is appropriate in most cases, even long running processes can be executed as long as they are stateless.\u00a0But if you need long running stateful processes and human interaction Activiti is an\u00a0interesting\u00a0option.\u00a0<\/p>\n<p>Both Camel and Activiti processes can be modeled using prescriptive and analytical BPMN.\u00a0The\u00a0software designer has the\u00a0responsibility to decide which technology is appropriate for implementing the process. If this is not done\u00a0right you will end up with unnecessary complexity, limited\u00a0agility and maintainability.<\/p>\n<p>It would be\u00a0ideal to have an Open Source SOA\/BPM Platform that enables end to end process automation without technology boundaries. As long as this is not available, combining Activiti and Camel\u00a0is\u00a0an interesting option.\u00a0Proper solution design\u00a0and differentiation of process types\u00a0is key to create sustainable\u00a0solutions.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>It seems that that ServiceMix\/Camel and Activiti are growing together as you can read in the blog post Supersize Activiti with Mule ESB and Apache Camel and Deploy Activiti as OSGi Bundles Activiti has its roots in business process management, whereas Camel comes from the area of enterprise integration. Both allow to describe and automate &hellip; <a href=\"https:\/\/www.pleus.net\/blog\/?p=1028\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Combining Activiti and Camel?<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9,13,3],"tags":[32,34],"class_list":["post-1028","post","type-post","status-publish","format-standard","hentry","category-bpm","category-bpmn","category-soa","tag-activiti","tag-camel"],"_links":{"self":[{"href":"https:\/\/www.pleus.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1028","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.pleus.net\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.pleus.net\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.pleus.net\/blog\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.pleus.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1028"}],"version-history":[{"count":33,"href":"https:\/\/www.pleus.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1028\/revisions"}],"predecessor-version":[{"id":3598,"href":"https:\/\/www.pleus.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1028\/revisions\/3598"}],"wp:attachment":[{"href":"https:\/\/www.pleus.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1028"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.pleus.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1028"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.pleus.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1028"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}