Quest: How minimalistic can it be to create a process instance from within HTML?

…if you want to transfer process variables that can either be hidden or input fields - e.g. a form?

I want the audience of my Camunda demos to be integrated and able to start my processes - yes I want workload :smiley:
So my idea is to deliver a simple HTML website in the wlan network anyone has access to.
He can enter his name or pseudonym whatever and can then take part in starting the encoded process.
The name is for discussing the according instance with the audience or the person who has started it.

I’m not very experienced in HTTP and HTML, so hope to get more help here.
As far as I researched I need:

  • Post request with Content-type application/json in Header.
  • the process variables should either be manually edited via the website (input fields / forms)
  • additional process variables should

As a result it seems for my that without at least Javascript it is not possible.

I found a JSON format lib anywhere that does the job - but I would like if I can get rid of it or do it more minimalistic?

You can find my actual (and working) version attached.

The JSONFormat lib has this hint included:
W3C HTML JSON form submission/json/
So I suppose my approach ends at this point.

Do you have better idea of starting an process instance from a website that allows entering data and transfers it to a camunda process instance start call?

Also discussed with @BerndRuecker and @sebastian.stamm AskTheExpert channel Slack CamCon2020Live
codexgame.html.txt (1.1 KB)

According Slack channel link, that I was not allowed to add in the previous post

Something like what you have is probably as simple as it gets, setting aside differences in JS libraries that might make it easier/harder to construct the json data that you’re sending.

Just to offer an alternative, as a Java developer, I would probably solve the hard part server side. I might deploy a rest controller with my process engine (e.g. @RestController if using SpringBoot) that supports form encoded data. With this approach I can keep the html a simple form, as per your original idea, and keep any data manipulation isolated to a service layer inside my application.

Having said that, given the current complexity, I don’t see any real downside to your approach. If it turns into a larger application, you may find maintenance becoming harder and harder.

Thank you for your solution!
I would say your approach is the clean way to make the client side as simple as possible.
On the other hand - when you start from scratch with the camunda demo distro besides your client html file you need your java application for the server side, too.
That would make it a little bit to complex when you only want to do rapid prototyping and as less dependencies as possible.

Not necessarily to have the implementations in java delegates. Alternatives are you can implement the delegates as inline scripts also. Camunda supports groovy script and java script. So you can embed the script in the modeler itself

Does this really work when starting a process instance?