Completing review task with REST api

cancel
Showing results for 
Search instead for 
Did you mean: 
mattihuida
Member II

Completing review task with REST api

Hello, how can I set a review task as either approved or rejected through the REST api? I'm fairly sure it's done using the PUT method with state as completed, but I have no idea what variables to set. I wasn't able to find anything about it in the forums or docs. Thanks for any help.
4 Replies
romschn
Senior Member

Re: Completing review task with REST api

One way of doing it is using the following way.You should be able to complete the workflow task.

URL: http://serverSmiley Tongueort/alfresco/service/api/task/activiti%1234/formprocessor
(Note : Give the task id in the url after /task as shown above)

Type : POST request

Note : use the appropriate property name which holds the outcome of the workflow task in the following example request JSON. You can additionally set the other properties as well.
JSON Request body:
{
"prop_wf_ReviewOutcome":"Approve",
"prop_bpm_comment":"good",
"prop_transitions":"Next"
}

Thanks & Regards,
Ramesh Chauhan

My book contribution on Alfresco - Learning Alfresco Web Scripts
My blog - http://alfresco-for-developers.blogspot.in

pat9rv3sousa
Active Member

Re: Completing review task with REST api

Hi. I read this and I try to make this, but the task becomes "Rejected" instead of "Approved". Any solution?
romschn
Senior Member

Re: Completing review task with REST api

Kindly provide the details about what you have tried? Which workflow task you tried to end, what parameters you used in JSON and so on.
gmelahn
Active Member

Re: Completing review task with REST api

Use 'prop_wf_reviewOutcome' instead of 'prop_wf_ReviewOutcome'.   

 

e.g.

{
"prop_wf_reviewOutcome":"Approve","prop_bpm_comment":"nice work","prop_transitions":"Next"
}