-
1. Re: Calling a Spring bean inside the JPDL
walterjs Jul 5, 2010 11:22 AM (in response to soheildowlatshahi)This is straighforward to do. Just use an expression like this:
#{myService.callOperation('key')}
As long as there is a bean in the spring context called "myService", this should work. If you want the 'key' to be a bean value as well, just drop the quotes.
Cheers
Walter
-
2. Re: Calling a Spring bean inside the JPDL
soheildowlatshahi Jul 6, 2010 1:23 AM (in response to walterjs)Please give me an example
where can I use these term #{myService.callOperation('key')}, in java tag? in custom tag?
-
3. Re: Calling a Spring bean inside the JPDL
swiderski.maciej Jul 6, 2010 2:26 AM (in response to soheildowlatshahi)You have two options if it comes to java activity:
1. provide on runtime an instance which shall be used to invoke defined method
<java name="shake hand" expr="#{hand}" method="shake" var="hand"> <transition to="wait" /> </java>
this will result in following code being executed: #{hand.shake()}
2. provide a class and method to be invoked that accepts argument given on runtime
<java name="shake \class="my.class.name" hand" method="shake" var="hand"> <arg><object expr="#{hand}"/></arg> <transition to="wait" /> </java>
this will result in execution of my.class.name.shake(MyObject hand).
For more details about java activity plase take a look at user guide.
HTH