Documentation -- Extending PetriCode
PetriCode is extended, primarily, by adding new pragmatics and corresponding code generation templates.
Adding pragmatics is done by creating a pragmatics descriptor in a file and giving it to the application using the -p option.
The pragmatics descriptor file consists of none or more pragmatics descriptors. Each pragmatics descriptor begins with the name of the pragmatic described. Then comes a parenthesis. Inside the parenthesis comes some comma-separated key-value pairs on the form "key:value". Below is an example of a pragmatic descriptor for the "setLCV" pragmatic that sets a LCV field value. The value of the origin field can be "explicit" or "derived". Pragmatic with the "explicit" origin should be added by the modeler. Pragmatics with the "derived" origin can be automatically derived using the value of the field derviationRules.
setLCV(origin: 'derived',derviationRules: ['new PNPattern(adjacentPatterns: [new PNPattern(pragmatics: ["LCV"])])'] )
Adding Code Generation Templates