adoptJSONObject (strJSON) not parsing Heterogeneous JSON Array
I'm trying to parse a JSON strcuture that includes a Heterogeneous JSON Array using the ClipboardPage.adoptJSONObject(strJSON). But it's not parsing the Heterogeneous Array. Following is my sample JSON (strJSON) is
I could try, may be it will work. But the point is that this is just a small snippet of the entire JSON Structure. So I have to use the adoptJSONObject on the entire JSON Structure. I think the adoptJSONObject must have the ability to determine that this is a Array and parse it accordingly.
I have been trying to build a representative test case here for testing with ; but I got stuck.
I have two ideas (not solutions - more diagnostics I'm afraid):
1. Can you provide more screenshots showing your data model setup in more detail please; it might just be me, but I can't work out whether you have used 'Page Lists' or 'Page Groups' here....
2. Can you make the data 'fit' your Pega Data Model in another way (again, not a solution - a diagnostic) - can you build a Data Transform which fills your model with your example data; and show the XML of the result.
Then we'll have your input (the JSON) and the expected output (the filled-in data model).
So I'm struggling to get my head around how to represent this data ; but I'll post what I have been trying in case it helps shed some light (mainly on what I'm doing wrong here I think... :-\ )
Just to show I have thought (badly, but I did try :-) ) about this:
So I have built a PRPC Activity - that loads some JSON (from a Rule-File-Text for convenience)
And created a data model (which is almost certaintly wrongly thought-out on my part) like this:
Where I have 'Tuple' that contains a single property 'Values' - which itself a Page-List of type Values...
(again, I think this is probably all wrongly thought-out).
Caused by: com.pega.pegarules.pub.clipboard.InvalidParameterException: ClipboardProperty value must have mode of String, Page, or Java Object. Details: Invalid value for aValue passed to com.pega.pegarules.data.internal.clipboard.ClipboardPropertyImpl.addToList(boolean, int, Object, boolean)