<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Jeya</title>
    <description>The latest articles on DEV Community by Jeya (@jeyaauthithan).</description>
    <link>https://dev.to/jeyaauthithan</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F518670%2F2dc19d31-815a-422b-b9b9-fddbebe95fa7.png</url>
      <title>DEV Community: Jeya</title>
      <link>https://dev.to/jeyaauthithan</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jeyaauthithan"/>
    <language>en</language>
    <item>
      <title>Optimistic lock exception in Camunda engine</title>
      <dc:creator>Jeya</dc:creator>
      <pubDate>Tue, 22 Nov 2022 08:44:40 +0000</pubDate>
      <link>https://dev.to/jeyaauthithan/optimistic-lock-exception-in-camunda-engine-499o</link>
      <guid>https://dev.to/jeyaauthithan/optimistic-lock-exception-in-camunda-engine-499o</guid>
      <description>&lt;p&gt;Hey there! &lt;/p&gt;

&lt;p&gt;If you want to understand the Optimistic lock exception which occurs in Camunda engine most of the times and if you would like to debug it and tweak it according to your needs, you are in the right place.&lt;br&gt;
At the end of this article, you will be able to understand the reason for Optimistic lock exception occurrence and way to avoid this in Camunda engine.&lt;/p&gt;

&lt;p&gt;Let’s get started.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why it occurs?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Optimistic lock exception occurs in the DB when there is concurrent transaction.&lt;/p&gt;

&lt;p&gt;For ex. There is a row in table (say R1), which is getting updated via two different transactions. That is when one transaction successfully updates the Row R1, whereas the other gets the exception.&lt;/p&gt;

&lt;p&gt;In Camunda tables, for each row, version will be maintained (column rev_). Whenever there is an update in the row, version gets increased. So, when there are concurrent transactions, both rows get a same version of row and tries to update. One transaction’s update will be successfully done, version will be increased, whereas the other transaction’s update will fail with Optimistic exception as it is trying to update lower version of row. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpigekf8oqoy0qrw6cmw6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpigekf8oqoy0qrw6cmw6.png" alt="Image description" width="800" height="51"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Where it occurs?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
In the join gateway of parallel/inclusive gateway.
When the parallel processes finish at same time and both the executions reaches the join gateway at the same time, both the executions will be trying to update the job information. One of them would get success and other would get the exception.
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbqjsjpgxpyrq0t40sc5p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbqjsjpgxpyrq0t40sc5p.png" alt="Image description" width="800" height="344"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
In the
tasks which is present in between parallel/inclusive gateway fork and join. If the tasks are async before or after, the When we use same variable name in both the execution, when engine tries to persist the data into DB, there is a possibility of getting the exception, both executions may try to persist the variable at the same time.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;How to resolve?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;1.For resolving this issue, Camunda engine has a concept of job retry. Whenever engine gets job exception, it attempts to retry the task (whichever tasks exists after last save point). This would come handy in many places. By default, number of retries will be 3. We can reduce this or disable by explicitly configuring it.&lt;br&gt;
If the process is transactional and retrying the task may impact the workflow progression and there is no data dependency on the Camunda tables (Camunda variables are not used outside the current process), then we can simply disable the Camunda engine retry configuration.&lt;/p&gt;

&lt;p&gt;Retry configuration can be done in two places,  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Task level&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Engine level&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For configuring in task level, in BPMN process, in the async task properties, there will be Retry Time Cycle, this can be set as R0/PT5S (Retry zero times for every 5 seconds).  This will override the default configuration.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbz2manfrdn8ip2fyhcht.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbz2manfrdn8ip2fyhcht.png" alt="Image description" width="800" height="326"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For configuration in engine level, we can use below.&lt;br&gt;
    engineConfiguration.setFailedJobRetryTimeCycle("R0/PT5S")&lt;/p&gt;

