cancel
Showing results for 
Search instead for 
Did you mean: 

Resume Execution using REST API

skrish
Champ in-the-making
Champ in-the-making
Hi,

I have a service task with class referring to a Delegate that is extending TaskActivityBehavior.
Objective:
Once the process instance is started, the execution pauses at this Service task and want to resume only after a signal is received.

I could resume the execution in Activiti Explorer using the REST call spec given at-
http://activiti.org/userguide/index.html#_execute_an_action_on_an_execution

PUT http://localhost:8080/activiti-rest/service/runtime/executions/
Payload:
{
"action": "signal"
}

However, I don't see an equivalent REST API in Alfresco Activiti.
When tried the same call with PUT and the same payload, getting a "404 - Not Found"

PUT http://localhost:8080/activiti-app/api/enterprise/executions/5001
Payload:
{
"action": "signal"
}

Can you please let me know how to resume the execution the way we do in Activiti Open Source?
Attaching the delegate class.

Thanks,
Siva
4 REPLIES 4

paulhh1
Champ in-the-making
Champ in-the-making
Hi Siva,

You've got the correct Enterprise part of the URL:
https://docs.alfresco.com/activiti/docs/dev-guide/1.4.0/#_activiti_engine_rest_api

But you've missed the 'runtime' part from the Engine API:
http://activiti.org/userguide/index.html#_get_an_execution

Let us know if that isn't the problem.

Paul.

skrish
Champ in-the-making
Champ in-the-making
Hi Paul,

Thanks for the response. I tried with the below URL:
http://localhost:8081/activiti-app/api/enterprise/runtime/executions/7501

7501  - Execution Id. (I have my tomcat configured to port 8081)

Getting a "404 Not Found" Response.

Thanks,
Siva

paulhh1
Champ in-the-making
Champ in-the-making
And this execution ID is returned if you get a list of executions (GET runtime/executions)?

A tenant ID also needs to be passed as a parameter (default is 1), even in single tenant set ups.

https://docs.alfresco.com/activiti/docs/dev-guide/1.4.0/#_activiti_engine_rest_api
Paul.

paulhh1
Champ in-the-making
Champ in-the-making
And does the user have tenant admin or manager permission/capability?  Access to the core engine API is only allowed for users with those rights.