This is an example of how conditional events can be triggered in Camunda using a simple spring boot project

Overview

Camunda Conditional Events Example

This example is a Spring Boot Application using Camunda. In this example i'll show a variety of ways that BPMN's Conditional Events can be used in your processes so that you can react dynamically to conditions that arrise in your model.

The Process

The BPMN Process in this example attempts to help a patient find the right fictional medical practitioner to help them with their pain.

BPMN Process Image

At various point data entered by the user can trigger an event. For example if you pick Professor Snape from the selection of doctors and complete the task snape

the conditional boundary event on the task will trigger. This is because the front end will set the variable doctorwith the value snapeand the expression on the conditional event is:

#{doctor == 'snape'}

This will then send the process to Go tot he Potoins Room task.

Different types of conditional events

There are lots of way of using conditional events in BPMN and in this example I demonstrate the following:

Intermediate Conditional Event (with Gateway)

ConIntGate This is an example where the process is waiting at a certain point (the gateway) until one of the two events it's waiting for becomes true. Once any one of the events triggeres the process continues along that sequence flow.

Interrupting Conditional Boundary Event.

ConInt

If this expression in this event is triggered it will interrupt the process and move the process will continue following the sequence flow leaving from the event. Feel free to read more about it here in the docs

Non-Interrupting Conditional Boundary Event

ConNonInt If the expression in this event is triggered the task will not be interrupted but a parallel token will flow to connected activity. This event has the potential to be triggered multiple times as long as the task is still active. Read more about it here in the docs

Interrupting Conditional Even Sub Process.

ConSubInt This is an event that is active for the duration of the process instance and if at any point the condition on the event is met the process is interrupted (all other tokens will be cancelled) and the Go To The Emergancy Room task will become active.

Non-Interrupting Conditional Even Sub Process.

ConSubInt This is an event that is active for the duration of the process instance and if at any point the condition on the event is met a token is created in parallel to anything else going on in the process. This can be activated multiple times for each time the condition is met.

Have fun!

Have fun exploring how to trigger all the possible events. If you're really lucky you might be able to trigger a special case where Niall and his hawk will attempt to treat you in the emergency room :)

Running the application

You can also build and run the process application with Spring Boot.

Manually

  1. Build the application using:
mvn clean package
  1. Run the *.jar file from the target directory using:
java -jar target/Conditional-BPMN-Events.jar

For a faster 1-click (re-)deployment see the alternatives below.

Maven Spring Boot Plugin

  1. Build and deploy the process application using:
mvn clean package spring-boot:run

Your Java IDE

  1. Run the project as a Java application in your IDE using CamundaApplication as the main class.

Run and Inspect with Tasklist and Cockpit

Once you deployed the application you can run it using Camunda Tasklist and inspect it using Camunda Cockpit.

Environment Restrictions

Built and tested against Camunda Platform version 7.15.0.

License

Apache License, Version 2.0.

You might also like...

This module explains about the example of Spring MVC + Database Integration with MySQL using Hibernate ORM with practical coding example and required JAR dependencies

SpringMVC-Database-Integration This module explains about the example of Spring MVC + Database Integration with MySQL using Hibernate ORM with practic

Nov 2, 2021

A Spring Boot Camel boilerplate that aims to consume events from Apache Kafka, process it and send to a PostgreSQL database.

SPRING-BOOT CAMEL BOILERPLATE This is a Spring-Boot Camel Application model that you can use as a reference to study or even to use in your company. I

Apr 4, 2022

Spring Boot & MongoDB Login and Registration example with JWT, Spring Security, Spring Data MongoDB

Spring Boot & MongoDB Login and Registration example with JWT, Spring Security, Spring Data MongoDB

Spring Boot Login and Registration example with MongoDB Build a Spring Boot Auth with HttpOnly Cookie, JWT, Spring Security and Spring Data MongoDB. Y

Dec 30, 2022

Spring Boot JWT Authentication example with Spring Security & Spring Data JPA

Spring Boot JWT Authentication example with Spring Security & Spring Data JPA

Jan 26, 2022

This project was created as a simple example to show how we can implement the hexagonal architecture(software design) proposed by Netflix.

This project was created as a simple example to show how we can implement the hexagonal architecture(software design) proposed by Netflix.

Netflix Hexagonal Architecture Table of contents About the project Description Built with Installation Requirements to run Usage information Run Licen

Dec 20, 2022

Spring Boot Project Example by Evren Tan

