BPM programmatically determine which DB(live vs pilot)

I’d like one of our bpms to know what database it is running in, so it can behave differently in live vs in a test environment. Is there a way to query from a BPM what database we are currently running in?

this.Session.AppServerURL will return the app server url

I use this (which I found in another post):

if(this.Session.AppServerURL.Contains("targetAppServer")) { }
2 Likes

Starting in 10.2.500, there is also a Live flag that is set at the application server. Now Method and Data Directives have a new conditional available:

2 Likes

Nice feature!

Fair warning anything from REST this will not work with. So if you utilize the REST API don’t use this method.

1 Like

This didn’t seem to work for us, both Live and Pilot were production. Did they set up the cloud servers wrong? :thinking:

What didn’t work?

Its right there in my post - both the pilot and the live were flagged as production making it kinda useless.

Remove your pilot production status
image

We’re cloud customers. I guess we should make a case then?

1 Like

1 Like

Sorry, I didn’t register that. I would definitely file a ticket for that. Their copy Live to Pilot should ALWAYS turn that off, don’t you think? DevOps does that for you… :wink: