BPM popup window that user can type in

Calvin,
I am not sure on how to do what you are asking, but I put different comments in the BPM form each time it popped up (those comments come through on the email messages). The Update method is INACTIVE when I make the MasterUpdate method Active. I have never run with both directives active at the same time. The MasterUpdate runs twice, the Update only runs once.

I don’t have access to Epicor anymore so I’m going off of memory.

There is a way to tell is a method was called from another method. I think this is mostly for when you explicitly call another BO method from within your BPM. Then in that 2nd BPM you can test to see if it was called by your BPM, or by natural flow of BO processing.

After looking through the documentation, what I might have been thinking about is the condition block type:
“This directive has been enabled from the specified directive”

Which might only be helpful in that example I mentioned where one BPM explicitly calls another.

I wonder if you cane set a CallContext variable at the end of your MasterUpdate BPM, and have a check for that value just prior to the email widget. If the value is what you set it to, then it must be the second iteration of the BPM

One more thing… The examples in the ICE manual show using BPM Forms in Post-Processing directives. Which kind of makes sense. The fire after everything is done and pausing one of them wouldn’t hold anything else up.

Can you add break you BPM into two parts. One to do whatever you need done prior to the process (i.e the Pre-Proc BPM), and the email notification done in the Post-Proc BPM

Pre processing is just as valid. I’ve used them frequently for taking input before an update.

What happens when a BPM has form, but the method wasn’t initiated by a user?

Like if you have one that fires when an import or update via DMT happens.

Typically put in conditions to short circuit the form.

And how do you do that? Check the user, and make sure DMT sessions use a particular user account?

Yup, that’s one way.
Another is to check clientContext.AssemblyName to see if it’s null.

When I run a trace (when the MasterUpdate Directive is enabled), I do see the Method running twice.

When I run a trace (when the Update Directive is enabled), I still see MasterUpdate running twice, but in this scenario, the update gets stopped by the error message:

image

Should I be running my BPM on a different directive?

Does Master update run twice with neither BPM enabled? If it doesn’t, then it’s something in your BPM that is causing it to run a second time. I would then try doing the email part on a post-proc.

Master Update runs twice even with neither of these BPMs enabled.

Try setting a BPM call Context variable at the end of the Master update, and checking for it near the beginning. The first time MstrUpdt is called the variable shouldn’t be set yet and you’d know your in the first call. If it is set your in the second call.

That wouldn’t have worked anyway. Server side code, with no way to hook back for the popup.

So when you make a change an click save on an OrderHed (and also pushing those changes to the lines and releases), what method is firing? Update or something else?

It’s always best to enable tracing, then do it in the UI to see what fires.