&lt;p&gt;2.If we implement the first solution, job will not be retried, and whichever execution gets committed first will be present in DB. This holds good for join gateway exception.&lt;br&gt;
But, in case the exception is in the task in-between the fork and join gateway due to the user defined variable, this needs to be sorted out in the code. If not, one of the parallel process would get stuck in the task where it got the Optimistic lock exception and engine will assume that job is finished as the retry value would be zero.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Try to use unique variable names in the execution wherever there is a parallel process. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Configure exclusive job in the parallel process. &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Hope this gives some idea on how Camunda engine works internally.&lt;/p&gt;

&lt;p&gt;Happy debugging! 😊&lt;/p&gt;

</description>
      <category>tooling</category>
      <category>productivity</category>
    </item>
    <item>
      <title>BPM notations</title>
      <dc:creator>Jeya</dc:creator>
      <pubDate>Sun, 20 Feb 2022 15:00:04 +0000</pubDate>
      <link>https://dev.to/jeyaauthithan/bpm-notations-nm2</link>
      <guid>https://dev.to/jeyaauthithan/bpm-notations-nm2</guid>
      <description>&lt;p&gt;In previous article, we have used basic notations to create BPMN and learned about how to integrate REST API with BPMN. If you have not gone through yet, follow this link: &lt;br&gt;
&lt;a href="https://dev.to/jeyaauthithan/integrating-rest-api-with-bpmn-4mph"&gt;https://dev.to/jeyaauthithan/integrating-rest-api-with-bpmn-4mph&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;At the end of this article, you will be able to get a better understanding on more BPM notations and how to start the process instance. &lt;/p&gt;

&lt;p&gt;Let’s get started!&lt;/p&gt;

&lt;h2&gt;
  
  
  Notations:
&lt;/h2&gt;

&lt;p&gt;&lt;u&gt;Send Task:&lt;/u&gt;&lt;br&gt;
Implementation of Send task is same as service task, only difference is the way we want to represent the symbols in our BPMN. For ex. If we are making external system calls, to make it precise that request is being send, Send Task can be used.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--YLfuvkAK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7cn376sx8yfjy12din79.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--YLfuvkAK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7cn376sx8yfjy12din79.png" alt="Image description" width="463" height="420"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;u&gt;Receive Task:&lt;/u&gt;&lt;br&gt;
In this task, BPMN is expected to receive the data from external system. Hence, whenever execution reaches this task, it waits till someone invokes it with the response. We can have more than one ‘receive’ task in the BPMN file. Each receive task will have its own unique message name to differentiate it from each other. External system can invoke the task by correlating to its message name.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--XrfUtRuW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kbgqf6nxb7kn531z988d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--XrfUtRuW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kbgqf6nxb7kn531z988d.png" alt="Image description" width="387" height="430"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;u&gt;User Task:&lt;/u&gt;&lt;br&gt;
This task specifies that we need some user inputs before proceeding with the workflow. When execution reaches this task, it waits till user completes the task with necessary inputs. This task can be completed via cockpit or internal REST API of Camunda engine.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--IY4dltYL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y0cr7jww2xw2ws6ldfas.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--IY4dltYL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y0cr7jww2xw2ws6ldfas.png" alt="Image description" width="393" height="398"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;u&gt;Call Activity:&lt;/u&gt;&lt;br&gt;
Call activity can be used to invoke a BPMN within a BPMN process. It is&lt;br&gt;
same as calling a method inside another method. If there are some BPMN process&lt;br&gt;
which can be reused inside another BPMN, this call activity can be configured&lt;br&gt;
with the called BPMN process id.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--E4_fZJ1V--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rlnehakg8oo6ggcbxco0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--E4_fZJ1V--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rlnehakg8oo6ggcbxco0.png" alt="Image description" width="423" height="414"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;u&gt;Parallel Gateway:&lt;/u&gt;&lt;br&gt;
Using Parallel Gateway, we can have more than one sequence flows which&lt;br&gt;
will be executed in parallel. This will split the flow into concurrent paths. The&lt;br&gt;
paths are executed concurrently and independently.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--zz9ZNZRP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fluq223ep9oieazy7eqm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--zz9ZNZRP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fluq223ep9oieazy7eqm.png" alt="Image description" width="519" height="325"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;u&gt;Inclusive Gateway:&lt;/u&gt;&lt;br&gt;
This is combination of both exclusive and parallel gateway. The Inclusive Gateway represents the need to decide where all conditions must be evaluated. Whilst the Inclusive Gateway can be used to show that all paths must be taken, it should be used in such a way that at least one of the paths is taken.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--fyJB5knm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k0w719maqe8q5kh89hz9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--fyJB5knm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k0w719maqe8q5kh89hz9.png" alt="Image description" width="492" height="325"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;u&gt;Pool/Participant and Lanes:&lt;/u&gt; &lt;br&gt;
Pool/Participant can be used for orchestrating the process. We can write BPMNs without Pools and lanes as well. In cases where we want to have clear view and step by step segregation of activities/tasks, we can make use of this. We can add as many lanes as we want in a pool.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--GPOx__w---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d0belenuh704x52dmpuh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--GPOx__w---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d0belenuh704x52dmpuh.png" alt="Image description" width="198" height="548"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Process using pools and lanes:&lt;br&gt;
       &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--5DLEKY5k--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/61svabnegt4ccvjls8um.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5DLEKY5k--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/61svabnegt4ccvjls8um.png" alt="Image description" width="880" height="419"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;u&gt;Embedded subprocess:&lt;/u&gt;&lt;br&gt;
