BPM Condition based on AppServer or Database


(Brendan Woodell) #1

Is there a way to check in a BPM if I’m using my Live system or my Dev system? I don’t see one in callContextClient which is where I might expect to find it. An example would be a BPM sending an email on a certain event, but when we copy Production over to our Dev environment we obviously don’t want those emails to send.

Currently we just have a list of things to disable, but am wondering if there’s a way to save a step and just require the BPM to be in Live to fire the email. Thanks!

(Monty Wilson) #2

Brendan, you could have it check something else that you always configure as soon as you create the Test environment. For example, we always change our company name. Unfortunately, if you forget whatever that thing is, then you’ve forgotten to disable the emails as well.

(Pierre Hogue) #3

I usually place this code and different variants of it at the beginning of my BPM’s

string appserv = “”;
if(Session != null && Session.AppServerURL != null)
appserv = Session.AppServerURL.ToString();
int index = appserv.ToUpper().IndexOf(“TEST”);
if (index != -1)
// it found the TEST version you could set a variable…
// you can continue…with other versions…


So you could use the condition where this code returns True if live, and false otherwise…
if true, fires the email…

Hope it helps…

(Brendan Woodell) #4

That is basically exactly what I was looking for. Thanks!