Determine environment (Production vs Test) within BPM's, and DD's

In a condition block, test to see which environment (App pool) is executing.

The BPM’s or DD’s could be setup to only run in the Production environment.

We regularly copy the Production DB to the Test environment, but then have to selectively disable BPMs and DD’s

we use the condition : if this code returns true where code could be
(in case of our env are named ERP_TEST ERP_TRAINING and ERP_LIVE)

string res = "SessionNull"; 
bool log = false;
string appserv = "";
if(Session != null && Session.AppServerURL != null)
{
	appserv = Session.AppServerURL.ToString();
	int index = appserv.ToUpper().IndexOf("ERP");
	if (index != -1)
	{  
    res = appserv.Substring(index);
	}
	int index2 = res.ToUpper().IndexOf("LIVE");
	if (index2 == -1)
	{  
    //it is the production env, return true
		log = true;
	}
	
	return log;
}

if it returns true, the bpm will be active, otherwise, it will not.

But I agree it should be part of the conditions we can add…

5 Likes