Repository for my bachelor internship Implementation of process discovery algorithms. Implementing a full stack process discovery miner inlcuding an Alpha-Miner and a Alpha+-Miner.
The process miner expects a log as a .xml or .xes file. The log cannot exceed 50 MB in size (can be changed). The process minig algorithms can also merely be used as APIs, for example:
curl -X POST http://localhost:3000/api/v1/alphaminer -H "Content-Type: application/xml" -H "Accept: application/xml" --data @L1.xes > result.json
Currently supported are /api/v1/{alphaminer | alphaplusminer}
(L1.xes refers to a file in the current directory. Make sure to change the URL.)
Here are some examples of how the logs are supposed to be structured:
Minimal log
A log can have multiple traces and each trace can have multiple events (but each at least one).
<?xml version="1.0" encoding="UTF-8" ?>
<log xes.version="1.0" xes.features="nested-attributes" openxes.version="1.0RC7" xmlns="http://www.xes-standard.org/">
<trace>
<string key="concept:name" value="Case0"/>
<event>
<string key="concept:name" value="a"/>
</event>
<event>
<string key="concept:name" value="b"/>
</event>
<event>
<string key="concept:name" value="c"/>
</event>
</trace>
</log>
The in the Open XES standard defined lifecycle attributes can be used as follows:
- If the events have defined lifecycle attributes, only the events with the attribute "complete" will be used. All other lifecycle attributes will be skipped.
- The XES extension, classifier and global tags are ignored when parsing the log. They don't have to be included.
The project uses the Haskell webframework Yesod with the Warp backend to function as a webserver. The frontend is using React.js with Material UI and Typescript.
- Installing Typescript:
npx tsx
- Install dependecies:
cd static/app && npm install
- Build via Webpack:
npm run build
- If you haven't already, install Stack
- On POSIX systems, this is usually
curl -sSL https://get.haskellstack.org/ | sh
- On POSIX systems, this is usually
- Install the
yesod
command line tool:stack install yesod-bin --install-ghc
- Build libraries:
stack build
If you have trouble, refer to the Yesod Quickstart guide for additional detail.
Start a development server with:
stack exec -- yesod devel
If your are making changes to the frontend, make sure you rebuild it via webpack. If you are running the devel development server it should notice the change and rebuild. If not or you want to have a clean build make sure to:
stack clean && stack build
Or:
stack clean && stack exec -- yesod devel
If you want to test the process discovery miner make sure to execute the install
script (located in /test/logs/) to download a collection of logs (and delete
to remove afterwards). Then execute:
stack test
Interesting side note: stack test can also measure code coverage, i.e.
stack test --coverage
and then look into your build directory for the index.html.
If you want to run the server, execute:
stack exec process-miner
The host, port and other settings are located in /config/settings.yml. If you want to run it as a detached process (in the background, for Linux):
nohup stack exec process-miner &
If you merely want to test quick changes, you can also do:
stack exec -- yesod devel --port 8002 --tls-port 8003 --host '::'
See stack exec -- yesod devel --help
for more information.