Why doesn't FlushDeclarativePage OOTB function clear data pages?

I am debugging an activity made about a year ago and there is a line inside of a loop that calls “FlushDeclarativePage”. As parameter, it expects the page’s name. So the current parameter is “D_MyFiles”.

My objective is to flush D_MyFiles[ Filename: “MyFileName”]

problem is that on the second iteration of the loop, the instance of D_MyFiles is loaded from cache. Which is not what I want.

It began to work when I used ‘Page-Remove: D_MyFiles’.

Although, I am confused as to why FlushDeclarativePage did not work. My understanding is that all data pages are also declarative pages.

Anybody know why this is the case?

Extra information:

The D_MyFiles data page is set on Thread level and “Reload once per interaction” (in case this matters).

@SergioR17001004

Please use this function: @(Pega-RULES:DeclarePages).pzDeleteAllInstancesOfDeclarativePage(tools,“”)

use this please @SergioR17001004

In Dt step, use java method as below to remove all instances of Data page,

@java(“pega.getDeclarativePageUtils().deleteAllInstancesOfDeclarativePage("yourdatapagename")”)

set this to a dummy parameter like param.TempFlush to allow the DT to save.