This allows us to group elements of the process. Few scenarios where we can make use of this:&lt;br&gt;
• When we need to run set of tasks in loop&lt;br&gt;
• When we need to use Boundary events (will see about Events in detail in next article).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--I91-FOWm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c4wx09vt1zswc4dlcqgn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--I91-FOWm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c4wx09vt1zswc4dlcqgn.png" alt="Image description" width="179" height="424"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Process using embedded subprocess:&lt;br&gt;
      &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Jd3d2UlP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cecz3w8ygmk4utb7rrg7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Jd3d2UlP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cecz3w8ygmk4utb7rrg7.png" alt="Image description" width="880" height="304"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How to start process instance:
&lt;/h2&gt;

&lt;p&gt;As in previous article, we learnt how to deploy BPMN process, lets see how to start the process execution.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Find your process Id by opening the BPMN in the Camunda modeler and check “id” field in properties panel.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Start the spring boot application and call below end point with the process id. This is internal REST end point exposed by Camunda engine.&lt;br&gt;
Method: POST&lt;br&gt;
URL: &lt;a href="http://localhost:8080/service/demo/rest/engine-rest/process-definition/key/ProcessId/start"&gt;http://localhost:8080/service/demo/rest/engine-rest/process-definition/key/ProcessId/start&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Viola! This will create process instance for your process.&lt;/p&gt;

&lt;p&gt;Once process instance started, all the tasks will be executed and if no failures, process instance will end. &lt;/p&gt;

&lt;p&gt;Let’s add wait task to our BPMN and check the process execution via cockpit:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--rF_IDpV2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/algze3nbbrconf94nftt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--rF_IDpV2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/algze3nbbrconf94nftt.png" alt="Image description" width="880" height="330"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Deploy this process in the engine and start the process instance.&lt;br&gt;
In Cockpit, we can see the process instances which is waiting for user action.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3-424_Ht--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hkrtjuslyj8zekz7x3oc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3-424_Ht--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hkrtjuslyj8zekz7x3oc.png" alt="Image description" width="880" height="368"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;On click of process instance id highlighted above, we can see variables stored in the process instance.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--OUf23Fww--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z5jnjda6cw6s08wjjyve.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--OUf23Fww--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z5jnjda6cw6s08wjjyve.png" alt="Image description" width="880" height="372"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let’s complete the wait task and progress the process instance.&lt;/p&gt;

