BPM Workflow Designed Condition "This application instance is a production instance" not evaluating as expected in Epicor Cloud

We created several data directive workflows that we want to include the “This application instance is a production instance” condition statement, which does not evaluate as expected in a cloud environment. We want to record changelogs and send out email notifications only from our production environment without having to disable BPMs on our pilot or third database during a refresh.

I would like to be able to accomplish this by inserting a condition into the workflow however “This application instance is a production instance” does not evaluate as expected in the cloud environment.

It was previously recommended that we create a function that checks ice.sysagent.filerootdir however that doesn’t seem to be a solution to data directives because of the following:

Data Directives do not allow me to invoke functions

Neither Method nor Data Directives will enable me to select variable type - Choose type - Services - which would let me access the ice.bo.sysagent - ice.tableset.sysagenttableset to define a table set to “fill table by query”.

There is a setting under the Company Maintenance screen called “Is Live”, which would probably be the best choice; however, SysCompany is not an available assembly in the data directive to select the correct table variable type and therefore I cannot import it via Fill Table by Query.

It seems it might be possible to simply import one of these fields via set Argument/Variable to a specified expression and specify a C# expression that would check one of these, but I am not sure how to accomplish the task. Any Suggestions?

I ran into the same thing. I figured it was just a bad setup, but if you have the same issue perhaps there is a reason for it…

Welcome Kevin!

Are you familiar with the REST services? You can check the setting using this endpoint:

Not saying this is what you should do, but if you need to, you can.

You just have to work around it by either calling via rest, or another bpm, ubaq, whatever.

I am somewhat familiar with REST services, but not in the specific context, how would I use REST services within a data directive?

Can you clarify, “Not evaluated as expected”. What were you expecting and not getting or what were you getting but not expecting?

In a data directive, if you want to use the BO he is referencing, you don’t need to use REST.

Here is how to use it in In-Trans:

Must use custom code block:

//reference: Ice.Contracts.Lib.ClientFunctions

//using Ice.Assemblies;
//using Ice.Contracts;

//BPM Variable isProduction - Boolean

using( ClientFunctionsSvcContract cfs = ServiceRenderer.GetService<ClientFunctionsSvcContract>(Db) )
{
    isProduction = cfs.GetIsProductionInstance();
}

Here is how to use it in Standard:

You can use it with the Invoke BO Method Widget.

Select Ice → Simple Service → Client Functions and choose search.

Choose GetIsProductionInstance.

Configure the mapping to return the value to a variable.

1 Like

Can you clarify, “Not evaluated as expected”. What were you expecting and not getting or what were you getting but not expecting?

I expected my condition to take the true branch off the condition, it did not, I did no further testing.

The BPM Condition for “Production Instance” is based on the setting configured on the SysCompany Record and that value can be set from the Company Maintenance UI - even for Cloud.

That value needs to be set to “not Live” when a DB is copied from Live to Pilot / Dev.

This might lead me down the right path; however, this client function does not appear to evaluate as true in my live environment, I think I’ll have to figure out how to invoke a function to return the syscompany.islive

I would recommend finding out what the current setting is for sure using one of three methods given in this thread, the easiest is Rich’s suggestion using Company Maintenance.

Yeah, in my initial rollout, I just tested it on our test and pilot databases and assumed it was evaluated correctly in live, so we lost the functionality of the BPMs for a while.

I don’t know how to check that I attempted to fill table by query, but I can’t select the correct data type.
I likely need to look further into using invoke BO function to be able to accomplish my goals.

I believe the “This application instance is a Non-Production/Production instance” condition is not related to the checkbox you see in Company Maintenance.

Instead the “Set as Production” option should be set in the Epicor Administration Console in the appserver settings.

image

You can request the Epicor Cloud team to do this for you.

1 Like

I have attempted to input this exactly on my in-trans BPM here is what I get:
image

You’ll have to add that assembly in the references.

And that BPM Variable was a variable set in the widgets.

However, I believe we determined that this check is not reliable, so it may be a moot point.

Animated GIF

The way I check it is check the Session.AppServerUrl.

I will have to take another look, this has been a background project I have been working on, but I do not believe I was previously able to pull that in a data directive.

Haven’t been back to the forums for a bit, but I realize I never updated this.

So after some pulling of teeth with the EpicCare support team/development we were finally able to get this fixed and the condition works properly, There are some different settings that can be set via Rest API relating to “is production”. only one of which is crucial.

I cannot remember which and finally did the trick but I was able to ask EpicCare support to resolve the issue and they were able to do so.