A Complete Spring Boot Example Project A Complete Spring Boot Example Project with Spring Boot 2.6.2, JDK 17 & Maven. Table of Contents How to Contrib

Nov 28, 2022

Example project of Spring Boot Microservices with the following services School and Student

SpringBootMicroservicesWithDiscoveryGatewayConfig Example project of Spring Boot Microservices with the following services School and Student, additio

Nov 28, 2022

The Spring Boot Sample App on K8S has been implemented using GKE K8S Cluster, Spring Boot, Maven, and Docker.

gke-springboot-sampleapp 👋 The Spring Boot Sample App on K8S has been implemented using GKE K8S Cluster, Spring Boot, Maven, and Docker. Usage To be

Feb 1, 2022

This is simple project to show how to create a basic API using Java 11 + Maven + Spring Boot + PostgrSQL + Flyway.

This is simple project to show how to create a basic API using Java 11 + Maven + Spring Boot + PostgrSQL + Flyway.

Dec 10, 2022
Owner
Niall
Developer Advocate @camunda
Niall
该仓库中主要是 Spring Boot 的入门学习教程以及一些常用的 Spring Boot 实战项目教程,包括 Spring Boot 使用的各种示例代码,同时也包括一些实战项目的项目源码和效果展示,实战项目包括基本的 web 开发以及目前大家普遍使用的线上博客项目/企业大型商城系统/前后端分离实践项目等,摆脱各种 hello world 入门案例的束缚,真正的掌握 Spring Boot 开发。

Spring Boot Projects 该仓库中主要是 Spring Boot 的入门学习教程以及一些常用的 Spring Boot 实战项目教程,包括 Spring Boot 使用的各种示例代码,同时也包括一些实战项目的项目源码和效果展示,实战项目包括基本的 web 开发以及目前大家普遍使用的前

十三 4.5k Dec 30, 2022
循序渐进,学习Spring Boot、Spring Boot & Shiro、Spring Batch、Spring Cloud、Spring Cloud Alibaba、Spring Security & Spring Security OAuth2,博客Spring系列源码:https://mrbird.cc

Spring 系列教程 该仓库为个人博客https://mrbird.cc中Spring系列源码,包含Spring Boot、Spring Boot & Shiro、Spring Cloud,Spring Boot & Spring Security & Spring Security OAuth2

mrbird 24.8k Jan 6, 2023
Spring Boot JdbcTemplate example with SQL Server: CRUD Rest API using Spring Data JDBC, Spring Web MVC

Spring Boot JdbcTemplate example with SQL Server: Build CRUD Rest API Build a Spring Boot CRUD Rest API example that uses Spring Data Jdbc to make CRU

null 7 Dec 20, 2022
Community extension to generate a Java client from the provided Camunda 7 OpenAPI descitpion and also warp it into Spring Boot

Camunda Engine OpenAPI REST Client Java and Spring Boot This community extension is a convenience wrapper around the generated Java client from the Ca

Camunda Community Hub 29 Dec 28, 2022
An example to show how you could use clean architecture and DDD elements with Camunda.

Camunda DDD and Clean Architecture An example to show how you could use clean architecture and DDD and their advantages with Camunda. I also wrote a b

Luc Weinbrecht 10 Dec 15, 2022
Spring Boot Security Login example with JWT and H2 example

Spring Boot Security Login example with JWT and H2 example Appropriate Flow for User Login and Registration with JWT and HttpOnly Cookie Spring Boot R

null 50 Dec 21, 2022
This project contains a full example of an application developed using Spring Boot and GraphQL within the Java.

Spring boot GraphQL Example This project contains a full example of an application developed using GraphQL within the Java. The project includes a com

Haoqiao Wang 3 Jul 20, 2022
Project Basics Example using Spring Boot 3.0

Base Project Spring 3.0 Exaples of the acess - API localhost Method create - POST Content-Type =

Joshua Maia Rodrigues 4 May 9, 2022
Zitadel.ch Example Project with Spring Boot and Spring Security

Zitadel Example Project with Spring Boot and Spring Security This example contains two Spring Boot Apps (app and api) which use the Zitadel IdP as Ope

Thomas Darimont 2 May 3, 2022
An assistance platform made using Spring framework that analyses your code, and helps you either to start a devops project, or to turn an existing project into a devops project using open source software (Git, Docker, Jenkins..)

DevOpsify Description An assistance platform made using Spring framework that analyses your code, and helps you either to start a devops project, or t

obaydah bouifadene 14 Nov 8, 2022