Yesterday I came across Graphviz and remembered that a college had already used it to generate some ERDs/Class diagrams. After taking a closer look, I thought to give it a try and use it to generate a page flow diagram for an APEX application as you can also see it for JSF in JDeveloper.
After some try and error figuring out how to use this tool. I created a new package for my ApexLib Framework to do all the work. The diagram output is not optimal yet (I have to ask my college for tips & tricks when he is coming back from vacation), but for a quick overview I think it’s good enough.
So what does my script do?
It generates for each page group (Application/Tasks/Manage Page Groups) a separate diagram, which just contains the pages of this group or referenced pages of other groups (they show gray). Links with a condition are displayed red.
It also generates an overview diagram which contains all the pages of the application.
Pages which do not exist anymore, but which are referenced somewhere are marked red. So you can even use this diagram to find out if you have some dead links.
How to use it?
- Get the newest release of the ApexLib Framework.
- If you just want to use this feature of the framework you only have to install the ApexLib_PageFlowDiagram package. See HowToInstall.html for details. Note: This package needs access to the tables in the FLOWS_XXX schema, because the APEX repository views didn’t contain all the necessary information. Eg there is now view for WWV_FLOW_PAGE_GROUPS. That’s why it will not work if you install the ApexLib Framework into your application schema.
- Download Graphviz and install it.
- Try it the following command works in a command box
If it doesn’t work, you can add the Graphviz directory to your PATH or you include the directory in the $dot (eg. $c:\programs\graphviz\dot) call in ApexLib_Generate_PageFlowDiagram.sql
- Open sqlplus and connect to your application schema or to the apexlib schema.
- Run the script ApexLib_Generate_PageFlowDiagram.sql
and enter the id of your application.
- Now you should see several PNG files in your directory!
I tried it with the sample application “Software Projects” and the output seems to be ok.
If it doesn’t work, check the tmp_export_diagram.sql file and manually execute the steps and look which step fails.
I’m sure I didn’t capture every property or object which can have a link to a page, so if you notice some missing links. Let me know!