Posted: 29 May 2018 2:22 EDT Last activity: 30 May 2018 5:26 EDT
Report Definition querying on FW class table instead of Impl Class table
Report definition rule which belongs to a framework class and the "Report on Descendant class instances" being checked with "Include Implementation Class Only" selected, runs report on the table associated with the framework class instead of the table associated with the implementation class.
This functionality only works if there is one impl class, If there are multiple implementations of the framework this functionality will bring the results from fw class as it is not sure which implementation to use.
Select this check box to include data from one or more descendant classes of the Report Definition's primary class. If descendant classes are mapped to multiple class tables, the generated query will use UNIONs to include this data.
You can select a specific subset of descendant classes to include or exclude by adding a filter condition on .pxObjClass.
When selected, the following options are displayed:
Include single implementation class - Uses implementation class mapping.
Include all descendant classes - Default for new reports. Includes all descendant classes except as constrained by a filter condition on .pxObjClass.
Note: Performance may be poor unless all relevant database columns are indexed in all included class tables.
Caution! If descendant classes are in multiple class tables, the query may fail if the referenced properties are not optimized.
To add up to the above post, the same set of code works perfectly fine in higher environments. It used to work fine until the past week. Although there was no major code change.
Also, the FW layer has only one implementation layer to it.
A-B-FW-Work -This is the class group
A-B-FW-Work-Req - This is the FW class on which the RD rule is written.
A-B-Work-Req - This is the Impl class which is also a class group and has dedicated work table.
I think this feature was introduced to avoid developers from writing more than one RD rule in all the implementation class. Which means creating RD rule copy in the implementation class is not the right fix.
I ran the java code in both Dev(This is where am facing the issue) and QA(This is where the code set up seems to work fine).
In dev, the java code resulted in null.
In QA, the java code was able to give me the implementation class name.
Also, i am noticing a similar behavior where none of the report definitions that are running on the FW-Work layer are querying the impl class relative table. This is happening only in the Dev environment and not in QA. Could this be a cache issue?
Thanks Ravi, the engine API you suggested led to finding the root cause.
The Impl Application rule was having a framework ruleset in the stack which was causing the issue. After removing the framework ruleset from the Impl Application rule form, the RD is behaving as expected.