BPMN Diagram Interchange - It Works!

It was at one of the early Think Tanks, the one where OMG suddenly revealed that BPDM, their process definition meta-language based on, I think, string theory, would be renamed BPMN 2.0, that the intention to support interchange of BPMN graphics was announced. And I recall a spirited barroom discussion with the editor of the BPDM spec, an energetic young Parisian, in which I insisted that graphics portability could never work because each BPMN tool used different sizes and aspect ratios for their activity, gateway, and event shapes, so the coordinates exported from tool A could not possibly be applied to importing tool B. For the most part I was right about that, but in a more fundamental way I was wrong and the Parisian was right. Today my conclusion is more nuanced: Tools that care about importing models from other BPMN tools must be able to resize their basic shapes.

I myself had a need to create such a tool. My book BPMN Method and Style presents a long list of rules, beyond those spelled out in the BPMN 2.0 spec, that help ensure that the meaning of the process logic is clearly expressed in the diagram by itself. I call them style rules. Two tools embed them directly in the BPMN editor - itp commerce Process Modeler for Visio and Signavio - but I occasionally have the need to support other BPMN tools, such as native Visio Premium or (soon) Visio 2013. For that I created a tool that first maps the Visio file to BPMN 2.0 xml, and then applies style rule validation, reporting errors in a list. More recently I developed some additional non-local validation algorithms that follow tokens through the model to detect incorrect merge gateways - the most common errors not caught by style rule validation. But I wasn't happy with reporting the errors in a list; I wanted to see them in the context of the diagram.

Hmmm... Then I discovered SVG, structured vector graphics, a standard XML format for drawings. Although it's almost as old as XML itself, until IE9 Microsoft refused to support it in its browser, but now you can open an SVG file in any modern browser, either directly or embedded in HTML. The other good thing about SVG is you can make the activity, gateway, and event shapes any size you need, so you can reconstruct the layout of the exporting BPMN tool, whatever it is. Visio can SaveAs .svg, and that gave me some SVG snippets for the icons, which would be tough to draw otherwise. SVG has no word-wrap feature, so I had to figure out a way to do that in XSLT. But otherwise pretty straightforward, even for a non-programmer like me.

Here is a file created in Visio 2010 Premium submitted by a student for his certification exercise. I saved it from Visio as a web page so you can see how it looks in the original. Each page in the Visio file is a separate hyperlinked web page.

Here is the validated diagram in SVG overlaid with the reported errors (and correct merge gateways). All the child level Visio pages are concatenated vertically on a single web page. Hover over the colored error icons to see the error message in tooltip.

Note that the icons I copied from another BPMN tool from are not exactly the same as those used by Visio 2010 (which isn't even BPMN 2.0). The beauty of a standard model interchange format - for both semantic and graphical information - is that you can process a model, e.g. validate it, simulate it, execute it - on a different tool than the one used to create it, and you can reconstruct the diagram too. This was all done in XSLT 2.0. You might say I cheated because part of it depends on Visio-specific code. But that's just because Visio 2010 can't export BPMN2.0 xml. If it could, the entire XSLT would be independent of the BPMN authoring tool. That's pretty cool, I think.

By the way, this student had just one error - an OR-gateway merge that should have been XOR (or no gateway at all). That's pretty minor, and students at that time did not have access to the merge validation tool. So that was a pass. If you want to learn to create complex but readable process models, supported by modern validation tools, you might think about my next BPMN Method and Style class, October 22-24. Look here for more details.

One other thing I just noticed... In the SVG there is a gap between the lane and the pool boundary. The exact definition of the top-left corner of pool and lane shapes is not specified in BPMN 2.0 (e.g., is the pool label area inside or outside the pool bounding box?) --and different tools make different assumptions. I could fix this in my Visio-specific code, and at some point I probably will.