Mementifier doesn't decorate the beans

Hi everyone,

During these holidays, I’m trying to figure out how to use the Mementifier module in my applications.

I’m having this problem.

In the canonical app, everything works perfectly: the bean is decorated by Coldbox.

I also have a folder where I developed additional services, and where I don’t use views or controllers.

Generally speaking, I shouldn’t have to extend Coldbox because I’m only using services in my second app, and I’m instantiating Wirebox on “server.”

In any case, I extend Coldbox like this:

component extends=".Application"{
    this.nullSupport = "true";
    this.cache.object = "DefaultCache";

  	public boolean function onRequestStart( targetPage ){
		super.onRequestStart( targetPage ) // Here, Coldbox is loaded
     	return true;
  	}
}

Then Wirebox.

Then I manually load Mementifier, like this (I haven’t been able to get it to do it automatically):

map("ResultsMapper@mementifier")
    .to( "modules.mementifier.models.ResultsMapper" )
    .asSingleton();

I load my beans, the ones that should be decorated like this, as transient:

mapDirectory(packagePath="core.model.bean");

I load all services as singletons:

mapDirectory(packagePath="core.model.service")
    .asSingleton();

Then, in the service, I instantiate a copy of my bean:

var bean = getIoc().getInstance("core.model.bean.Line");

getIoc() - is simply a reference to
server["wirebox"]
which is where the WireBox is registered. Could this be a problem?

Anyway here’s what I was telling you about. If I do it from the “main” app, the object is decorated correctly. If I do it from my extended app there are no decorations for the mementifier.

Main:

Second app

The two screenshots query the same service but from different URLs. In the first, the bean is decorated; in the second, it isn’t.

In both apps it appears that the module is loaded, this returns true in both:

getIoc().getBinder().mappingExists( "ResultsMapper@mementifier" )

Do you have any suggestions for me?

Thank you so much, sorry for the length.

Have a great summer! :tada: