Search code examples
restjbosshandlerjbpmjbossfuse

How can I handle parameters received from REST request in JBoss BPM Suite?


I'm trying to integrate Jboss Fuse with Jboss BPM Suite, I'm able to run a Business Process via REST request in a Fuse camel route.

I would like to sent parameters from Fuse like /start?var=value, but i don't know how to retrieve it in JBoss BPM and how to handle it.

For example I would like to send an int value to the BPM, in there I would like to set a rule and choose what to do according to this value. I can call the REST request from Fuse but I can't understand how to retrieve this value in the bpm suite.


Solution

  • JBPM documentation says the following about passing request parameter and receiving it in BPM process

    If you pass the query parameter map_kEy=vAlue in a REST call, then the Map that's passed to the actual underlying KieSession or TaskService operation will contain this (String, String) key value pair: "kEy" => "vAlue".You could pass this parameter like so:

    http://localhost:8080/kie-wb/rest/runtime/myproject/process/wonka.factory.loompa.hire/start?map_kEy=vAlue

    Map query parameters also use the object query parameter syntax described below, so the following query parameter, map_total=5000 will be translated into a key-value pair in a map where the key is the String "total" and the value is a Long with the value of 5000. For example:

    http://localhost:8080/kie-wb/rest/runtime/myproject/process/wonka.factory.oompa.chocolate/start?map_total=5000