Knowledge needed about Commits within Schedular or Microflow
I have a microflow which is called by a schedular. The microflow retrieves the first entity out the database with a certian enum state. The first action there after is to change the state to a new state before calling a microflow that performs a large number of retrieves and changes to a number of different entities through a loop. From what i can see the first commit of the entity simply doesn't actually commit. It's almost as if it's being rolled back somehow. I've read through the commit, schedular and rollback documentation. I can't seem to understand why it's doing that. There are rollbacks that are potentially being called in deeper microflows but according to the documentation once you commit an entity any further rollbacks do not affect it. I get the feeling I don't understasnd something about either the database session within a microflow or something deeper but I've reached a deadend. Is there any deeper documentation I could read or more detailed why i could potentially debug this problem?
The commit of the object (the transaction) is actually processed after completing of the microflow, so if you use a rollback before this moment, the object will be reset to the state of the last commit: In this case with the old status.
My advice would be not to rollback the object, or to use an endTransaction Java action (which basically executes the commit to the database immediately). You can find this action in the Community Commons.
Shouldn't this resolve your problem then you could also post a screenshot of your Microflow so we can look further into this issue.
And do not forget the community commons commitInSeparateDatabaseTransaction. When you use this Java action the commit will be seen by other microflows etc because it will commit the object in it's own transaction.