Notifications
Clear all

[Solved] ModelResourceListener on EnterpriseObject

3 Posts
2 Users
2 Likes
1,217 Views
1
Topic starter

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")

Greg Merrill 2020-11-06 22:49:16

@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.

wynandf Topic starter 2020-11-09 12:03:30
This post was modified 3 years ago by wynandf

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'
},

1 Answer
1

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'
}