By ‘It errors’, do you mean if the publish errors or the update errors? Also, I don’t quite understand what do you mean by
It will be easier to understand your scenario if you describe your flow.
Finally - Exit step is used to signal the calling service the status of the called service… its use is not mandated unless you wanna signal to the runtime to perform a rollback - for example signalling notification to rollback a message taken off by a listener from a queue.
Anyhow, based on my understanding of what you are trying to do - that is, you publish a document and if the publish step throws an error, you want to update a flag to ‘E’, but if the publish is successful, you wanna update it to ‘P’. You can publish the document and then call your update adapter service to update the flag to ‘P’ as the next step. If the publish causes an error, the update service will never be executed and the flow will go to the catch block. In the catch block, you can again call the update service to update the flag to ‘E’. HOWEVER, if for any reason, you plan to use EXIT[signal failure] as the last step in your catch block, you must use explicit transaction (pub.art.startTransaction and commitTransaction) to commit the update, because in absence of an explicit commit, the EXIT step will tell the runtime that the service has failed and the update will be rolled back.
To summarize the role of EXIT vis-a-vis the transaction in your scenario… if you do not define explicit transactions, IS runtime keeps a track of the modifications made by your service to the database, and if the service completes successfully (ie has last step as EXIT[signal success] or has no EXIT), the runtime commits the transaction but if the service fails (has EXIT set to signal failure), the runtime rollbacks all the database changes. Now, if you wanna use the EXIT[signal failure] step in your flow for some reason and still want to commit the changes in the database, you will need to use explicit transactions. Just start a transaction, call the adapter service (insert, delete or update) and then commit the transaction. Thereafter, even if you use EXIT[signal failure] the update will not be rolled back.