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?
You are not required to supply a name or id for a bean. If no name or id is supplied explicitly, the container generates a unique name for that bean. However, if you want to refer to that bean by name, through the use of the ref element or Service Locator style lookup, you must provide a name.
Every bean has one or more ids (also called identifiers, or names; these terms refer to the same thing). These ids must be unique within the container the bean is hosted in. A bean will almost always have only one id, but if a bean has more than one id, the extra ones can essentially be considered aliases.
When Spring creates a Bean Definition from a @Service or @Component annotation, it will by default create an id for the bean by lowercasing the first letter of the Class Name. If you want to override that the behavior, you can provide an alternative id in the annotation, eg. @Service("profileService").
Sr.No. This attribute is mandatory and specifies the bean class to be used to create the bean. This attribute specifies the bean identifier uniquely. In XMLbased configuration metadata, you use the id and/or name attributes to specify the bean identifier(s).
I was able to do this by using both the bean accessor (@
) symbol and single-quotes around the name of the bean.
Using your example: #{@'bus.MyServiceFacade'.someAction()}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With