If by query logic you mean the number of filter conditions that need to be applied, then this can be achieved in report definition by ensuring some of the filter conditions' value part is empty (or null) so that that condition is ignored. Since one (or many) conditions are ignored as their resulting "value" part (RHS) results in empty, the filter logic is rewritten to accomodate it.
You can use a data page and use your Report definition as source with mandatory filter like pyID Is Not Null in the report filter. Once you have the results with pyID you can conditionally check based on the property value in the response data transform.
Alternatively you can call the pxRetreiveReportData (as dames mentioned) from activity and conditionally filter the results. Let me know your thoughts.
The requirement can be met with report definition in this manner
ApyID Starts With Param.id
DpyID Is Not Null
The filter logic will be (A AND D). The value of id parameter can be set to C- or D- or E- depending on the condition which determines it. If id parameter is not present, then that filter condition is ignored and filter logic will automatically become (D).
In your example above, the A, B and C filter conditions were on the same property with the same operation. To complicate it further, let's now assume A, B and C filters are on different properties.
ApyID Starts With Param.id
BpyStatusWork Starts With Param.statuswork
CpyCreateOperator Equals Param.operator
D myProperty Is Not Null
Notice that each of A, B and C filter conditions now has different parameters and depending whether the parameter is set on the parameter page when executing the report or not will determine if that filter is applied in the query or not. If it is no applied, the filter logic is auto rewritten to remove that condition.
Not sure of the requirement at your end but I suspect you are looking for pxRetrieveReportData activity
Use the Rule-Obj-Report-Definition.pxRetrieveReportData activity to execute the retrieval and sorting operations, but not the formatting and display processing, of a report definition.
Specify both key parts of a report definition.
Select the Applies To key part of a report definition. This may identify an internal class or class group, or an external class.
Select the Purpose key part of a report definition.
Optional. Enter the name of the clipboard page that will hold the report results. If you do not add a value, the results are shown in the default Code-Pega-List page called pyReportContentPage.
Optional. Use this parameter to override the columns returned by the report. This parameter enables you to add or remove the columns that the report returns. You can also change the sorting order of these columns.
This parameter is page name of class Embed-QueryInputs. The page structure is shown below.