Using a CMMN Sentry as Exit Criterion

When a loan application is not sufficient, for example because it has formal errors, there is no need to provide a customer rating any longer. We can express this in CMMN by adding a sentry which acts as exit criterion.

Add an Exit Sentry

In the modeler, click on the Check Application task to open the context pad, then click on Append Criterion. Move the criterion to the top edge of the Provide Customer Rating task and attach it there. Click on the entry criterion and open the replace menu by clicking on the wrench icon . Now click on Exit Criterion to morph the sentry.

Keep the exit criterion selected and configure the If Part Condition using the properties panel. Insert the following into the text input field: ${!applicationSufficient}

Save the changes in the modeler before continuing.

Re-build and Deploy

Again, rebuild and redeploy the project.

Go to Tasklist and access the demo user’s tasks. As before, check the task Check Application. To trigger the sentry, add the variable applicationSufficient of type Boolean, but this time make sure to leave the check box unchecked. Click .

You will notice that the task Provide Customer Rating has disappeared from the Tasklist. That is because the sentry has been triggered and the task’s exit criterion has been fulfilled. Also, you can check the Tomcat console. This time, there is no log entry for the milestone.

Sentries

To learn more about sentries, consider checking the Sentries section in our CMMN implementation guide.

Catch up: Get the Sources of Step-6.

Download as .zip or checkout the corresponding tag with Git.

You can checkout the current state from the GitHub repository.

If you have not cloned the repository yet, please execute the following command:

git clone https://github.com/camunda/camunda-get-started-cmmn.git

To checkout the current state of the process application please execute the following command:

git checkout -f Step-6
Or download as archive from here.

On this Page: