Parsing JSON doesn't seem to work - tracing the same does! (why?)
I have an activity with a Java step to parse JSON:
try {
myStepPage.adoptJSONObject(myStepPage.getString(".property"));
} catch (InvalidStreamError ise) {
oLog.error("Invalid Stream Error parsing JSON: ", ise);
}
And it seems to work... somewhat, but doesn't always set the actual resulting properties on the page;
but if I trace the same activity, it always works and always fully populates the page -- what's the difference?
UPDATE: I found out it isn't the JSON parsing that is having trouble -- I was setting the property (the source string) from a utility function using "pg.putString(propName, sValue);" but it turns out that unless I called getXML on the page immediately thereafter, that property value wasn't actually set, and thus no JSON to parse...
Instead, if I specifically use "pg.getValue(propName).setValue(sValue);" then it works.