Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 2.0.0-M1
  • Fix Version/s: 2.0.0-M2
  • Component/s: Core: Configuration
  • Labels:
    None
  • User impact:
    Low
  • Similar Issues:
    None

Description

Unbounded "choice" model groups are used widely in mule.xsd

They have two disadvantages:

1) They allow elements that should only appear once to appear multiple times.
2) They allow elements to be defined in any order which means the "autocomplete experience" is not the same and means mule config files will not be consistant.

The "all" or "sequence" model groups should be used in lots of places that an unbounded "choice" is used now. Choice should primarily be used in the OR situations, or something more open/flexible than all/sequence is needed.

Example:

<xsd:complexType name="sedaModelType">
        <xsd:complexContent>
            <xsd:extension base="modelType">
                <xsd:choice minOccurs="1" maxOccurs="unbounded">
                    <xsd:element name="pooling-profile" type="poolingProfileType" minOccurs="0" maxOccurs="1"/>
                    <xsd:element name="queue-profile" type="queueProfileType" minOccurs="0" maxOccurs="1"/>
                    <xsd:element name="custom-entrypoint-resolver" type="customEntrypointResolverType" minOccurs="0"
                                 maxOccurs="1"/>
                    <xsd:element name="callable-entrypoint-resolver" type="entrypointResolverType" minOccurs="0"
                                 maxOccurs="1"/>
                    <xsd:element name="component-factory" type="componentFactoryType" minOccurs="0" maxOccurs="1"/>
                    <xsd:element name="component-lifecycle-adapter-factory" type="componentLifecycleAdapterFactoryType"
                                 minOccurs="0" maxOccurs="1"/>
                    <xsd:element name="component-pool-factory" type="componentPoolFactoryType" minOccurs="0"
                                 maxOccurs="1"/>
                    <xsd:element name="service" type="sedaServiceType" minOccurs="0" maxOccurs="unbounded"/>
                </xsd:choice>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>

Allows

<mule:service name="LoanBroker">
    <mule:outbound-router>
        <mule:pass-through-router>
            <mule:endpoint ref="CreditAgencyGateway" />
        </mule:pass-through-router>
    </mule:outbound-router>
    <mule:pooling-profile/>
    <mule:component class="org.mule.examples.loanbroker.AsynchronousLoanBroker" />
    <mule:response-router timeout="1000000">
        <mule:endpoint ref="LoanQuotes" />
        <mule:custom-router class="org.mule.examples.loanbroker.routers.BankQuotesResponseAggregator" />
    </mule:response-router>
    <mule:custom-exception-strategy class=""></mule:custom-exception-strategy>
    <mule:component class="org.mule.examples.loanbroker.AsynchronousLoanBroker"/>
    <mule:queue-profile/>
    <mule:component class="org.mule.components.simple.BridgeComponent"></mule:component>
    <mule:inbound-router>
        <mule:endpoint ref="CustomerRequestsREST" transformers="RestRequestToCustomerRequest" />
        <mule:endpoint ref="CustomerRequests" />
    </mule:inbound-router>
    <mule:inbound-router></mule:inbound-router>
    <mule:outbound-router>
        <mule:pass-through-router>
            <mule:endpoint ref="CreditAgencyGateway" />
        </mule:pass-through-router>
    </mule:outbound-router>
    <mule:response-router timeout="1000000">
        <mule:endpoint ref="LoanQuotes" />
        <mule:custom-router class="org.mule.examples.loanbroker.routers.BankQuotesResponseAggregator" />
    </mule:response-router>
    <mule:default-component-exception-strategy/>
</mule:service>

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: