Skip to content
Snippets Groups Projects
Select Git revision
  • cfe0a8b547ca39236143edd372f05d137afa51aa
  • main default protected
  • devel2
  • release
  • devel
5 results

pnml-petri-net-editor

user avatar
StarryScythe authored
cfe0a8b5
History

PNML-Editor

Prerequisites

The following libraries/frameworks need to be installed on your system:

The examples are heavily interweaved with Eclipse Theia, so please also check the prerequisites of Theia.

Theia Version compatibility

This project template is compatible with Theia >=1.39.0.

Building the Editor

The server component is built with maven and the client component is built with yarn. A convenience script to build both is provided. To build all components execute the following in the directory containing this README:

yarn build

In addition, it is also possible to build each component individually:

# Build only the glsp-client
yarn build:client

# Build only glsp-server
yarn build:server

Or you can use the available VSCode tasks configured in the workspace (via Menu Terminal > Run Task...)

  • Build TaskList GLSP Server
  • Build TaskList GLSP Client example

Running the Editor

To start the Theia browser application with the integrated tasklist example, navigate to the client directory

cd glsp-client

and then execute:

yarn start

This will launch the example in the browser with an embedded GLSP server on localhost:3000. From there the file glsp-client/workspace/example.pnml can be opened.

Watch the TypeScript packages

To run TypeScript in watch-mode so that TypeScript files are compiled as you modify them via CLI:

yarn watch

or the VSCode task Watch TaskList GLSP Client example.

MQTT Messages

The broker can be changed by modifying the "broker" filed in the class glsp-server/src/main/java/org/eclipse/glsp/example/javaemf/MQTT/MQTTClient.java

Three different kinds of messages can be sent:

  • filling places with tokens

    • topic name: fillPlace
    • topic JSON format: {"placeId": place id as string, "tokens": array of token strings}
    • example: {"placeId": "cd0bae27-ab7a-4647-85d3-b1bb2b3dcd60", "tokens": ["aaaa", "bbbb"]}
  • firing transitions

    • topic name: fireTransition
    • topic JSON format: {"transitionId": transition id as string, "tokens": {placeId: Array of token strings}} -example: {"transitionId": "7c12def4-f37f-4948-96c7-a248088d1bee", "tokens": {02cb7814-11e3-496b-9d6a-4be829073826: ["Hund", "Katze"], "c784ac65-fd96-4158-9ba2-c27527a5d69e": ["Dativ"]}}
  • changing the value of input signals

    • topic name: name of the signal
    • topic format: Boolean value
    • example: topic: "Red" ; content: "true"

The examples can be executed as they are on the example in the workspace folder.

Tina

The repository does not contain the bin files of tina. They have to be manually added to the appropriate location in libs/tina-3.8.0. Tina functionality has not been tested on linux.