views:

255

answers:

3

In a flow definition, I am trying to access a bean that has a dot in its ID

(example: <evaluate expression="bus.MyServiceFacade.someAction()" />

However, it does not work. SWF tries to find a bean "bus" instead.

Initially, I got over it by using a helper bean to load the required bean, but the solution is inelegant and uncomfortable. The use of alias'es is also out of the question since the beans are part of a large system and I cannot tamper with them.

In a nutshell, none of the solution allowed me to refernce the bean directly by using its original name. Is that even possible in the current SWF release?

+1  A: 

This is a restriction of the EL parser (generally either OGNL or jboss-el for Spring Web Flow). EL uses dot notation for parsing the navigation chain,causing the initial behavior you describe (attempting to find the "bus" bean).

Stevi Deter
A: 

In my experience, anything with a getter method can be accessed via dot notation. In your example, whatever object is being represented by the bus bean needs to have a getServiceFacade method and that the object returned by getServiceFacade would need to have a getSomeAction method.

Owen
A: 

Try:

['bus.MyServiceFacade'].someAction()

or

'bus.MyServiceFacade'.someAction()

This may work, or it may not...but similar things are used in the Expression Language for JSPs.

MetroidFan2002
I tried both of the suggestions, but to no avail
Arnelism