How does work object get records from Declare Index table?
We have WorkObject with the page list, that is exposed via Declare Index. At some strange point records inside index table in DB do not load, when we open a case. There is no page list on the clipboard.
Per my understanding, as long as index table has records with corresponding keys (pxinsindexedkey, pxindexcount and pxindexpurpose), they should be fetched on the case opening.
So how does Pega know, when to fetch data from index table and when does this event occure?
***Edited by Moderator Marissa to update platform capability tags****
When you create Declare index for an embedded page, you are exposing the properties of this embedded page in some other table(Declare index table).
You are mapping each column of the table with a property. Now whenever you add some value for this embedded page these corresponding declare index table will also get populated.
Now generally we use this declare index for reporting purpose, and here you will create a class join with the declare index table and then use the properties of this table.
For your case you have mentioned for some scenario the pages are not created in the clipboard. Could you please mention the exact scenario when the pages are not created and add the screen-shots of the clipboard page and the declare index that you have created and also where exactly you are using this page.
If this scenario is random then may be you want to check the your declare index, you have an option to create index even if source class property is blank(checkbox). If this checkbox is not checked it will not create a row in the index table for blank values.
Yes, I know how Declare Index rules supposed to be used.
We have a case type which has property say it's called .Documents for example. It is a Page List with page definition of Data-Document. We have an Index- child class called Index-Documents. Inside our case type class we have Declare Index rule setted up to map Data-Document records to Index-Document.
Like this for example:
At runtime during case creation and initial processing, user adds some documents to .Documents() Page List. After assignment completion records are persisted into Index-Documents database table as expected. Few assignments later we have a point, where after form submit utility shape is fired. Inside its activity we loop through .Documents() for read only purposes.
When automatic processing is done, case is routed to the next assignment. At this time, when user opens the case, there is no items inside .Documents() Page List. By the way, I did not mention that we have information tab under case lifecycle diagram on user interface where we can see table with those documents. Clipboard is also empty, but we have records inside pr_index_documents data table.
I want to explicitly point out that problem is not in saving records to DB, problem is in retrieving.
I need to understand how records from db are fetched to the Work object of our case, when it is opened? And why such unlinking is happening?
As you have mentioned the issue is while retrieving the data from the index table even though the values are populated in the table, there might be something wrong while fetching the values.
If the issue that you are facing is intermittent then it would be better if you raise a Support Request for this with all the details added in the SR as it might need more detailed investigation to know the reason for not populating the data on the clipboard page.
Do mention in the SR that the index table is populated properly but there is some issue while retrieving the data. Also attach the screen-shot of the clipboard page where you see empty page list.