How to evaluate cms from project without dependency
hi ivyteam
I have a project with structure like this:
![alt text][1]
There is three projects:
- Project B is core project, it provide IService interface which is implemented by other sub Project, It also content a Map to store/cache instance of real service
- Project B': Implement interface from B with real implementation (Class MyService), it use ivy cms to look up some cms which are only available on project B'.
- Project A depend on Project B and consume interface IService (execute real implementation from B'). In order to register real implementation for that interface, in Project B' we have the EventStartBean will be run once when engine started, it will create instance of MyService and put to ServiceHolders map (a kind of service locator).
With this structure, we can abstract the implementation of project A and B, it don't care what is real implementation, just work with interface and can be reusable for many customer (each customer will have something similar with B' )
But one of the problem here is we execute the service from context of project A, it lead to issue that the api Ivy.cms().co(< uri of B' >) will return empty value. Go deeper into that api i see it will lookup cms from project where request has been started (project A)A),
Another way that is triggering callable sub process from B' but i don't like that much.
My question is: Can we evaluate cms from project B' when A can't see B' ? If not, is there any suggestions?
[1]: http://answers.axonivy.com/upfiles/Untitled_v709RtK.png