Question
Accenture
IN
Last activity: 30 Sep 2022 6:09 EDT
pxForceCaseClose not working for embedded pages
Hi, I am using pxForceCaseclose to close all the cases in a class .
When In workobject Id I am hardcoding the value i.e. 'MyCase-145' , it is working , means 'MyCase-145' is closed . But when I am trying to loop over the Pagelist (i.e. WorkPage.pxResults) and then giving .pzInskey in workobject Id field in Call pxForceCaseclose method , then the following error is showing after looping through the 1st record :
Java Exception:java.lang.IndexOutOfBoundsException: Index: 1, Size: 0 .
Means the moment it is going to Workpage.pxResults(2) , it is showing the above error .
Is threre any issue with this OOTB activity working for embedded pages ?
Note: I m using pega 8.7
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Ordina
NL
@AnanyaA2 I see that another post already exists for this problem, https://support.pega.com/question/how-forcibly-close-all-open-cases-system. This should work in more recent versions, but you can always try out the java code that replaces the Property-Set in the activity. Also be sure to check if you pass the correct parameters (I believe there is a checkmark that explicitly tells the activity to clean up child cases?)
Kind regards, Bas
-
Ananya Anshudhar
Accenture
IN
Hi @BasRulesMatter! Thanks for your reply . The link that you shared is of few years ago . After that pega has already updated the property-set with java code . Still it is not working . And yes there is a checkmark that explicitly tells the activity to clean up child cases , that is called "CloseAllSubCases" . I have already checked it . Still there is some issue in looping .
Updated: 12 Sep 2022 1:15 EDT
Ordina
NL
@AnanyaA2 Okay, I will have a go myself aswell, I'll let you know! I tried the following:
- Close case A1 where A1 has pxCoveredInsKey A2 And A3.
- Pass case ID of A1, and A1, A2 and A3 are closed.
That did work as expected. But in the first question, you mentioned closing all cases for a specific class. That is something the pxForceCaseClose does not provide OOTB. You could wrap it into an activity that does an Obj-Browse of all objects in the class and then call pxForceCaseClose inside the loop
-
Ananya Anshudhar
Updated: 15 Sep 2022 14:23 EDT
Accenture
IN
@BasRulesMatter! Hi . Thank you for following up . As u mentioned above "Close case A1 where A1 has pxCoveredInsKey A2 And A3" . So here you are talking about closing one case having 2 child cases . That works fine with the activity . The problem comes when u have to loop through a pagelist and close all the open cases . For that I already tried the same approach that u are mentioning above .
1.Used obj-browse to fetch all the open cases and getting their pzInsKey .
2.Then putting the pzInsKey value in a parameter like Param.MyKey
3.Calling the OOTB activity under the loop of the pagelist and using the ParamMykey in the "WorkObjectID" .
Can u try that once if its working then there is something wrong with my application otherwise will raise a ticket .
Ordina
NL
@AnanyaA2 I would then, indeed, try out the solution enclosed by m.caldag and if that doesn´t work, raise a ticket. I would expect it to :)
-
Ananya Anshudhar
Bentego
TR
Hi @AnanyaA2
I could not reproduce the issue you described. Anyways, I generated a solution and attached on there. Kindly import jar file in attached zip archive in your personal Pega environment and associate the SolutionPxForceCaseCloseNotWorkingForEmbeddedPages:01-01 ruleset with your application, examine and understand the steps of TestForceCloseCases activity then compare it with your solution to be able to find what's wrong eventually fix it and resolve your issue permanently.
Let me know the result whether works or not.
Regards.
Mert.
Accenture
IN
@m.caldag Thanks for your reply caldag . I haven't got a chance to try what u suggested . I will try and let you know . Actually I guess pxforcecaseclose doesn't work in a loop where you have multiple parent cases to close . But I'll explore more on this .
-
Mert Çaldağ
Bentego
TR
"Actually I guess pxforcecaseclose doesn't work in a loop where you have multiple parent cases to close."
Solution has been tested with multiple cases. Let's discuss after you examine and try it.
-
Ananya Anshudhar