It is my understanding that the messages are merely queued and delivered after execution is done. So when you see 10 message-boxes in a row, the code already is done executing, you are not stopping execution.
Thats why I never use MessageBoxes to debug but instead
Yes because the exception is rolling back everything that is queued up to fire otherwise. Remember that the sequence of events is fixed and it doesn’t ping pong back and forth between UI and back end. BPM forms are the only exception, but when you review the BPM sources they have special conditions for handling that interruption.
So if you look at the BPM Code the Email is sent during execution…
The MessageBox is Published to the stack… actually if you do it through Reflection it is added to the Context and the client probably reads the callContext and says “Oh I got stuff to show”.
I just did a test with multiple Pre-Procs enabled.
The first one (with a lower order number) is just a BPM that always shows a message.
The second has the exception.
When the second one results in the Exception, the first one’s message doesn’t show. I assume any actions in the first one (like: email, autoprint, invoke BO, etc…) would have processed.
Or does the result in an exception in ANY enabled pre-proc prevent the execution of other Pre-procs on that BO method?
It wont… if you do the exception that way, it does a throw (immediate). The other way you can do exceptions via code is AddBLException which adds it to a stack to be shown at end – but the widget does a throw.
Anything returned to the UI that is not a BPM form is queued and shown all at once. This is what happens when an adapter runs a method (90% of the time, but you’ll find weird adapters no doubt.)
Below includes everything that handles writing trace messages firing pre, base, and post. Because you are sequential on this side from a single call injecting a show message mid run of all of this would take some pretty significant restructure of their framework.
It’s assumable that on kinetic because of async calls available and the nature of promises the sequential behaviour you’re expecting is possible, however the framework won’t support it as far as i’m aware. Maybe someday.
@ckrusen here is another one for you… if you call a UBAQ and the UBAQ BPM throws an exception or MessageBox and the parent BPM throws an exception – it also will not show. The MessageBox is the exception here – its is unique, special.
The other issue with WriteEntry using Ice is you can’t categorize. We wrote a dll aptly named “BetterLog” that uses the System logging methods, it makes the event viewer palatable