&lt;p&gt;In above screen, navigate to User Tasks tab, click on the taskId and it will get you to the Camunda tasklist screen.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--bJqarJ_k--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d1qr8m905byo604d6dsn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--bJqarJ_k--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d1qr8m905byo604d6dsn.png" alt="Image description" width="880" height="288"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this screen, on click of Claim button, complete button will be enabled. Click on complete button and we can see process instance getting completed.&lt;/p&gt;

&lt;p&gt;Hope you understood more notations used in BPMN and how to start the process instance in this article. &lt;/p&gt;

&lt;p&gt;Try creating BPMN with the notations you have learned so far and start the process instance and check out the behaviour. Drop a comment in case of any queries. &lt;/p&gt;

&lt;p&gt;Let’s learn about Events and error handling in next article.&lt;/p&gt;

&lt;p&gt;Happy Learning! 😊&lt;/p&gt;

</description>
      <category>camunda</category>
      <category>beginners</category>
      <category>workflowengine</category>
    </item>
    <item>
      <title>Integrating Rest API with BPMN</title>
      <dc:creator>Jeya</dc:creator>
      <pubDate>Tue, 15 Feb 2022 19:30:18 +0000</pubDate>
      <link>https://dev.to/jeyaauthithan/integrating-rest-api-with-bpmn-4mph</link>
      <guid>https://dev.to/jeyaauthithan/integrating-rest-api-with-bpmn-4mph</guid>
      <description>&lt;p&gt;In previous article, we learned about how to create BPMN and set up an environment. If you have not gone through yet, follow this link: &lt;a href="https://dev.to/jeyaauthithan/how-to-get-started-with-camunda-platform-5eik"&gt;https://dev.to/jeyaauthithan/how-to-get-started-with-camunda-platform-5eik&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;At the end of this article, you will be able to write your own BPMN and integrate with REST API. &lt;/p&gt;

&lt;p&gt;Let’s get started!&lt;/p&gt;

&lt;p&gt;As we have already downloaded bpm spring boot project , Lets add below dependency in pom.xml to make use of Groovy scripting in BPMN.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;      &amp;lt;dependency&amp;gt;
         &amp;lt;groupId&amp;gt;org.codehaus.groovy&amp;lt;/groupId&amp;gt;
     &amp;lt;artifactId&amp;gt;groovy-all&amp;lt;/artifactId&amp;gt;
     &amp;lt;version&amp;gt;3.0.0-rc-2&amp;lt;/version&amp;gt;
     &amp;lt;type&amp;gt;pom&amp;lt;/type&amp;gt;
  &amp;lt;/dependency&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;We have below BPMN with us which we created in previous article. Now let’s integrate it with Business logic.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpss5mcs4z5aj0r1wlmxo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpss5mcs4z5aj0r1wlmxo.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;T1 is the service task which can be used to integrate with REST APIs.&lt;/p&gt;

&lt;p&gt;In Camunda modeler, Click on T1 and expand Properties panel which is present in right middle.&lt;br&gt;
In properties panel we can see id, name, Implementation dropdown. Leave id and name as is and click on Implementation dropdown.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxr7vhqkuwi5vv61zgu8l.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxr7vhqkuwi5vv61zgu8l.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Choose “Connector” option to integrate Rest API. Upon selection, the link “Must Configure Connector” will appear. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjejj1gya8zasgvpe15a6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjejj1gya8zasgvpe15a6.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click on the link and you will be directed to the next tab. &lt;br&gt;
Before filling the values, lets checkout the fields here.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Connector-id: We can provide “http-connector” for REST call integration and “soap-http-connector” for Soap call integration.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Input parameters: These are the parameters required to make the REST call. &lt;br&gt;
  url – End point of REST API&lt;br&gt;
  method – HTTP method (ex. GET, POST, PATCH, PUT, DELETE etc.)&lt;br&gt;
  headers – HTTP headers&lt;br&gt;
  payload – Request payload (Not applicable for GET method)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now that you understood these input parameters, click on the “+” symbol next to Input parameters and fill the values as shown in below screenshots:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh3w9ubwwrodh34hvc282.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh3w9ubwwrodh34hvc282.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn0q3qvpukxnj4pdzk574.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn0q3qvpukxnj4pdzk574.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0zcci4v5p77iz55nc9dp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0zcci4v5p77iz55nc9dp.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Output parameters: These are the parameters we are expecting to receive from the REST API.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;statusCode – HTTP status code which denotes the request status (ex. 200, 201, 500)&lt;/li&gt;
