we have a value group property of type text and want to use a When rule to determine if the value of a Property on the workpage equals one of the value in the given value group. Here's a screenshot showing the when rule and an test data transform. In this case it works as expected:
In our case, the value group Property is not on the workpage, it is contained in another top level page. Adding that page to the Pages & Classes tab of the when rule and running it causes the When rule to fail. The result is neither true or false, it's an error message. Screenshot below.
Does anybody know a way to accomplish what we are trying to do?
This when rule is referenced as a precondition in an Activity step. That step needs to be skipped when the value of a property is equal to any value in the value group on the other page.
The error message is
The result is in RULE-OBJ-WHEN AZD-FW-AKTIONSPORTALFW-WORK-TEST TESTANYPAGE #20150430T132741.900 GMT: cannot be null. Details: Invalid value for aDirectory passed to PropertyReference.getTopPage(ClipboardPage, PageDirectory, ClipboardPage)
We are using Pega 6.3 SP1
Do I have a misunderstanding of the "Any" feature of in the when rule? I believ it is the @basclass anyEntrySatisfiesCondition Function Alias which references the entrySatisfiesCondition Function rule.
***Updated by moderator: Marissa 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.
yes, I have verified said page exists before evaluating the WHEN condition.
I've attached a RuleSet to the original Post demonstrating the problem.
It contains an activity rule called 'DemoOfBug' where I write the properties to the other page (and verify it is there). The following step has a precondition using said WHEN rule. The evaluation of that precondition fails with an error and therefor the activity aborts.
So, the problem seems to be referencing a page directly within the when rule rather than using a generic reusable rule and setting the context in the calling activity.
Using the above example, rather than having 2 seperate when rules TestAnyEmbedded and TestAnyPage you can use TestAnyEmbedded for both cases and specify TestPage as the step page in the activity that references the rule. The same is also true of the 2 difference Data Transforms.
e.g, so rather than this kind of configuration which causes the above error...
...use this kind of configuration which uses the more generic / reusable when rule and sets the context in the activity step page.
Although this solution dosn't fix the error as such, I would say that it is better practice to configure things this way and promote the resuse of existing rules.
Thank you Marc Alderman for investigating. I'll share you're findings and solution here.
As written in the original post, said when rule is used as a precondition evaluation for a step in an activity rule. Our original configuration was like in my second screenshot, where the when rule had to read the value group from the other page to compare the values with a property on our workpage.
The solution to this problem is to run the when rule in a context, where the value group property is on the current step page. So we were able to change the step page of the activity, and use the when rule as shown in my first screenshot. Therefor I had to change it's Applies-To class and reference the compared property ("Foo" from the screenshot) directly from the workpage.