The snippet of your code you are showing looks good to me. In fact I am doing almost the same in the REST-Api's EventHandlerBean.addEventSource
The eventDefinitions are a 1:n relation on the ResourceType and are thus lazy loaded. In theory if no EntityManager is available you should get a lazy load exception.
In what context are you running that code?
Does the 'subject' have enough access rights?
As Heiko said, the Event definitions are lazy loaded, so for your code to work, you must not leave the transactional context of the EntityManager.
If for some reason you're not able to make that happen, you can try using the criteria queries:
ResourceTypeCriteria rtc = new ResourceTypeCriteria();
List<ResoureType> results = getResourceTypeManagerLocal().findResourceTypesByCriteria(<SUBJECT>, rtc);
Lukas and Heiko, thanks a lot for this usefull answer
seems that key things here is rtc.fetchEventDefinitions(true);
because I tried this method early but without setting fetchEventDefinitions to true
Now it works - thank you !!!!!!