&lt;li&gt;headers – HTTP response headers&lt;/li&gt;
&lt;li&gt;response – response body returned from REST API.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let’s fill output parameters as shown in below screenshot.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy0dwlvyi8kgcissr0sau.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy0dwlvyi8kgcissr0sau.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now that REST API is integrated and we have response for Checking ticket availability, We can write the logic and add condition to our sequence flow.&lt;br&gt;
Add one more output parameter and store the variable with the result (preferably Boolean).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwa6cb5ikukpr9z66qvt5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwa6cb5ikukpr9z66qvt5.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Use this variable and add condition in the Sequence flow.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjfrrwfndda0wuodbr9mp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjfrrwfndda0wuodbr9mp.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We have used conditionType as Expression which will be of below format:&lt;br&gt;
Format: ${conditions}&lt;br&gt;
Ex. ${condition1 &amp;amp;&amp;amp; condition2 || condition3}&lt;/p&gt;

&lt;p&gt;As for second “Ticket Not available” sequence, we can either add negative condition of same flag or we can set it as default sequence flow. &lt;br&gt;
Sequence flow which is marked as Default will be chosen if no other sequence flow(s) conditions are met.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhhr7r2topnm62cc201m1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhhr7r2topnm62cc201m1.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now for our T2 task, as it is script task, we can incorporate any business logic. Instead of directly integrating REST API from bpm, if we choose to do it in microservice layer, we can write the code to make Rest call in our microservice class and invoke it from bpm.&lt;/p&gt;

&lt;p&gt;Checkout below script. utilityClass is the object of the class which contains method bookTicket.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqed7y6aa4n08iyxbjerb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqed7y6aa4n08iyxbjerb.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In other script tasks T3, T4, T5, Lets simply put print statements.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxwb9zb2popisf1tt84h7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxwb9zb2popisf1tt84h7.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How to deploy BPMN in the engine:
&lt;/h2&gt;

&lt;p&gt;If you have not yet integrated the BPMN with REST API, make all the tasks as script tasks and add some print statements and try deploying it engine in by following below steps.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Place the BPMN in src/main/resources folder in the Spring boot microservice.&lt;/li&gt;
&lt;li&gt;Start the microservice. All the BPMNS placed in src/main/resources will be deployed into engine automatically.&lt;/li&gt;
&lt;li&gt;Open Camunda GUI URL:
&lt;a href="http://localhost:8080/service/demo/rest/camunda/app/welcome/default/#!/welcome" rel="noopener noreferrer"&gt;http://localhost:8080/service/demo/rest/camunda/app/welcome/default/#!/welcome&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Login with default username and password configured in the 
 application.yaml file&lt;/li&gt;
&lt;li&gt;Click on cockpit&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Under process definition, we can see the processes deployed. Currently we can see 1 process deployed.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa4xt1lagosagpm56v294.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa4xt1lagosagpm56v294.png" alt="Image description"&gt;&lt;/a&gt;&lt;br&gt;
On click of the process name, we can see the BPMN we created. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyt7nodiby1eyz5tds4we.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyt7nodiby1eyz5tds4we.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We can debug running and failed process instances here along with error message.&lt;br&gt;
Take your time and explore the options here in GUI.&lt;/p&gt;

