I am doing a Mendix training right now. And I have been bugged by a question in the knowledge check for Error Handling part. The question is below
What happens if the same microflows are used, but the error handling on the main microflow is Custom with Rollback and the error handling on the sub-microflow is Custom without Rollback?
And the correct answer is:
The Order, OrderLine, and Log objects are rolled back while the Customer object is committed to the database
The Microflow on questions is :
My understanding is:
When the error in the mainmicroflow happens the Create Order should be rolledback but the Change in Customer should be committed since the main microflow uses Custom with Rollback
and in the sub microflow both Orderline and the Log should be committed since the submicroflow uses Custom without Rollback
.
Question:
Why is the correct answer The Order, OrderLine, and Log objects are rolled back while the Customer object is committed to the database
Below is Image as proof:
Note I used to work for Mendix on their microflow engine (among others) 3 years ago but many things have changed. It seems you're using a concept that is new to me which is the error event (where you exit your submicroflow) which according to the documentation at https://docs.mendix.com/refguide/error-event rethrows the error caught earlier.
I'm guessing that's why this is happening and would expect the order/orderline/log to be committed if you would exit that submicroflow with a normal end event after handling the error.