cancel
Showing results for 
Search instead for 
Did you mean: 

On click of an outcome how to avoid saving data?

amruta_w
Star Collaborator
Star Collaborator

Hello,

I have process with three task, in the first task i will enter the full name and submit it will go to next task that is second. the second task just displays the full name using display value, here i have edit outcome which takes to next task that is third. In the third task i will display full name using text box, here i have cancel outcome if changed full name different value with exiting value, when i click on cancel outcome the changes should not be saved just move to second task.

Anyone suggest me solution.

Thanks & Regards

Amruta Wandakar

1 REPLY 1

amruta_w
Star Collaborator
Star Collaborator

I found my solution as follows


private cancelFormValues: FormModel;
formOldValues: any;
onFormLoaded(event) {
this.formOldValues = JSON.stringify(event.values);
this.formOldValues = JSON.parse(this.formOldValues);
}

if (event._outcome.name.toLowerCase() === "cancel") {
event.preventDefault();
this.cancelFormValues = new FormModel();
this.cancelFormValues = this.formOldValues;
this.formService
.completeTaskForm(this.currentTaskId, this.cancelFormValues, event._outcome.name)
.subscribe(
() => {
this.taskList.reload();
},
error => { alert(error); }
);

}
Getting started

Explore our Alfresco products with the links below. Use labels to filter content by product module.