Addressing Graphviz File Generation Issue in CPN Tools: A Java-Based Solution
摘要
This paper presents a novel approach to resolving a specific bug encountered in Colored Petri Nets (CPN) Tools during the generation of Graphviz files. CPN Tools, a powerful instrument for constructing and analyzing colored petri nets, has been identified to have limitations in graph visualization, particularly when dealing with token value strings or record/product with strings.The CPN Tools generate the Graphviz (dot) file, however it does not take into account color sets of strings, records, and products. If the color set is one of these, after generating the Graphviz file from CPN, Graphviz displays a syntax error. This issue results in a syntax mismatch with Graphviz, hindering the seamless visualization of graphs. To address this problem, the authors have developed a Java-based Graphical User Interface (GUI) program that takes the CPN Tools generated dot file as input, refactors it, and corrects the syntax, thereby enabling error-free graph visualization. The user merely needs to provide the CPN Tools created DOT file to the proposed system. It will make internal corrections and generate the graph. In addition, the user can download the revised version of the DOT file from the system. This solution not only resolves the identified bug but also enhances the overall user experience by simplifying the process of graph generation. The paper provides a detailed description of the bug, the development process of the Java GUI program, enhancing the page hierarchy graph of hierarchical colored petri nets, and its successful application in resolving the bug and generating correct graph. It also discusses the potential impact of this solution on the broader usability and efficiency of CPN Tools.