Support Article
Pega Rest API for cases not working as expected
SA-21543
Summary
Pega Rest API for Creating Case POST request throws exceptions when Page Group property is passed in cases' content of POST API.
Error Messages
Error on tracer:
.PageGroupPropXX(pxObjClass): The property WorkPage.PageGroupPropXX(pxObjClass) was of mode String while adoptDictionaryDefinition(ImmutablePropertyInfo, boolean, boolean) was expecting Page mode. Details: the mode has been reset to match the property's definition.
Steps to Reproduce
1. Click Resources.
2. Click Pega API.
3. Click Create Case.
4. Send a request to create a case using out-of-the-box Pega Rest API with a Page group property in content.
Root Cause
Incorrect formation of the request.
Resolution
Perform the following local-change:
Correct the request like given in the example.
A sample request format for a Page Group present in Jxx-Location-Work-Exxxxxe and the page definition for this Page Group, JXX-Location-Work, will be as follows:
{
"caseTypeID": "Jxx-Location-Work-Example",
"processID": "pyStartCase",
"parentCaseID": "",
"content": {"pxObjClass":"Jxx-Location-Work-Exxxxxe" ,"SamplePageGrp":{"firstvalue":{"CaseID":"E-21X","pxObjClass":"Jxx-Location-Work"}}}
}
Published March 31, 2016 - Updated October 8, 2020
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.