This repository provides a containerization and http-api for the Scylla Business Process Simulator.
git clone --recurse-submodules git@github.com:INSM-TUM/Scylla-Container.git
cd Scylla-container
The easiest way to run the Scylla http-api is to use the containerization also provided with this repo.
First, build the Docker image using the Dockerfile. From the project directory, in the terminal, call
docker build -t scylla-container:1.0.0 .
This will get all the dependencies and set up the Docker image called simulation-bridge
.
After the Docker image is created, the Scylla http-api can be executed by running
docker run -it -p 8080:8080 scylla-container:1.0.0
This instantiates the created image and exposes the api port 8080.
To run the api without docker, Maven and Python 3 need to be installed. We also recommend to use a virtual environment to handle Python dependencies.
To install the Python dependencies, run the following in the repository root folder:
pip install -r requirements.txt
To also install Scylla, navigate to the Scylla submodule folder and run
mvn package -DskipTests
Note that there should now be a scylla<version>.jar
in the scylla/target
folder. Remember the exact filename.
Then, to start the api, go back to the repository root folder and call
python3 ScyllaApi.py ./scylla/target/<scylla-jar-filename>
The api is then running on the default port 8080.
As can be seen in the main api file, the api provides an http-post endpoint to synchronously start simulation runs. These request need to include the following information:
- A
requestId
as part of the header - A
bpmn
process model file in bpmn xml format, as part of the request form-data files - A
globalConfig
global simulation configuration file in xml format, as part of the request form-data files - A
simConfig
process specific simulation configuration file in xml format, as part of the request form-data files
Once the simulation is finished, the request returns a message
that contains the console output, and all files
created by Scylla.
Details on the Scylla inputs and outputs can be found in the Scylla project documentation.
curl --location 'http://127.0.0.1:8080/scyllaapi' \
--header 'requestId: request123' \
--form 'bpmn=@"./scylla/samples/p2_normal.bpmn"' \
--form 'simConfig=@"./scylla/samples/p2_normal_sim.xml"' \
--form 'globalConfig=@"./scylla/samples/p0_globalconf.xml"'