I need to use a spring bean in 2 places in my mule flow. Bean takes 3 properties of which 1 of them is another bean. Is it possible to define main bean in single place and overwrite only the changed properties. Say this is my bean declaration:
<custom-transformer name="soapFaultTransformer" class="com.xxx.xx.transformer.VelocityMessageTransformer">
<spring:property name="velocityEngine" ref="velocityEngine" />
<spring:property name="templateName" value="soapFault.vm" />
<spring:property name="beanClass">
<spring:bean class="com.xxx.services.xx.Soap11Fault">
<spring:property name="faultCode" value="Client" />
<spring:property name="faultString" value="Invalid Request" />
<spring:property name="detail" value="This request is not valid" />
</spring:bean>
</spring:property>
I just want to change below 2 properties:
<spring:property name="faultString" value="Invalid Request" />
<spring:property name="detail" value="This request is not valid" />
Is it possible?
Thank you
The best approach for this is to declare a global abstract parent bean, configured with the common properties, then refer to it where you need it, setting the specific properties to the desired values.
Here is the declaration of the abstract bean for the SOAP fault:
When we use this as a parent bean, we specify the additional properties with their specific values: