I’ve found a crazy behavior when using the method “getModel()”.
There are three arguments (name, dsl, initArguments).
When i’m using the name-argument and also set some initArguments, this initArguments will be passed to the init-function of the target component.
But when I’m using the dsl-argument with the pattern I’ve added in the wirebox before, the initArguments will be lost.
initArgs is only used with a mapping ID. If you look at the code in the injector.getInstance() method you’ll see that if a DSL is passed in, the call is diverted to buildSimpleDSL() and the initArgs aren’t passed along. As to why it works this way, I’m not sure-- most DSL namespaces return singletons that are already created or bits of the framework that already have set initialization parameters.
Can you elaborate on your scenario-- what DSL are you using?
it’s a custom model I want to load.
The custom model is bind to thw wirebox. I also can use the name argument instead of the dsl argument, that works very well.