Discussion

Using pxResults as repeat element in XML Stream

The visual XML mapper in v5.5 is much appreciated.
I'd like simply map .pxResults() instances to a repeating element, but I'm getting a validation error. I looked around for some examples -- the OOTB XML rules are all legacy and do not use auto-mapping; KB-25626 does not cover repeating elements.

Here are the details:
Set .pxResults is on Pages & Classes, pointing to the expected class.
Created an element with Mapping Mode = Standard, Context Page = .pxResults.
However, Context Class remains as $CLASS.

When trying to save, I get an X on the repeat element, with the error message at bottom:
** Page class could not be resolved.

Jon

**Moderation Team has archived 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.

Comments

Keep up to date on this post and subscribe to comments

August 29, 2013 - 12:02pm

Holy mother of Moses. I am working on the same problem (nearly 4 years later) and hitting the same problem in v6.2. May I repeat what I wrote earlier:

 

I'd like [to] simply map .pxResults() instances to a repeating element, but I'm getting a validation error. I looked around for some examples -- the OOTB XML rules are all [mostly] legacy and do not use auto-mapping; KB-25626 does not cover repeating elements.

Here are the details: Set .pxResults is on Pages & Classes, pointing to the expected class. Created an element with Mapping Mode = Standard, Context Page = .pxResults. However, Context Class remains as $CLASS. When trying to save, I get an X on the repeat element, with the error message at bottom: ** Page class could not be resolved.

 

August 29, 2013 - 12:59pm

facing the same issue. Would love to see someone answer.

Pega
August 29, 2013 - 2:02pm

Try this:

 

Instead of using ".pxResults" try "Primary.pxResults" in Pages and Classes and on the Context Page.

 

If you then ask "What if it isn't Primary", I would say to make it be, since that is quite doable (by using "Apply Rule" on the element).

 

August 29, 2013 - 2:29pm

Thanks. First off -- what's the deal with this? Is this a known bug?

I tried Primary.pxResults in P&C and the Content Page reference. I got an error saying that I couldn't refer to "primary" since it's a reserved page. Maybe I need uppercase "P" -- but for now I switched over to hardcoding XML. :-(

As to "What if it isn't Primary" -- a couple of things. First, are you saying that this would work if I used a separate rule within the iteration? It's possible I've done this in the past to deal with this issue. Granted, sometimes it's nice to keep everything in the same rule (just as activities have been supporting multi-step loops).

This begs of an issue I raised regarding Declare Pages; I'll restate it here. If we want to produce a list of Foo, we most always end up putting it on Code-Pega-List. But we shouldn't use Code-Pega-List for lists of Foo, lists of Bar, etc, since we end up just overusing Code-Pega-List. Some would say to create a page of class of Foo, and then copy the list of foo there; I've seen that there.

Other approaches could be to create a specific FooList class, or otherwise a FooList property in our favorite class.

August 29, 2013 - 6:07pm

Ben -

I can do 2-levels of rules. But it's unable to recognize MyList.pxResults as a page. MyList is on class Foo, not Code-Pega-List, as above. I could try changing that... but then I'd have to put the service rule in Code-Pega-List as well, which doesn't seem like good rule naming practice.

This seems like a bug, so I may just submit an SR.

 

Jon

August 30, 2013 - 10:37am

Possibly it's addressed by HFIX-7858, Value List property not mapping properly on the XML rule

But I don't know.

August 30, 2013 - 12:23pm

Can you tell me what is that you are trying to achieve and what issues you are facing, as I have used repeating list extensively in XML and have not faced any issues.

August 30, 2013 - 12:28pm

Use the repeating option in the node tab of the element properties .more info see the KB-25626 ....6 th point screen shot.....

August 30, 2013 - 3:12pm

I am using repeating option. I do not see it in the 6th point screen shot of KB-25626.

Here's an example with a list we know and love, the list of assignments. I had, alternatively, put this in a rule with Applies To Assign- (since that is better organized), but I get the same results as with here. The P&C tab has .pxResults() of class Assign-; I had also tried using pxResuls without the parenthesis as well.

June 26, 2016 - 10:01pm
Response to JonnyGar

Hi JonnyGar ,

 

I frantically came searchin gto this post hoping for an answer.Did not find any. And by hit and trial , I found that it worked doing this:

 

The Root Node: ContextPage = Your Code-Pega-List Page (nothing else)

In your example : FederatedWorklist  ---> ContextPage : MyMainPage (Code-Pega-List)

Assignment: ContextPage ---.pxResults (class to be defined in pages in classes) , Node ---> repeatable

You do not have to create the XML stream in Code-pega-List as well. You can create in any class you like , as long as you can access it from you calling activity ( or use a step page on the calling step).

I cant stick the screenshots here.(confidentiality agreement n all).

 

Also , I feel you might have figured this out by now , but just in case some one else comes running to this post like I did , i put in the answers.