Hi,
How can I define a ModelResourceListener on a specific EnterpriseObject?
I have defined the customModelName - the same as the value coming in from front-end - but without any luck. The listener is always triggered for all enterprise objects.
I eventually as a work-around had to test for a specific action to get it to work on the required entity only.
This is what I've tried
@ModelResourceListener(modelLevelType = "EnterpriseObject", customModelName = "EPT.XXXX.YYYY")
@wynandf
In general, your statement above looks correct. One thing you could try, if you have the source attachment (I'm not sure what version you're on), you could try putting a breakpoint in com.transcendsys.platform.rest.ModelResource.populateModelInfo(JSONObject, Long). This is where the customModelName is determined and then propagated down for comparison purposes to decide whether to use the listener. Knowing what it is coming up with there may help us diagnose.
Thanks Greg. The problem was not the customModelName but rather the modelLevelType which came back from the front-end as null. Although it's calculated correctly inside ModelResource, it's not used for routing and therefore all our EnterpriseObjects were routed to the same listener.
Making the following change in the ModelFormContainer, fixed the problem
modelInfo: {
modelLevelType: 'EnterpriseObject',
customModelName: 'EPT.XXXX.YYYY'
},
Per @wynandf
The problem was not the customModelName but rather the modelLevelType which came back from the front-end as null.
Although it's calculated correctly inside ModelResource, it's not used for routing and therefore all our EnterpriseObjects were routed to the same listener.
Making the following change in the ModelFormContainer, fixed the problem
modelInfo: {
modelLevelType: 'EnterpriseObject',
customModelName: 'EPT.XXXX.YYYY'
}