The article describes how to generate graph which will provide visual view of PBA Order Flow transitions.
Order Flow (OF) in PBA consists of list of transitions between order statuses. Each transition defines current status (displayed as 'From' in PBA Control Panel) of an order and two target statuses - Success and Fail depending on result of Order Flow handler defined for the transition.
All OF transitions for different types of order may be seen in PBA Provider Control Pane at Configuration Director > Order Processing > Order Flow, however it is hard to read such order flow since it is just a flat list of transitions.
The attached files demonstrate example of files generated based on the default Sales Order (SO) Order Flow in PBA 5.4.
The attached PDF file with graphical view of an Order Flow transitions is generated by Graphviz tool.
The Perl script of2gv.pl attached to the article may be used to translate OF definitions exported from PBA to file Graphviz can process.
Download Graphviz from the official website and install to your machine.
2. Export Order Flow transitions.
2.1. Open Order Flow in PBA Provider Control Panel at Configuration Director > Order Processing > Order Flow > click on order type.
2.2. Switch to the Order Flow Transitions tab and make sure that fields are ordered this way:
From | Success | Fail | Transition Type | Action | From Status | Success Status | Fail Status
In case fields are not in the order above, you can drag corresponding columns to change their order.
2.3. Export Order Flow transitions to Excel file using the 'Export To Excel' button.
3. Translate transitions.
3.1. Open generated .xls file in Excel and save it as TSV (Tab Separated Value) file.
3.2. Run the attached Perl script of2gv.pl to translate file from TSV to GV format:
perl of2gv.pl <file.tsv> <label> > <output-file.gv>
<label> is any name you want to use as title of the graph.
4. Generate graph using Graphviz tool (dot.exe).
4.1. Run the following command to generate PDF file:
dot -T pdf -O <output-file.gv.pdf>
1. Graphviz (dot.exe) is capable of generating graph in different file formats like BMP, PNG, SVG, etc. Refer to the Graphviz official website for more information about supported file formats: http://www.graphviz.org/content/output-formats.
2. To make graph easier to view, the Perl script of2gv.pl skips transitions which will loop directly to the current state, i.e. scripts skips transitions where 'From' state is equal to 'Success' or 'Fail' state.
3. The Graphviz tool allows to change format of the graph like color, font, lines, node shapes etc. Refer to the official documentation for more information about Graphviz - http://www.graphviz.org/Documentation.php.