&lt;p&gt;Hope you understood how to integrate REST API with BPMN in this article. Let’s see about more notations and its usages and also how to start process instance in the next article.&lt;/p&gt;

&lt;p&gt;Happy Learning! 😊&lt;/p&gt;

</description>
      <category>camunda</category>
      <category>beginners</category>
      <category>workflowengine</category>
    </item>
    <item>
      <title>How to get started with BPM Platform</title>
      <dc:creator>Jeya</dc:creator>
      <pubDate>Tue, 01 Feb 2022 07:42:48 +0000</pubDate>
      <link>https://dev.to/jeyaauthithan/how-to-get-started-with-camunda-platform-5eik</link>
      <guid>https://dev.to/jeyaauthithan/how-to-get-started-with-camunda-platform-5eik</guid>
      <description>&lt;p&gt;If you want to understand how bpm workflow engine works and start writing your own workflows for any business use case, you are in the right place. At the end of this article, you will be able to have your own environment setup for workflow engine and sample BPMN.&lt;/p&gt;

&lt;p&gt;Let’s get started!&lt;/p&gt;

&lt;h2&gt;
  
  
  What is BPM engine?
&lt;/h2&gt;

&lt;p&gt;BPM or process workflow engine is a engine wherein we can orchestrate the set of tasks.&lt;/p&gt;

&lt;p&gt;It provides BPMN (Business Process Management and Notation) which can be embedded in Java applications and with other languages via REST.&lt;br&gt;
BPMN is visual modelling language for Business analysis applications. Using this, we can define our workflows in much more readable way.&lt;/p&gt;

&lt;p&gt;In this article, we will be using BPM engine offered by Camunda.&lt;/p&gt;

&lt;h2&gt;
  
  
  Software requirements
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Camunda modeler:
    &lt;a href="https://camunda.com/download/modeler/"&gt;https://camunda.com/download/modeler/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Camunda platform:
   There are different distributions for various application 
servers. In this tutorial, we will use Spring boot project 
distribution. 
   &lt;a href="https://start.camunda.com/"&gt;https://start.camunda.com/&lt;/a&gt;
In above link, Click on Generate project and the zip file for 
simple Spring boot application will be downloaded. This can be 
imported into any IDE (ex. Eclipse, IntelliJ).&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In src/main/resources path, there will be sample process.bpmn &lt;br&gt;
  file. All the bpmn files we create must be placed in this path.&lt;/p&gt;

&lt;p&gt;Now that our environment setup is ready, Let’s learn how to draw BPMN. &lt;/p&gt;

&lt;h2&gt;
  
  
  Some basic notations
&lt;/h2&gt;

&lt;p&gt;Using Camunda modeler, we can draw BPMN and deploy the same in Camunda engine.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Start event:&lt;br&gt;
  This is used to specify the start of the process. Any pre &lt;br&gt;
  activities can be done here.&lt;br&gt;
 &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--5DbVp85m--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7or4xqebvwt333ndhopk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5DbVp85m--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7or4xqebvwt333ndhopk.png" alt="Image description" width="127" height="318"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Script task:&lt;br&gt;
 This is used for writing any business logic or checks in the &lt;br&gt;
 BPMN internally.&lt;br&gt;
