Rollback changes made a non persistent entity from an editable form

0
I have an non persistent entity that is bind to an editable form. Some changes are made to the elements of the form. The form has both submit and cancel button. The cancel button calls a microflow and do a rollback on the object. But the values modified in the form is not getting rolled back. The object still has the values entered from the form. I cannot do the mendix cancel button because I have other activities I'm doing as part of the cancel microflow. Any input would be greatly appreciated.
asked
4 answers
1

Hi Vinod,

  The Rollback Activity, according to the documentation, undoes uncommitted changes and deletes objects that have yet to be committed.  I do not believe the rollback microflow action will undo changes to non-persistent entities that are never committed.  The platform has not stored the values that existed before the user changed them in the editable page.  

  What would you like the user to be able to do here?  Is it possible you need persistent entities in your workflow?

answered
1

Hi Vinod,

To make sure the custom cancel button works correctly you have to make sure the object is committed before showing the page.

This holds for both persistent and non-persistent objects as far as I know.

-Andrej

answered
1

After the rollback bring the object that is presented in the form to the desired state again by either reloading it from the database or creating anew and then showing the page again. 

answered
1

I first tried commiting the non persistent entity. And I saw that the roll back didn't work. Then I changed it to a  persistent entity and tried to commit and rollback on cancel. Its still not rolling back. Not sure what I'm doing wrong. Please advise.

Here are the details.

Following is my entity:-

 

Commit the changes after mapping the entity from a rest service as shown below.

 

Custom cancel microflow that rollback the changes.

 

answered