A work object is opened. A couple of button actions calls a script which in turn calls pega.d.showharness with replaceCurrent as Yes which replaces the work object thread. On click of a particular button in the newly displayed harness, OpenWorkByHandle is called to open the work object. At this time, a new thread is being opened for work object leaving the thread opened previously by pega.d.showharness in background (We are not displaying tabs in work area). Since the maximum document count in the Dynamic container is 16, after a few work objects being processed no more work objects will be allowed to open.
What I'm not getting is, why do you have to do all that manually where it seems to be all automatic when using pyCaseManager7 portal.
I believe if you open up this Out-Of-The-Box portal, you will not see any tabs handling WorkObjects. When you open a WorkObject it will appear on the main window above the previous one remaining open behind.
And as you said if you reach the limitation by opening more than 17 cases the system will automatically close the first one open on the list. So again all automatic and Out-Of-The-Box. Nothing to customize here.
Yes. There will be no tabs. Other than the work object threads, we have few threads which are being left open due to pega.d.showharness call. And after the limit of 16 is reached, system is not closing the oldest thread. Instead it is giving a popup alert which says max limit of open documents is reached and to close the previous ones.
Pega is only closing the work object threads after the Max Document count is reached by calling the pzDocumentCleanup. Since in our custom implementation it is the normal harness being left open, those are not taken care by Pega OOTB activity. We suggested to business for re-design. As a work around, we are looping through the Declare_pyDisplay page to identify the Thread name and closing the unwanted thread.