Skip to main content

new-instance-bean handler

This handler allows the craetion of a new business object and assign default attribute values. The value of the bean attributes is specified using multiple instances of the bean-attribute tag

Attribute
Usage

className

Name of the business object class

if

EL expression that must be evaluated to true prior to handler action

unless

EL expression that must be evaluated to false prior to handler action
bean-attribute/nameName of the attribute
bean-attribute/valueEL expression with the value to assign

With the following example would create a new city within a country:

<datanode name="country">
    ...
    <finder name="cities" type="city" >
        <collection-finder collection="${instance.cities}">
        <new-instance-bean  className="City">
            <bean-attribute name="countryAbbreviation" value="${instance.abbreviation}"/>
        </new-instance-bean>
    </finder>
    ...
</datanode>