I'm working on a more robust file upload API for my site, but do not yet have a good solution for rolling back (deleting) files that were successfully uploaded if the database transactions did not complete successfully. I've wrapped the database steps in a transaction, but don't know how to test if the transaction was successful. Here's the basic idea of the API logic...
Files are uploaded and written to disk if they pass validation. A transaction is created to ensure data consistency as the Repeat loops through each file, checking its type and inserting into the appropriate table. (i was setting variables in each Condition to see the actual string of the file's "type"). If there's an error, then the Transaction should prevent any inconsistent data writes to the DB.
The Transaction component however does't appear to offer an exit status. So how would I know that the files now need to be deleted from disk if Transaction does a roll back?
Can I test for the Transaction exit status?