cancel
Showing results for 
Search instead for 
Did you mean: 

List all available process deployments and start a process instance via REST

b_schnarr
Champ in-the-making
Champ in-the-making
I want to list all available deployed processes in a user frontend via rest, chose one of them and start a process instance of the chosen process definition via rest.
According to the documentation, the REST POST-Method "http://host-ip/activiti-rest/service/runtime/process-instances" can start a process instance by process definition id or by process definition key.

I use the GET-Method http://host-ip/activiti-rest/service/repository/deployments to list all available processes. But as the result, I do not get the process definition id or the process definition key as an answer. Therefore, I can not start a process instance with this information.

When I try to list all process definitions with the GET-Method http://host-ip/activiti-rest/service/repository/process-definitions, I get the following error message back:

{
  "errorMessage": "unknown type 'user' approver",
  "statusCode": 400
}

Therefore my question: Which REST-Calls do I need to display all available processes and start process instances via rest?

Best regards
Ben
6 REPLIES 6

b_schnarr
Champ in-the-making
Champ in-the-making
Sorry, the problem is described here but not solved already: http://forums.activiti.org/content/problems-512-demo#comment-21752

b_schnarr
Champ in-the-making
Champ in-the-making
Another problem: I have a simple process containing 3 User Tasks. This process has the processDefinitionId = "Ausgabe_beantragen:2:2288". The first user task is assigned to the initiator, so in the web modeler, assignee is set to ${initiator}. When I start a process instance with the post method
http://10.120.40.24:8080/activiti-rest/service/runtime/process-instances with the body

{
   "processDefinitionId":"Ausgabe_beantragen:2:2288"
}

the request is successful. In addition, I´m sending the kermit credentials as basic authentication. But afterwoods, the kermit user has so task in the inbox, even though he is the initiator.

Did I miss something. Thank you for your help.
Best regards, Ben

b_schnarr
Champ in-the-making
Champ in-the-making
Solved.

jbarrez
Star Contributor
Star Contributor
Could you explain whats wrong so others can benefit from your struggle?

b_schnarr
Champ in-the-making
Champ in-the-making
It was my fault. If you send the credentials in the header, everything works fine. Therefore, there isn't a Bug.

jbarrez
Star Contributor
Star Contributor
Ah i see 🙂