The general invocation command is: java -jar jar_name [options] [pnmlFile1 pnmlFile2 ...]. Run the application with -h or --help to get help.
The default execution mode is standalone. In this mode, the application expects arguments, which should be PNML documents to check. You can specify one or many.
Include PNML DoC in your toolkit via a Shell Script
We provide a Shell script to help you increase productivity in using PNML DoC in standalone mode. In particular, a set of arguments for the Java VM is included, that you can start with and modify to your system's settings.
For instance, the -Xmx argument allocates some max amount of memory to the heap. If you mostly deal with small documents (a few hundreds KB), we advise you decrease it (current setting is 2 GB). If you use large documents, (a few hundreds MB to GB), then you should increase it.
This tool supports some experimental options, that are the following:
- -cn (aka --checknorm): it checks and reports normalization issues. Currently, only the presence of parallel arcs is checked.
- -nmz (aka --normalize): it fixes normalization issues (supersedes -cn). Currently, parallel arcs are merged into a single one, by using the appropriate sum operation on their inscriptions, depending on the type of the net. Currently P/T nets are supported (Symmetric nets in a upcoming release).
- -rmg (aka --rmgraphinfo): removes graphical information from the PNML document, in order to reduce its size. Currently, P/T nets are supported, since this option is most useful in reducing large (generated, unfolded) P/T net documents. This option can be combined with -nmz, but normalization always runs first.
In standalone mode, here is an example of the result message; this case when the validation was successful:
- HTTP/1.1 200 OK
- Message: Your PNML document conforms to the standard.
- Model name: philo
- Model type: Place/Transition Net.
- Number of nets: 1
- Number of places: 60
- Number of transitions: 60
- Number of arcs: 192
- Number of reference places: 0
- Number of reference transitions: 0
To run in server mode with default port and temporary working directory: java -jar jar_name -s.
Unless you specify them, a default port will be used (10002), and a temporary working directory will be created. Its name is ./pnmlvalidatortmp. The server logs will be located in ./pnmlvalidatortmp/logs/.
You can also specify the delay you want conversion tasks not to exceed. When that delay is over, the server cancels the tasks in such a situation. Before they stop, they will send you a message with status code HTTP/1.1 408 Request Timeout.
In server mode, the result message is the same as above, in standalone mode.
HTTP status codes
The results returned by the server use HTTP status codes in their first line to tell you if the service was successful of if something went wrong. They are followed by a message.
Here are the HTTP status codes this application uses:
|HTTP/1.1 200 OK||Service successful|
|HTTP/1.1 202 Accepted||For later use (Asynchronous invocation)|
|HTTP/1.1 400 Bad Request||Malformed request|
|HTTP/1.1 403 Forbidden||Access rights problem|
|HTTP/1.1 404 Not Found||A resource is missing|
|HTTP/1.1 408 Request Timeout||Task exceeded its delay|
|HTTP/1.1 413 Request Entity Too Large||File too large to be handled|
|HTTP/1.1 415 Unsupported Media Type||Unsupported Petri net type, Not a PNML file|
|HTTP/1.1 500 Internal Server Error||Internal problem|
|HTTP/1.1 503 Service Unavailable||Cannot serve request|
If you want to use PNML Check directly in your software as a Maven-based dependency instead of using it on the command line, you may specify it like so:
<dependencies> <!-- Of course, you must keep your existing dependencies, and just add the following --> <dependency> <groupId>fr.lip6.pnml</groupId> <artifactId>fr.lip6.pnml.check</artifactId> <version>1.2.4</version> </dependency> </dependencies>
The corresponding artefact is deployed in Maven Central, so you can use it with the declaration above, without any further repository declaration. However, just in case of unavailability, latest snapshot or release is always deployed in our Maven repository:
<repositories> <repository> <id>pnml.framework</id> <url>http://miage11.u-paris10.fr:8081/nexus/content/groups/public/</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> </repository> </repositories>