Dear Community,
I am struggling to understand way of working with containers using PConnect and PCore.
All starts with:
saveAssignment(containerItemID) (pega.com)
In order to execute this method i do need containerItemID (i would like to save whole form - workarea). I can only see methods to get Current container name or get child containers, but it does not help.
In redux i do see that workarea ID is app/primary_1/workarea_VARIABLE.
Could you please advise how do you refer to the workarea containerItemID? How to refresh the form after save if i am not leaving the page?
PS. Documentation “Saves the opened assignment” is not descriptive enough. What does it save?
Best Regards,
Pawel
@Pawel Sobolewski Another query related to this one. After invoking save, i am unable to refresh eTag, thus processing case is not possible. Is there any solution for it? From what i see etag (pxUpdateDateTime) is updated only in container app/primary_NUMBER, all other containers are not aware of the save (even if save was triggered from different container)
@Pawel Sobolewski, Assuming your component also exists within the workarea container (and same context and container item) you can use the following code to save the assignment. This API should submit and commit the form fields in the case instance.
getPConnect().getActionsApi().saveAssignment(getPConnect().getContextName());
If you use Actions API, you shouldn’t worry about updating ETag, the API should take care of updating the ETag in the Redux store and consume it for further actions. Please raise an INC in case if you see any issue with it.
Thanks for the feedback on the API documentation, we will consider and improve the documentation to provide better clarity.
@PradeepBoorla Sadly this solution does not work, ETag is not updated and case is broken.
I am also bit confused due to consumed parameters of
saveAssignment(containerItemID) (pega.com)
Documentation states it consumes containerItemID not containerName.
@Update now i see that method getContextName() returns something different. I must admit i would never figure it out that it returns containerID.
I have created INC-B37456
@Pawel Sobolewski
Is the component from which you are invoking this JS API present within the assignment view, or is it outside the assignment view? If it is inside the assignment view, it appears to be a bug, and we can investigate it as part of the INC you raised.
Since containerItemID and contextName carry the same name for all case specific use cases, I suggested using getContextName() as we currently don’t have a direct PConnect API to retrieve the containerItemID. We are planning to introduce this in a future release.
@PradeepBoorlaYes, it is present in assignment view.