cancel
Showing results for 
Search instead for 
Did you mean: 

can't start a process instance by REST API

jerrylo
Champ in-the-making
Champ in-the-making
I can't start the demo "createTimersProcess" process by REST API, the activiti version is 5.15.1.

my operations as the follow:

step 1. in RESTClient, I input
method: GET
url: http://kermit:kermit@192.168.75.199:8080/activiti-rest/service/repository/process-definitions

response is normal:
{"data":[{"id":"createTimersProcess:1:36","url":"http://192.168.75.199:8080/activiti-rest/service/repository/process-definitions/createTimersProcess%... timers process","description":"Test process to create a number of timers.","deploymentId":"20","deploymentUrl":"http://192.168.75.199:8080/activiti-rest/service/repository/deployments/20','resource':'http://192.1...}],"total":1,"start":0,"sort":"name","order":"asc","size":1}

step 2.
method: POST
url: http://kermit:kermit@192.168.75.199:8080/activiti-rest/service/runtime/process-instances
body: {"processDefinitionKey":"createTimersProcess"}

response is:
{"errorMessage":"The server is refusing to service the request because the entity of the request is in a format not supported by the requested resource for the requested method","statusCode":415}

is there anyone meet the same problem ?
12 REPLIES 12

ekolesnikov
Champ in-the-making
Champ in-the-making
Yeah. You've been restletted.

Accept: application/json
Content-type: application/json

You need these headers for all POST requests.

sahusunil
Champ in-the-making
Champ in-the-making
I am also having similar issue but error is that resource is not available. I can start the process from activiti-explorer but when I try to start the same process using rest-api, it gives me below error message that requested resource is not available. I did add content-type as suggested above but I am still getting same error. Any help will be appreciated.

HTTP Status 404 - /activiti-rest/runtime/process-instances/
type Status report
message /activiti-rest/runtime/process-instances/
description The requested resource is not available.

Thanks
Sunil

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi Sunil,

from user guide:

404 - Not found The operation failed.The requested resource was not found.

does your deployment contain requested resource?

Regards
Martin

Hi Martin.
Yes, my deployment has the requested resource. I have verified using process definitions list and I can see all the process in output from rest-api but when I try to start the process, it gives me below message. I have already tried with other in-built process definitions which comes by default with activiti engine like Account maintenance or billing, I am having this issue for every process definitions. Do I need to make any setting change for rest-api application? Activiti-explorer and Activiti-rest both are pointing to same SQL server database. I just ran Client statements process from Activiti-explorer and I was able to see the task from rest-api which means both are pointing to same database.

HTTP Status 404 - /activiti-rest/runtime/process-instances/
type Status report
message /activiti-rest/runtime/process-instances/
description The requested resource is not available.

sahusunil
Champ in-the-making
Champ in-the-making
In Request section,
I have selected method as "POST"and gave the URL http://localhost:8080/activiti-rest/runtime/process-instances/
In Header section,
I have authorization, Content-type and Accept.
In Body section, I have added below process definitions information, I tried with id and key both.
{
   "processDefinitionId":"accountMaintenance:1:204"
}

next I click on SEND button and I get 404 code. I don't see any hit on tomcat server when I call this method but I do see hit when I call other method like getting task list.

Thanks
Sunil

trademak
Star Contributor
Star Contributor
Hi Sunil,

I think the URL is not correct. I would expect a URL like http://localhost:8080/activiti-rest/service/runtime/process-instances

Best regards,

sahusunil
Champ in-the-making
Champ in-the-making
Hi Tijs,
That's what I thought. I tried it already but I was getting below error and user guide also says to use http://localhost:8080/activiti-rest/runtime/process-instances so I was not sure. Can you please confirm if Request body is correct as I have mentioned above.

Error:
{
  "errorMessage": "The server is refusing to service the request because the entity of the request is in a format not supported by the requested resource for the requested method",
  "statusCode": 415
}


Thanks
Sunil

sahusunil
Champ in-the-making
Champ in-the-making
Never mind..issue is resolved now. Thanks Martin and Tijs for your help.

Thanks
Sunil

vrdhn
Champ in-the-making
Champ in-the-making
I have got the same problem with you. Can you please share to me the solution?