DEV Community

Sakir Temel for KelebekLabs

Posted on • Originally published at blog.kelebeklabs.com

How to Communicate Your Process Visually using BPMN as Code

When you have multiple participants in a process, and we often do, you realize that you're dealing with a lot of miscommunication / misalignment issues. It's so hard to remember who was doing what and when, furthermore it's even harder to make some optimization in the process itself as you lose the control over it. Besides you'll need to group all the participants together for them tell their opinions.

Processes are long and complex, but they're there even if you don't formalize them. So, why don't we find a way to approach it in an easy way? First thing each of us would do in such a situation is drawing some boxes and lines, a.k.a. diagrams. Today, we're going to talk about ways of drawing some diagrams, in a comprehensive yet simple way.

Business Process Model and Notation (BPMN)

BPMN diagram is like Flowchart, but the tasks (activities) are grouped by the participants. It can be drawn / read by both business or technical people as the main purpose is to communicate a process in a simple yet complete way.

Simple BPMN diagram for pizza ordering

BPMN is actually a set of standards has been used for years for complex enterprise processes, and nowadays it's becoming more accessible thanks to the development of the new techniques. Web based tooling (like Camunda, BPMN.io), more platforms supporting integrating diagrams into the flows, and remote work culture all helps us to use BPMN easier. Besides all of that, we drive/lead more and more initiatives together and we're keep looking for the efficiency and improvement.

I started to see more and more teams are formalizing their development / pull request flows. Many of them are going with a very long, not up-to-date flowchart diagrams just to keep the things "simple" and not require learning any better suited specifications like BPMN. It's a fair tradeoff, but at the end, it makes these diagrams not serving to their purposes. We should rather prefer solutions that makes BPMN diagrams more friendly, and super easy to learn/draw.

Diagram as Code

Diagram as Code is a trending concept that automatically generates diagrams from a simple text/code. Some of the pioneers are PlantUML, Mermaid and Kroki. It has several great benefits like having your architecture diagrams close to your code and your development flow. If you want to learn more about it, there's a presentation that covers main benefits in action.

Visualization of Diagram as Code with PlantUML

BPMN as Code with BPMN Sketch Miner

BPMN Sketch Miner is a rapid sketching tool for BPMN process models, you just write it as you're telling a story. They also have a great BPMN tutorial to make understanding of BPMN easier.

Simple BPMN diagram for pizza ordering with using BPMN Sketch Miner

Waiter, Chef, Customer are the roles defined as Lanes, the yellow rectangles are Tasks, the circles are Events, the arrows are the Flows.

Since we learnt the basics, we can just start drawing of one of our processes ! Sounds a bit strange, right? BPMN as a set of standards seems complex to learn because it has hundreds of elements that allows us to map almost any situation in the real world, but do we need all of them to start? To me, it's very similar to when we learn programming languages, you don't need to know / apply the best of the bests to be able to create an application, you know that you can continuously improve your codebase later on. Since now we're storing our diagrams as code in our codebases, the same rule applies! Just start mapping a process that you believe it can be helpful for your team to have it visualized.

Using more features of BPMN

Here you can see how you can evolve the diagram above by using a few more elements of BPMN.

Evolved BPMN diagram for pizza ordering with using BPMN Sketch Miner

Start and End events are labeled, used Timer event to represent delay, Exclusive Gateway is used to branch for alternative paths, Loop is used for repeated actions.

Another great thing I use in BPMN is the Data and Message Flow, it clearly describes who needs what and when, and where it's generated at. This is one of the biggest ambiguity in the processes and often it's missed because of the assumptions. BPMN helps us to explicitly talk about that.

BPMN diagram for job application process using BPMN Sketch Miner

Message Events are used to represent what's received or sent with the tasks, Data objects used to show inputs and outputs of the tasks. Data Flow is used to describe how the data is processed throughout the process.

Mapping our processes

Imagine you'd like to describe what's the journey of your feature from being developed to customers using that. You may want this to cooperate with marketing department for them to understand better which steps are there and they can align, you can use it for your new team members to onboard them faster, or you can use it for a brainstorming session with different experts to see if there's a way to optimize the process. Either way, just start drafting something and live-edit it during your meeting.

BPMN diagram for application publishing process with using BPMN Sketch Miner

BPMN Sketch Miner VSCode Extension

There's a VSCode Extension to integrate BPMN Sketch Miner to your development flow easily. I often store them under docs/diagrams/source/process_name.sketchminer and the png versions at docs/diagrams/out/process_name.png.

BPMN Sketch Miner VSCode Extension

Further thoughts

Visually expressing our thoughts or new processes engages people more and allows going more efficient in our discussions. BPMN is the language of the processes and it's good to speak this language, and even daily basis. This article covered how to start doing that, of course there'll be a lot of development opportunities on the go, a few of them are; how to use it in our git flow, using BPMN files as an outcome to auto generate forms etc, allowing teams to describe their internal or external facing processes in an efficient manner. Note that the diagrams help with having shorter and interesting meetings, async work, less regression of the established practices, and less resistance of a change. Feel free to contact us if you encounter any of the opportunities, always happy to share our practices.

Top comments (0)