How to execute a DMN through the REST API?

We have our instance of the application running on CF. The next step is to directly access the rules engine portion of Flowable.

We have looked at the DMN API for Rest yet the area handing the request is vague in how the request is built

Blockquote 7.4. Decision Executor
7.4.1. Execute a decision
POST dmn-rule/decision-executor
Request body:
The request body should contain data of type multipart/form-data. The decisionKey is required. The tenantId and a map of inputVariables (restVariables) are optional.

It would be nice to have an example so we can access. This is a request of the client that we focus on DMN and not BPMN at this point so please do not post trollish questions i.e Why not just use BPMN’s gateways. I already asked that and got “NO”.

Need the same thing, any updates ?


1 Like

I am looking to call the REST through Postman or CURL command…

Tried in Postman tool first with by setting Body -> form-data key=file and value= and tried submitting, it did not work.

Also tried CURL,
curl --user kermit:kermit -H “Content-Type: application/json” -X POST -d ‘{“decisionKey”: “intro”,“inputVariables”: [{“name” : “name”,“value” : “flowable”,“type” : “string”}]}’ http://localhost:8080/flowable-rest/dmn-api/dmn-rule/decision-executor

Hi Biyat,

the documentation part you’re referring to seems to be out of date. We will update this ASAP.
The correct endpoint is;

POST dmn-rule/execute

Since you’re running the Flowable Rest app perhaps it will be helpful to make use of the Swagger UI.
From there you can see all the endpoints available and execute requests from the browser.
The Swagger UI is accessible on; http://server:port/flowable-rest/docs/.



1 Like

Thanks, for others who might face the same issue, here is the correct command.

curl --user kermit:kermit -H "Content-Type: application/json" -X POST -d "{\"decisionKey\": \"intro\",\"inputVariables\": [{\"name\" : \"name\",\"value\" : \"flowable\",\"type\" : \"string\"}]}" http://localhost:8080/flowable-rest/dmn-api/dmn-rule/execute

The data needs to be converted to string from json while trying from command prompt. In Postman body, you can paste the JSON.

1 Like