cancel
Showing results for 
Search instead for 
Did you mean: 

SAP Cloud business workflow - Restart workflow in Rejction

sankar_bhatta
Participant
0 Kudos

HI Experts,

I have built a small workflow in my HANA cloud trail account which has three steps, I have added some UI to the user task which has approve and reject button and added some code to the buttons ( of course by following blogs, not on my own). the code for Approve or rejection button is as below

_completeTask: function(taskId, approvalStatus) {
var token = this._fetchToken();
$.ajax({
url: "/bpmworkflowruntime/rest/v1/task-instances/" + taskId,
method: "PATCH",
contentType: "application/json",
async: false,
data: "{\"status\": \"COMPLETED\", \"context\": {\"approved\":\"" + approvalStatus + "\"}}",
headers: {
"X-CSRF-Token": token
}
});
this._refreshTask(taskId);
}

I would like to know how we can restart the workflow when user rejects the task?

Accepted Solutions (1)

Accepted Solutions (1)

Sesh_Sreenivas
Advisor
Advisor
0 Kudos

Hi Sankar,

You need to do the following:

1. In the source code, based on the button clicked (approve or reject), set approval status as true or false.

2. In the workflow model, add an exclusive gateway after the user task.

3. Here you can create two different sequence flow - one for approved and other for rejected.

4. Mark one of them as a Default flow, and for the other check for the approvalStatus flag.

5. If it is rejected, then you can go back to the previous steps (for example, to correct the values).

6. If it is accepted, then go ahead in the workflow.

Refer to the image below and the help document.

sankar_bhatta
Participant
0 Kudos

Hi Srenivas,

First of all thank you so much for taking your time and replying to my query. I will definitely follow the instructions and check this.

thanks,

sankar.

Answers (0)