Orchestrate the Chaos: Process automation in modern architectures Open Source Day Florence / March 7, 2024

Poll ■ How many here use microservice architectures? ■ Has anyone struggled to explain data flow/logic between technical and non-technical teams? ■ Has anyone heard of BPMN? DMN? BPM? ■ Has anyone heard of Camunda?

Who am I? ■ Developer Advocate @ Camunda ■ Denver, CO, United States Samantha Holstine @sholstine620 she/her ■ Fun fact: I’m a dance fitness and studio rowing instructor in my free time

What is “Modern Software Architecture”

Image: (Cloudinary) https://dev.to/alex_barashkov/microservices-vs-monolith-architecture-4l1m

Modern architecture designs are great at optimizing resource usage …

… now diagram the business logic / data flow …

Image: (“Microservices” - KRAZAM) https://www.youtube.com/watch?v=y8OnoxKotPQ

Hard problems to solve Documentation Data flow diagrams look like spaghetti Timers Alerts, stuck/idle processes, notifications Interrupting messages Your application is already executing code, but something has changed and you need to interrupt it and handle it differently Changes to business logic All your services are running nicely together, but now a new service is added that integrates with other existing services …

Forget services and infrastructure. Let’s think about it in terms of processes

“…a collection of related, structured activities or tasks performed by people or equipment”

Real World Scenario

Truck Permits A local municipality needs to issue permits to trucking companies: ● Trucking company fills out a form ● A price is determined for the permit ● The company pays for the permit ● The permit is issued

Truck Permits A local municipality needs to issue permits to trucking companies: ● ● ● ● Trucking company fills out a form -> UserForm microservice A price is determined for the permit -> PermitMatch microservice The company pays for the permit -> Payments microservice The permit is issued -> IssuePermit microservice

New requirement! “We need the permit turned into a PDF, and email notifications to the user and to us”

Truck Permits A local municipality needs to issue permits to trucking companies: ● ● ● ● Trucking company fills out a form -> UserForm microservice A price is determined for the permit -> PermitMatch microservice The company pays for the permit -> Payments microservice The permit is issued -> IssuePermit microservice -> PDF microservice -> Email microservice

New requirement! “A user tried to fill in the form, but it didn’t match a permit!”

New requirement! “If they don’t pay in X days, the permit needs to be canceled!”

How might you solve this?

Introducing BPMN Business Process d n a l e d Mo n o i t a t o N Maintained spec Visualization Bridge communication ISO/IEC 19510 spec maintained by OMG (Object Management Group) Easily understand complex processes; no more spaghetti! Simplify discussions with stakeholders; unify design and implementation

Remember this? “If they don’t pay in X days, the permit needs to be canceled!”

… That’s great, dude, but that’s just a diagram.

… or is it?!

BPMN Engines (Workflow Management Systems)

Many options to choose from https://bpmn-miwg.github.io/bpmn-miwg-tools/

Camunda - The Universal Process Orchestrator Orchestrate Automate Transform Complex process flows across people, systems and devices. Any process, anywhere. Your organization toward a digital future. Collaborate Flexibility All Endpoints Human Work AI Business Rules Micro Services RPA API IoT Systems (legacy + homegrown)

The state of a process is managed by the workflow engine, not the application. The data is managed by the application, not the engine.

New requirement! “For some permits, they need additional approval before collecting payment.”

New requirement! “Oh, and we should probably send a payment reminder before we cancel the permit.”

Errors and reminders

Errors and reminders

That was easy!

Let’s review 1 BPMN 2 BPMN Engines 3 Simplified management Open spec that defines processes in an organized, understandable way Execute the process as drawn, connecting tasks to external services. State of each process is controlled by the engine, not the application. Easily add additional tasks without changing existing application; engines provide management tools to monitor performance etc.

Resources ● Camunda Academy – free courses on BPMN and Camunda: https://academy.camunda.com/ ● BPMN 2.0 documentation: https://docs.camunda.io/docs/component s/modeler/bpmn/bpmn-primer/ ● Camunda Code Studio on YouTube: https://www.youtube.com/watch?v=fv3wP ccIpL8 ● Camunda Forum: https://forum.camunda.io/

Questions?