I’m trying to come up with a kind a universal Error Handling for Workflows, in particular for ExecuteCommand Activities. Often enough they throw an exitCode > 0 and some commandOutput that may help the User.
BUT then there are the times where exitCode is 0 but the outputXml states an error-condition. Tried to check and handle that via OnComplete Scripts.This is where I am stuck. Sometimes the response is generic and has an errorCode and errorString Element to parse, sometimes the errorString is missing, sometimes errorCode is 0 but an warningCode Element is added, but that isn’t returned all the time. Sometimes it’s a longer App_***Response Reply with the issues tucked in somewhere.
Anybody know of a generic way to parse through all possible scenarios (mentioned or unmentioned) to catch issues right away, terminate execution and return useful consistent error Messages to User?
Thanks,
Stefan
Best answer by Stefan Vollrath
Hi Chris
Tried something similar to your first recommendation, after finding samples in BOL don’t really work. That works well when all those Attributes exist. If they don’t, or have different Attribute-Names, it gets complicated. Like I know errorString but can’t remember seeing errorMessage, maybe that’s something new in FR20+.
Current working prototype below. Open for recommendations on how to make it cover more conditions and less Null-Pointer-Exception-y (I’m a Java Noob)
if these are null then they didn’t exist in the outptuXml.
This works well if these are elements in the response which I believe is most of the case now a days but if you see any responses with these come across as attributes then your query would need to change to use the @ symbol
Tried something similar to your first recommendation, after finding samples in BOL don’t really work. That works well when all those Attributes exist. If they don’t, or have different Attribute-Names, it gets complicated. Like I know errorString but can’t remember seeing errorMessage, maybe that’s something new in FR20+.
Current working prototype below. Open for recommendations on how to make it cover more conditions and less Null-Pointer-Exception-y (I’m a Java Noob)
We use 3 different kinds of cookies. You can choose which cookies you want to accept. We need basic cookies to make this site work, therefore these are the minimum you can select. Learn more about our cookies.