I have a Standard Data Directive where a popup is placed at the beginning of an “Enter Custom Code” element before anything is read from the “foreach”. See attached.
I have seen this code fail without displaying the popup, which seems impossible.
When the code runs successfully however, the popup displays. The failure is happening further down in the code.
Am I missing something fundamental about BPM or C# ?
Is it somehow looking ahead and deciding it will fail? I have never seen anyone/anything address this, and most scratch their heads.
Am I wrong in assuming that the C# code is executed from top down?
If so, I would be most appreciative if someone could explain it.
Also, the BPM itself has nothing that could fail before this block of code.
If it fails in a code block, I believe it rolls back the transaction so as to not mess up your DB.
You will not see any InfoMessage anywhere (even the first line) if it throws an exception.
It’s frustrating if you want to include debugging messages as popups.
I use Ice.Diagnostics.Log.WriteLine() which writes to the event viewer on the server.
Try-catch only gets you so far. Based on her screenshot, I’m assuming she’s getting some error and is trying to locate the step at which it crashes because you can get ambiguous stuff, including in the try-catch.
By using the Ice.Diagnostics.Log.WriteLine() it actually writes to the event viewer as it is happening, so you can add step messages to narrow down the line that is failing.