I have a DOM Instance that the current status is "error". I want to know the previous status the instance had before the "error" status to implement an action to retry running one more time the script that generates the "error". This Instance could transition to error status from multiple statuses (i.e. inprogress -> error, active -> error, ready -> error, etc.)
I checked the methods we have in DomHelper and also DomCache and did not find any useful method for that. Is it possible to get the previous status or latest transition on that DOM Instance?
Hi German,
I think this can be used to obtain the previous states of the DOM instance: https://docs.dataminer.services/user-guide/Advanced_Modules/DOM/DOM_history.html#changes-to-the-status.
Please let me know if you need further assistance.
Hi German,
As mentioned by Tom, you could use the DOM history to know this. You could retrieve the last few history records for that specific DOM instance and try to find the status transition. Do note however that the history is by default saved asynchronously, which means that there is no guarantee that this history record will be available when the DOM instance has entered the 'Error' state. This may not be the most robust choice depending on the workflow.
Could you maybe give some more background on how this retry would be triggered? Is this a manual action? You could maybe also already retry in the flow where the DOM instance is currently set to the 'Error' state. One way to also tackle this is to add some kind of 'Reason' field (enum or string) that gets filled in by the script that transitions to 'Error', which then could be used to know what needs to happen to rectify it.