Skip to Content
Technical Articles
Author's profile photo Raffael Herrmann

How to create vector graphics from IFlows

When implementing interfaces, good documentation is at least as important as good architecture and clean programming. Unfortunately, writing documentation is certainly not one of the favorite tasks of developers and consultants. In today’s blog post I would like to show how you can add nice process graphics to your own CPI interface documentation with just a few tricks.

Let’s start with a quick

The problem

In addition to information on connection data, error handling and use cases and other things, interface documentation should also contain graphics on the process flow. Ideally, a graphic illustration of the IFlow itself is suitable here. Unfortunately, the CPI does not yet have a feature for exporting an IFlow in a graphical form.

Taking a screenshot is also of limited help, since larger IFlows in particular quickly produce pixelated graphics (because you have to zoom out to get the whole IFlow into the screenshot, but at the same time lose a lot of details in the graphic). The optimum would be the export of an IFlow as vector graphic. (As it is also requested here in SAP’s Influence Program – please leave a vote there).

The solution

The solution is closer than expected. Technically IFlows are .zip archives containing different configuration and description files like scripts, mappings but also the process flow. The process flow is stored as an XML file according to the BPMN standard. We now make use of this, since there are already some rendering tools for this standard.

Example procedure in 3 steps

Choose the IFlow you want to convert to a SVG graphic.

Then go to the package overview and download the specific IFlow.

Now open the downloaded zip archive with a any archive viewer (e.g. 7-zip, Winrar, Explorer) and navigate to the following path inside the archive:

\src\main\resources\scenarioflows\integrationflow

Extract the *.iflw-file onto your local disk. The iflw-file contains the BPMN-styled XML that we use to render the SVG in the next step.

Navigate to https://demo.bpmn.io/, click “open” and select the IFLW file. You should see a graphical representation of your IFlow. Change and edit the diagram to your favor.

At the end you can export the diagram as SVG file with just a single click.

Note: As you can see in our example the exception subprocess isn’t rendered with all it’s details I’m not sure if this is due to a limitation of the BPMN viewer or because the IFLW file isn’t fully compliant to the BPMN standard. So take the approach shown above as baseline process for graphic generation, but keep in mind to double check that the graphic contains everything you need. (Or add missing details in the graphics editor later on.)

Outlook and ideas

While the above approach shows that it is possible to display a vector-based diagram of an IFlow with little effort, there is still room for improvement. For one thing, not all elements of the IFlow are always displayed and for another, the process (download, unzip, upload, save SVG) can certainly be simplified.

By use of the official SAP CPI SAP BTP Integration Suite, Cloud Integration (oh lord, please let SAP quickly invent a catchy acronym 🥴) APIs, which are documented over here (https://beta.api.sap.com/api/IntegrationContent/resource), the download process could be automated. The unzipping then could be done via native functions of the used programming language/framework. For the last step (the rendering of the BPMN model) there exist different libraries like…

Maybe some of our community’s #CodingHeroes can wrap the logic up in a small tool…

Last but not least, I like to know how you manage/write your documentation today. Do you use flow diagrams in your documentations? If so, which tool for digram generation (screenshot, another toolchain, …) do you use?

Assigned tags

      7 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Morten Wittrock
      Morten Wittrock

      Hi Raffael

      Nice one 🙂 As for the acronym, I think we're fine with CPI. Otherwise, just go with Cloud Integration, which is an official name and still pretty short.

      Cheers,

      Morten

      Author's profile photo Raffael Herrmann
      Raffael Herrmann
      Blog Post Author

      Hi Morten, then I'll take "Cloud Integration" (even if I would love to keep using CPI), because one of our sales contact persons at SAP asked me to not use the term CPI any longer. (That's why I added this small gibe to the blog. 😉 )

      Author's profile photo Morten Wittrock
      Morten Wittrock

      I think I'll stick with CPI for now - at least until a better alternative surfaces 🙂

      Author's profile photo Fatih Pense
      Fatih Pense

      Hi Raffael,

      Thanks for the great post again! You are providing real value as always. 🙂

      It also shows how investing in open standards and APIs both helps SAP and users in the end.

      I think documentation is a very common use case & a bitter pill to swallow. I was also thinking about the process. I have some ideas but it needs some serious development. I would love to chat about it 🙂

      Best regards,
      Fatih

      Author's profile photo Damodar Damodar
      Damodar Damodar

      Hi,

      What does the feature extract the mapping of fields either in an excel or pdf?

      Regards

      Author's profile photo Raffael Herrmann
      Raffael Herrmann
      Blog Post Author

      Hi Damodar, the blog above describes how to export the IFlow diagram as a vector graphic. That graphic can be used as part of an interface documentation. So it describes only a single part of a complete interface documentation. For the mapping documentation, one could use the Excel export function of the graphical mapping editor as described here: https://help.sap.com/viewer/368c481cd6954bdfa5d0435479fd4eaf/Cloud/en-US/3d5cb7ff43fb4a4b9c28153472f6d0f1.html?q=Mapping%20export (Check the row 8 in the table at the end of the article)

      Author's profile photo Kai Or
      Kai Or

      Thanks for the blog !

      Just voted on the influence idea as well .

      Kai