Question
Saltech Consulting
GB
Last activity: 17 Feb 2021 10:12 EST
Pega API "POST /assignments/{ID}" submitting data to an assignment
Context:
I am trying to understand the capabilities of the Pega API with regards to evaluating if it can be used by a 3rd party website to progress a case through its lifecycle rather than meeting this via a mashup.
The current version of Pega is 8.1.2.
Its a similar question to that which is raised here: https://collaborate.pega.com/question/pega-api-calling-assignments-api-performing-assignment
Example problem:
As this will be needed for the customer service application then I selected what I thought would be a reasonably simple use case of updating an address.
To set up the data I have created a case using the user portals in Pega and now have a case with an assignment at the address change step.
As a test I would like to change the phone number in this and submit the assignment.
As we can see the data is stored in the TempAddressChange page. So I need to somehow update the data here and then submit the assignment.
Context:
I am trying to understand the capabilities of the Pega API with regards to evaluating if it can be used by a 3rd party website to progress a case through its lifecycle rather than meeting this via a mashup.
The current version of Pega is 8.1.2.
Its a similar question to that which is raised here: https://collaborate.pega.com/question/pega-api-calling-assignments-api-performing-assignment
Example problem:
As this will be needed for the customer service application then I selected what I thought would be a reasonably simple use case of updating an address.
To set up the data I have created a case using the user portals in Pega and now have a case with an assignment at the address change step.
As a test I would like to change the phone number in this and submit the assignment.
As we can see the data is stored in the TempAddressChange page. So I need to somehow update the data here and then submit the assignment.
If I check the state of the clipboard when the assignment is open in pega it looks like the following:
Using other Pega API calls I can get the assignment ID that is the relevant and also the action ID. These are 2 of the 3 parameters that are available for the "POST /assignments/{ID} as shown in the API here:
Now my assumption is that the data that I need to update should be submitted in the request body.
When looking into the service I can see the request is mapped here on step 4. The context is the .performAssignmentRequest property which is of class "Pega-API-CaseManagement-Assignment".
So now I am a bit confused as I am unsure what data structure is needed or expected here. It appears to be mapping the JSON in the request to the step page but then if thats the case how do we support data submission without creating properties in the PegaAPI classes to support this? There is no "action" property. I can see a "content" property.
I have tried a few different combinations of entering data in the requestbody for example: something like
{
“action”:{
“TempAddressPage” {
“ADDRESS_1”:”43 Hawkins Street”,
“ADDRESS_TYPE”:”Billing”,
“CITY”:”Boston”,
“COUNTRY”:”USA”,
“CUSTOMER_ID”:”C1000003”,
“EMAILADDRESS”:” Proprietary information hidden”,
“ISACTIVE”:”Y”,
“LOCATIONID”:” LOC00003”,
“PHONENUMEBR”:” 7894545000”,
“PHONENUMBERTYPE”:”Billing”,
“pxObjClass”:”PegaComm-Int-COMMS_CUSTOMER_ADDRESSES”,
“STATE”:”MA”,
“STREET”:”Lyon Street”,
“ZIPCODE”:”01752”}
}
however the service is always returning a Pega 001 API error which suggests the JSON mapping is failing.
Questions:
- How is this service intended to work?
- What is the expected state of the system at the point the POST should be submitted. For example does the service take care of opening the assignment, locking, populating the clipboard (i.e. running the pre actions on a flow action) etc....
- What is the capability of this service:
- can we submit data on named pages?
- can we submit data on multiple pages?
- How does the data in the request body get mapped?
- What is the intended syntax of the "requestbody" is there any examples available with a clipboard structure and the JSON syntax?
- In the model schema I can see it has an 'action' object, however if I see https://collaborate.pega.com/question/pega-api-calling-assignments-api-performing-assignment then the object is 'content'. Which is correct? I can also see there is an "actions" property but no action property in the PegaAPI classes.
- What is the behaviour in terms of merging data on Pages. For example if I need to pass in a named page but only want to update 2 properties, does Pega load that named page in line with how the assignment would work using the "user portal" and then merge the data using the data I pass in where there is a conflict, or do I need to pass the entire contents of the Page and its just replaced?
- Similar to 5, If I need to refer to an editable datapage, and update a property (e.g. pySelected in a list) what is the expected behaviour in terms of the load sequence? If we have Parameters needed for the datapage the syntax is a bit tricky as we have [ and " in the page name reference. If this supported? I tried escaping the characters but not much luck so far.
Thanks for any help in advance.
***Edited by Moderator: Pallavi to update platform capability tags***