To prevent spam users, you can only post on this forum after registration, which is by invitation. If you want to post on the forum, please send me a mail (h DOT m DOT w DOT verbeek AT tue DOT nl) and I'll send you an invitation in return for an account.

REST API for ProM

Hello everyone! I'm trying to implement a set of REST APIs to encapsulate ProM for automation.

I worked out a docker image(zhicwu/prom on Docker Hub) as starting point. Moving forward, I plan to add embedded web server along with a few Groovy/Java code to expose some functions. I know ProM can run in either UI or CLI mode, and the latter one seems ideal for implementing backend services. However, it's not well supported in all plugins, and the script engine is BeanShell(better to use BSF/JSR-223 or Groovy IMHO).

I'm sure I'm not alone, so appreciate if you can share some thoughts or concerns regarding this.
Tagged:

Comments

  • NiceNickNiceNick Posts: 20
    Hello zhicwu,
    I have a docker container (self made, also) which has a backend in Python (using Flask) that I use to convert CSVs into BPMNs and does it successfully. I use the subprocess package to run the commands to start the scripts. What concerns do you have in particular?
  • zhicwuzhicwu Posts: 3
    Thanks for your reply @NiceNick. I'm trying to turn ProM into a server, so I'm asking around to see if someone already did that. Just built a new image for demonstration - any feedback is welcome :)
    $ docker run --rm -d -p5678:5678 zhicwu/prom:6-server
    ... wait until the server is up ...
    $ cat test.groovy
    import org.deckfour.xes.classification.XEventNameClassifier

    import org.processmining.alphaminer.parameters.AlphaMinerParameters
    import org.processmining.alphaminer.parameters.AlphaVersion

    def log = prom('open_xes_log_file', 'example-logs/repairExample.xes')

    println("Mining model")
    def net_and_marking = prom('alpha_miner', log,
    new XEventNameClassifier(), new AlphaMinerParameters(AlphaVersion.CLASSIC))
    def net = net_and_marking[0]
    def marking = net_and_marking[1]

    println("Saving net")
    File net_file = new File("/tmp/mined_net.pnml")
    prom('pnml_export_petri_net_', net, net_file)

    return 'Done'
    $ curl -X POST --data-binary '@test.groovy' http://localhost:5678/script
  • NiceNickNiceNick Posts: 20
    What I have is a webservice with a flask backend that receives 2 files from the user (one CSV and other with parameters) and I mine (using the HeuristicsMiner) that CSV. Then, I send the mined BPMN to the user.
    I don't understand if you have any question in particular that I can try to help or just looking for more ideas.
  • zhicwuzhicwu Posts: 3
    Thanks again. Just looking for more ideas and concerns :)

    Anyway, I'm almost done with building the core REST APIs around ProM. Will start a new thread when I run into issue.
  • @zhicwu Hello, I am interested in developing ProM into a server. Do you have github for sharing such code? I would like to have a look and further develop if it is okay :smile: 
Sign In or Register to comment.