I’m happy to present to you another guest contribution! Today’s article is by Joel Wiesmann, a friend and fellow Automic Expert from Switzerland.
He introduces his own tool for workflow visualization – very cool!!!

Do you often take screenshots of workflows, full of information like titles of objects, comments for the operations team, and similar notes?

I was thinking: Wouldn’t it be great to have such illustrations in a modern, editable and sustainably scalable format? My medium of choice was Visio with a powershell routing. The result is a small, flexible script that you can download as open source from the Automic Marketplace at no cost:

Download from the Automic Marketplace

Model Workflows in Visio

Image of Workflows the most important parameters.

We don’t need lots of information, to model a workflow:

  • X and Y coordinates of the tasks, shown here with blue arrows. Note: the y-axis is inverted – same as within the AE.
  • Dependencies between the tasks (red in the image above). That’s pairs of unique task numbers of tasks (LNR) and their predecessors (preLNR). The task numbers are displayed orange in the image.

All object types have their own icon – that’s to better differentiate between them. We need the object type (yellow) for it.

Technically speaking, this gives us two tables, for the tasks and for the relations:

Tasks

lnr x y type
1 1 0  <START>
2 2 0 JOBS
3 3 1 SCRI
4 3 0 JOBP
5 4 0  <END>

Dependencies

lnr prelnr
2 1
4 2
5 4
3 1
5 3

You can extract this information from the database. The attributes are:

  • JPPA_JPP_Lnr / JPP_Lnr (Lnr)
  • JPPA_PreLnr (PreLnr)
  • JPP_Row (Y)
  • JPP_Col (X)
  • JPP_OType (type)

The Representation in Visio

Visio Stencils can be imagined as a library of drawing components. A classic example of a Visio Stencil is the representation of networks or application architectures. “Workflow Visio(n)“ also uses Stencils which can be adapted, expanced and programmed. With the available data we can already draw the workflow with the Workflow Visio(n) Standard Stencil (default.vss):

Simple representation with Workflow Visio(n)

Open the Stencil default.vss. Here you’ll see the contained components (Mastershapes) which are named after the Object Type. This explains the divergent representation for <START> und <END>. A Mastershape consists of components (graphics/text boxes). Data fields can be integrated into these components and their values can be shown or calculated.

Stencil, Mastershape and Shape Data in Microsoft Visio.

Let’s take a look at the data field “Name” (highlighted in yellow). As default, it has the value “Namevalue” (red). To fill this field, add a field labeled “name” to the Workflow Visio(n) input data. We also add a field labeled “description”. The result already looks pretty good.

New Tasks Table

lnr x y type name description
1 1 0  <START> START
2 2 0 JOBS A You might put Titles here.
3 3 1 SCRI B Or ArchiveKeys.
4 3 0 JOBP B Or anything else.
5 4 0  <END> END

The representation looks like this:

Representation in Visio with Titles and Descriptions

Using Workflow Visio(n)

Once you master these basics, it’s easy to use Workflow Visio(n).

You can show your SQL reports with the data fields you want in your own modified stencils. The mastershape also doesn’t limit you to the oType: the table column “type” is simply mapped with the name of the mastershape. If there is no corresponing mastershape, “default” is used.

Now you can test Workflow Visio(n) via Powershell. The script is workflowVision.ps1 and you can use the following parameters:

-csvTaskDataFile
The CSV file with the task data (lnr, x, y, type and mastershape-dependent fields). Sample data are in the folder “demo“.
-csvRelDataFile
The CSV file with the relational data (lnr, prelnr, type). Sample data are also in the folder “demo“.
-outputFile
The output file to be created. Any Visio-supported formats are possible: VSD, XHTML, SVG, PNG, JPG, etc.
-stencilFile
This optional parameter defines the Stencil to be used.

The CLI output of the tool is not exactly spectacular – it points to errors and indicates rough progress. I have paid much attention to the return codes so that the script can be inserted into the workflow. The optional parameters can be viewed directly in the comment header of the script.

Usage with the Powershell:

.\workflowVision.ps1 `
-csvTaskDataFile .\demo\simple_task.csv `
-csvRelDataFile .\demo\simple_rel.csv `
-outputFile $env:TEMP\demoOutput.vsd

 Or the classic cmd:

powershell.exe ^
-ExecutionPolicy Bypass .\workflowVision.ps1 ^
-csvTaskDataFile .\demo\simple_task.csv ^
-csvRelDataFile .\demo\simple_rel.csv ^
-outputFile $env:TEMP\demoOutput.vsd

Heatmap Visualization

The heat field colors each task according to its value. The heat field, therefore, must have a value between 0 (green) and 100 (red). For instance, this value can be based on run time, number of errors, restarts, or the archive keys – because the input data can be created flexibly through one’s own SQL queries or data fusions, the possibilities are endless.

Where to find this data in the Automation Engine Database and how to query it, is best learned in one of Philipp’s Automation Engine Database Knowledge Workshops!

Visualization of a Heatmap with Workflow Visio(n)

Visualization of several Workflows

Several workflows (for instance, from recurrent queries) can be documented in one go in a VSD file with the field «pagename». This field has to match in both CSV files (tasks and relations). I recommend using the workflow name as «pagename». If the field is used, the output must be a VSD file. Other output formats will result in an error message.

Did this pique your interest? Try out the tool! I would love to receive screenshots of your results. If you would like to participate in further developments, please contact me via Xing: https://www.xing.com/profile/Joel_Wiesmann

Here again the download link: https://marketplace.automic.com/details/workflow-visio

Also, take a look at the Video about the tool on Youtube.

Guest author: Joel Wiesmann

Automic Expert

Joel is a Certified Automic Expert and works at Bank Julius Bär in Zürich. He is an early riser and loves IT.
As a balance to his computer work, he goes swimming in the Limmat River or takes trekking vacations in Iceland.
Contact him via Mail or Xing.