'Starting jbpm process with REST API with parameters and document attachment

I am using jbpm version 6.5.0. I have requirement to call process through REST API and I am successful to start process with parameters.

I am testing it with postman. The thing is that there is also requirement of document attachments on starting by REST API, for that I have followed link (https://access.redhat.com/solutions/2567701 ) but unsuccessful to attach document in same process. The REST API URI provided in followed link is

http://server:port/kie-server/services/rest/server/containers/{containerName}/processes/{processId}/instances this is not working . I am stuck with containerName in the link .

Secondly, I have confusion i.e. there are 2 uri which starts process on is for sending parameters on RESTAPI and other is for document attachment RESTAPI. Will both of the REST API called by the application which want to start process . I have check following to check containerName but unsuccessful.

http://localhost:8080/kie-server/services/rest/server/containers running successfully with out containers list

http://localhost:8080/kie-server/services/rest/server running successfully

http://localhost:8080/kie-server/services/rest/server/containers/%7Bid%7D Failure with msg Container id is not instantiated

Kindly provide me solution or steps any tutorial which have clear steps to achieve the task .



Solution 1:[1]

I am not sure whether it is too late to answer now. Here it is anyway.

For the classic employee evaluation process example of jBPM documentation, the HTTP request to create a process instance looks like the following. "evaluation_1.0" is the process container id and "evaluation" is the process id/name.

POST /kie-server/services/rest/server/containers/evaluation_1.0/processes/evaluation/instances HTTP/1.1
Host: localhost:8080
Authorization: Basic {basic auth token}
Content-Type: application/json
Content-Length: 43

{"initiator": "<jbpm user name>", "employee":"<employee name>"}

`

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Prasad