Question
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
Infosys
IN
Last activity: 18 Jul 2017 10:38 EDT
A pre condition in an activity provides different values in different environments. Any thoughts on why this might be happpening and how this can be resolved?
A pre condition in an activity provides different values in different environments. Any thoughts on why this might be happpening and how this can be resolved?
***Updated by moderator: Lochan to close post***
This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
Infosys
IN
Hi All,
This issue is now resolved.
The values associated with both the variables were same. I had tried using the string functions equals and trim. But this did not work.
What worked was the string function replace all. We basically replaced all the blank spaces with "" in both the variables.
I guess there were spaces in the values which were not visible to the naked eye.
Thanks everyone for your responses.
![](https://accounts.pega.com/sites/default/files/pega-user-image/35/REG-34624.png?source=PUMINIT)
![](https://accounts.pega.com/sites/default/files/pega-user-image/35/REG-34624.png?source=PUMINIT)
Pegasystems Inc.
GB
Can you run a TRACER on both systems - first thing to check is that the same rules (by name/class,ruleset/ruleset-version) are running in each case.
If you are able to : you can provide the TRACER XML (label them 'good.xml' and 'bad.xml' please) to this forum so we can take a look ?
Thanks
John
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2024-04/0aeea859-d28c-4613-ad9b-910b23846ea5.jpg?h=f9b91d5d&itok=P_fwua_A)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2024-04/0aeea859-d28c-4613-ad9b-910b23846ea5.jpg?h=f9b91d5d&itok=P_fwua_A)
Pegasystems Inc.
GB
This really depends on what the pre-condition is, can you post the condition?
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
Infosys
IN
The pre condition is a very simple one. "pyWorkPage.CostBucketDetails(<CURRENT>).Tiers==pyWorkPage.SelectedCobrandTierDetails(local.loopcount).Tiers".
The purpose of the precondition is to iterate through 2 pagelists and compare the values in each of those lists.
We have checked to make sure that we are using the same rule and version.
Note: Trying to check if i can upload the good and bad xml files.
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2024-04/0aeea859-d28c-4613-ad9b-910b23846ea5.jpg?h=f9b91d5d&itok=P_fwua_A)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2024-04/0aeea859-d28c-4613-ad9b-910b23846ea5.jpg?h=f9b91d5d&itok=P_fwua_A)
Pegasystems Inc.
GB
You should be able to see the conditions being evaluated to either true or false, and the value of those properties on pyWorkPage in tracer. I would start there and see if the values are what you are expecting.
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
Pegasystems
US
>>> The pre condition is a very simple one. "pyWorkPage.CostBucketDetails(<CURRENT>).Tiers==pyWorkPage.SelectedCobrandTierDetails(local.loopcount).Tiers".
Wow, if that's a simple one, < insert inappropriate sarcastic stuff here >
Anyway, there are so many things you need to check if you're getting differing results in one situation vs another. All of these would affect the result:
0) Whether pyWorkPage exists
1) Whether page <CURRENT> already exists. I've heard rumors that different versions treat nonexistent page references differently.
2) Similarly, whether CostBucketDetails list already exists at all.
3) Value of Tiers on the left side of double-equals
4) Whether SelectedCobrandTierDetails exists
5) Value of local.loopcount
6) Value of Tiers on the right side of doble-equals
Many of the above should be visible in a trace file. Or you could use log-message just before performing the condition, to show the values. /Eric
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
Infosys
IN
Checked with the team and unfortunately i will not be able to share the trace xmls.
Marc Alderman: checked the tracer for both the cases. Even though the values associated with the variables are the same the condition evaluates to true in one environment and false in the other.
We even tried functions for trim, ignoreCase and also the function equals instead of "==".
![](https://accounts.pega.com/sites/default/files/pega-user-image/35/REG-34855.png?source=PUMINIT)
![](https://accounts.pega.com/sites/default/files/pega-user-image/35/REG-34855.png?source=PUMINIT)
Pegasystems Inc.
US
What type of data are you comparing? If you're comparing strings (my basic assumption), you might try something like pyWorkPage.CostBucketDetails(<CURRENT>).Tiers.equals(pyWorkPage.SelectedCobrandTierDetails(local.loopcount).Tiers)
I'm not sure why you're seeing different behavior in different environments, but hopefully that will work for you.
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
Pegasystems
US
There are so many possibilities here of what could be different between the two envs. Some more things to think about:
1) Are the two environments differing every time through the loop, or only after a certain number of times through ? Maybe one env has more iterations than the other ?
2) Is one env perhaps not even hitting the loop at all due to a previous piece of logic ?
/Eric
Accepted Solution
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
Infosys
IN
Hi All,
This issue is now resolved.
The values associated with both the variables were same. I had tried using the string functions equals and trim. But this did not work.
What worked was the string function replace all. We basically replaced all the blank spaces with "" in both the variables.
I guess there were spaces in the values which were not visible to the naked eye.
Thanks everyone for your responses.
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
Pegasystems
US
Hmmm. If you remove all spaces before comparison, you're going to say that "wonder by" equals "won derby" . Are you ok with that sort of relaxed association ?
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
Infosys
IN
Hi Eric,
For this particular field, we are ok with that sort of relaxed association.