Description
David Launen opened SPR-8036 and commented
Currently using BeanShell, however I would assume that this would be the same issue for other scripting languages as they all appear to use the same method of construction.
All examples I have found show scripted beans being defined as an identified bean, I have not found any examples that use a scripted bean as an inner bean. When attempting to define a scripted bean as an inner bean, a bean not found exception is thrown. Workaround of course is to define the scripted bean as a standalone identified bean, however this is not ideal.
The following XML definition example will result in a bean not found exception for the inner bean "lang:bsh XXXXX":
<beans>
<property name="transition" >
<bean class="com.test.workflow.transition.SimpleTransition">
<property name="strategy">
<lang:bsh script-interfaces="com.test.workflow.transition.election.ElectionStrategy">
<lang:inline-script>
<![CDATA[
public boolean evaluate(session, task, transitionEntry) {
return task.linked.claim.settlements.size < 1;
}
]]>
</lang:inline-script>
</lang:bsh>
</property>
</bean>
</property>
</beans>
Affects: 2.5.6
Issue Links:
- Add support for dynamic languages refreshable beans in @Configuration classes [SPR-12300] #16906 Add support for dynamic languages refreshable beans in
@Configuration
classes