Access DAO object in Constraint script

Hello All,

It seems it's not possible to access DAO objects in a Constraint validation script. For instance, when I try to validate using objectDAO.findByCode(input.myCode, 0, 1), I get the following error:

objectDAO is neither defined in the script nor in dependencies.

Is it so or am I doing something wrong? And if so, what alternative is feasible to validate input data against BDM (database) values?

Thank you in advance.

My actor filter need access to the BDM


I am writing an actor filter that needs access to the BDM.
I am struggling with the BusinessObjectDAOFactory as createDAO method need an APISession parameter. My problem is that the APISession seems not to be accessible from the filter method.

Here is my code:

Error trying to access the BDM

I'm trying to access the BDM from a script in Groovy. After several attempts and tests can not I find what is wrong. Attached diagram and log.