For ex. Basic condition check or validations. Script &lt;br&gt;
 format can be Groovy, JavaScript, or Python.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--YkdDnGgW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pp8mnbpahn2xo74dho7h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--YkdDnGgW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pp8mnbpahn2xo74dho7h.png" alt="Image description" width="418" height="348"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Service task:&lt;br&gt;
  This is used when we want to define the logic externally and &lt;br&gt;
  make a call from BPMN to plug in the logic. It provides &lt;br&gt;
  different implementation options like Java Class, &lt;br&gt;
  Expression, Connector etc. Using connector, we can integrate &lt;br&gt;
  rest calls to external or internal APIs. &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--HAkRiwBo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f2gzw9cvervuwl42i2rr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--HAkRiwBo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f2gzw9cvervuwl42i2rr.png" alt="Image description" width="397" height="306"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Sequence flow:
 This is used to denote the sequence in which process must 
 proceed. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--fzu00mTv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xw82vzjn2tsj1ztolydf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--fzu00mTv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xw82vzjn2tsj1ztolydf.png" alt="Image description" width="207" height="170"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Exclusive gateway:
 As name suggests, this is used for deciding the sequence 
 based on the certain condition. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Vmdc6XQV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4tlr73oc48ul9kkj8x21.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Vmdc6XQV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4tlr73oc48ul9kkj8x21.png" alt="Image description" width="99" height="252"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;End event:
 This is used to specify the end of the process. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--2ornr2Jd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/emmyyf75pi9gzwzn9y6v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--2ornr2Jd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/emmyyf75pi9gzwzn9y6v.png" alt="Image description" width="101" height="283"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Using all the notations we learned above, lets draw a BPMN for below use case.&lt;/p&gt;

&lt;h2&gt;
  
  
  Use case
&lt;/h2&gt;

&lt;p&gt;Booking flight ticket for given source and destination. &lt;/p&gt;

&lt;p&gt;Below could be the BPMN process for achieving the use case. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--rzsZhJWA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5a4uunsoxfayrrsgd56a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--rzsZhJWA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5a4uunsoxfayrrsgd56a.png" alt="Image description" width="880" height="359"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here, T1 is the task to check the ticket availability and we have Exclusive gateway to determine the flow based on the result of T1. If ticket is available, we proceed to T2 or else we proceed with T5.&lt;br&gt;
After T2, again there is the Exclusive gateway which will decide the sequence based on results of T2. If Book ticket task is success, proceed to T3 or else T4.&lt;/p&gt;

&lt;p&gt;Arrows in between the tasks denotes the sequence. Note that, these arrows can be drawn in reverse as well. Wherever the arrow points will decide the flow. So, to proceed from T1 to T2, arrow must be drawn from T1 to T2 not vice versa. &lt;/p&gt;

&lt;p&gt;By deploying above BPMN with all logics and API integration in the Camunda engine, we can test all possible scenarios. Debugging can be done easily via the GUI provided by Camunda engine. Camunda GUI offers Cockpit which can be used to debug the process if it gets failed.&lt;/p&gt;

&lt;p&gt;This is very simple use case with basic notations used.&lt;br&gt;
Camunda BPM provides much more notations to serve complex use cases. &lt;/p&gt;

&lt;p&gt;Hope you understood some basics of Camunda and BPMN in this article. Let’s see how to create Rest API and integrate it with our BPMN and deploy to our Engine in the next article.&lt;/p&gt;

&lt;h2&gt;
  
  
  Few buzz words
&lt;/h2&gt;

&lt;p&gt;&lt;u&gt;Process&lt;/u&gt;:  In BPM engine, every workflow is called as a process and instance of the process is called process Instance. (As in Class and Object).&lt;br&gt;
&lt;u&gt;Task&lt;/u&gt;: Task is the activity we perform inside the process.&lt;br&gt;
Sequence flow: The arrows which determines the path.&lt;br&gt;
&lt;u&gt;Event&lt;/u&gt;: Represented in circles, describes something that happens during process execution. (for ex. start event, end event, error event etc.,.)&lt;br&gt;
&lt;u&gt;Gateway&lt;/u&gt;: This is used to decide the path based on data or condition.&lt;/p&gt;

&lt;p&gt;Happy Learning! 😊&lt;/p&gt;

</description>
      <category>camunda</category>
      <category>beginners</category>
      <category>workflowengine</category>
    </item>
  </channel>
</rss>
