pxRetrieveSearchData force pxObjClass to use filter operation =

Hi All,

I need to get pxRetrieveSearchData to use filter operation = against pxObjClass regardless whether its a group class or not.

Activity pzSearchWorkIndex is appending “AND AutoAddedObjClass” to the filter logic but setting “pyFilterOperation” as “startswith” which is no good as we have higher classes that are also group classes. This is resulting in duplicate returned results for each class.

How can we achieve this?

Thanks
Craig

Hi, @CraigA52

Not sure if I understood your scenario correctly, but I am getting expected results when I tried a similar use case.

I defined my report in the class group layer and pass different child class names as parameters(pyReportClassName) when calling pxRetrieveSearchData. Using this approach, I was able to see the expected results come up on the pySearchResultsWork page.
In my scenario, I have a class group MyBank-Ins-Work and a few child classes(MyBank-Ins-Work-A, MyBank-Ins-Work-B, MyBank-Ins-Work-C).
Report is defined in my parent class, MyBank-Ins-Work.
When calling pxRetrieveSearchData, I pass the report name which is defined in MyBank-Ins-Work and pass different parameters for pyReportClassName.
When I pass pyReportClassName = MyBank-Ins-Work-B, I only got instances of the child class, MyBank-Ins-Work-B.
However, when I pass the class group class name, MyBank-Ins-Work, I got matching results across all my child classes including the parent class.

Hi, @gudip

Thanks for looking in my scenario I have MyBank-Ins-Work, MyBank-Ins-Work-A, MyBank-Ins-Work-B, MyBank-Ins-Work-C, MyBank-Ins-Work-C-A, MyBank-Ins-Work-C-B.

They are all class groups. The problem we are having is that when we are using pyReportClassName=MyBank-Ins-Work-C pzSearchWorkIndex checks to see if the passed in className is a class group and if it is adds “pyFilterOperation = startswith” instead of equals.

Step 2 (Java) in this activity is where this is happening.

Therefore we end up with records coming from MyBank-Ins-Work-C, MyBank-Ins-Work-C-A and MyBank-Ins-Work-C-B instead of just the one we are after MyBank-Ins-Work-C.

Hope that makes sense.

Thanks
Craig

@CraigA52 Instead of modifying the internal activity, consider creating a wrapper activity that calls pzSearchWorkIndex and applies additional filtering logic after the initial search results are returned.
Using a Data Transform or Post-Processing Logic If modifying the search logic directly is not feasible, consider using a data transform or a post-processing activity to filter out unwanted results after the search is performed. This can be a practical workaround to ensure only the desired class instances are processed further.

@CraigA52

Understood, for your scenario, can you try adding the below filter in the report definition ?
pxObjClass = Param.pyReportClassName
This can help to run the query only on the specific class name that you are passing through pxRetrieveSearchData activity

image

Hi @gudip

I tried that but it doesn’t help because you end up with a double pxObjClass filter. One with the actual class and another with the startswith condition.

pxObjClass:MyBank-Ins-Work-C ) AND pxObjClass:MyBank-Ins-Work-C*

So you still end up showing all cases.

Hi @CraigA52

Not sure if there is any difference in pega versions here, I tried a few times in a pega infinity 24.2 environment and it is giving me only the results from MyBank-Ins-Work-C.
Through the report , I am explicitly passing a pyReportClassName parameter with an equals condition which is essentially adding the condition, pxObjClass = ‘MyBank-Ins-Work-C’
Since the class is a class group, I do see that the system is also adding the 2nd condition, pxObjClass starts with ‘MyBank-Ins-Work-C’. But it is an AND condition, the overall result is not giving me the items from child classes as it doesn’t match the first condition.