cancel
Showing results for 
Search instead for 
Did you mean: 

Completing review task with REST api

mattihuida
Champ in-the-making
Champ in-the-making
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 4

romschn
Star Collaborator
Star Collaborator

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

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

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.

Use 'prop_wf_reviewOutcome' instead of 'prop_wf_ReviewOutcome'.   

 

e.g.

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