substitution group parsing is broken #119

Closed
bmjsmith opened this Issue Nov 15, 2011 · 6 comments

Comments

Projects
None yet
3 participants
@bmjsmith

Code generated from BPMN 2.0 xsds does not compile

Using scalaxb via the maven plugin version 0.6.6 and scala 2.9.1 against the BPMN 2.0 xsds (the five listed under normative which I'll attach after this is raised if I can) generates code which does not compile.

The compile errors are here.

A copy of the maven pom used is here - it's structured to generate scala code back into the source tree every time eclipse triggers a build.

@martiell

This comment has been minimized.

Show comment
Hide comment
@martiell

martiell Nov 15, 2011

Collaborator

On 15 November 2011 12:27, Brian Smith
reply@reply.github.com
wrote:

A copy of the maven pom used is here - it's structured to generate scala code back into the source tree every time eclipse triggers a build.

Not that it solves your problem, but you might be interested in the
m2e connector for scalaxb:
https://github.com/martiell/m2e-scalaxb

Update site: http://martiell.github.com/m2e-scalaxb/update

This means you can leave the outputDirectory set to
target/generated-sources/scalaxb, and m2e-scalaxb will configure this
as a source directory. This makes version control excludes a bit
simpler. It also means you don't need the pluginExecutionFilter in
your pom.

Martin

Collaborator

martiell commented Nov 15, 2011

On 15 November 2011 12:27, Brian Smith
reply@reply.github.com
wrote:

A copy of the maven pom used is here - it's structured to generate scala code back into the source tree every time eclipse triggers a build.

Not that it solves your problem, but you might be interested in the
m2e connector for scalaxb:
https://github.com/martiell/m2e-scalaxb

Update site: http://martiell.github.com/m2e-scalaxb/update

This means you can leave the outputDirectory set to
target/generated-sources/scalaxb, and m2e-scalaxb will configure this
as a source directory. This makes version control excludes a bit
simpler. It also means you don't need the pluginExecutionFilter in
your pom.

Martin

@eed3si9n

This comment has been minimized.

Show comment
Hide comment
@eed3si9n

eed3si9n Nov 15, 2011

Owner

This is likely scalaxb issue. I'll look at it later.

Owner

eed3si9n commented Nov 15, 2011

This is likely scalaxb issue. I'll look at it later.

@eed3si9n

This comment has been minimized.

Show comment
Hide comment
@eed3si9n

eed3si9n Nov 16, 2011

Owner

I created the reproduction sample is here: https://github.com/eed3si9n/scalaxb-sample/tree/bpmn/bpmn

The error seems to be coming from handling of substitution group:

    <xsd:complexType name="tActivity" abstract="true">
        <xsd:complexContent>
            <xsd:extension base="tFlowNode">
                <xsd:sequence>
                    <xsd:element ref="ioSpecification" minOccurs="0" maxOccurs="1"/>
                    <xsd:element ref="property" minOccurs="0" maxOccurs="unbounded"/>
                    <xsd:element ref="dataInputAssociation" minOccurs="0" maxOccurs="unbounded"/>
                    <xsd:element ref="dataOutputAssociation" minOccurs="0" maxOccurs="unbounded"/>
                    <xsd:element ref="resourceRole" minOccurs="0" maxOccurs="unbounded"/>
                    <xsd:element ref="loopCharacteristics" minOccurs="0"/>
                </xsd:sequence>
                                ...
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>

In the above resourceRole is the head element of a substitution group consisting of the following:

  • <xsd:element name="resourceRole" type="tResourceRole"/>
  • <xsd:element name="performer" type="tPerformer" substitutionGroup="resourceRole"/>

There's something buggy about the handling of substitution group.

Owner

eed3si9n commented Nov 16, 2011

I created the reproduction sample is here: https://github.com/eed3si9n/scalaxb-sample/tree/bpmn/bpmn

The error seems to be coming from handling of substitution group:

    <xsd:complexType name="tActivity" abstract="true">
        <xsd:complexContent>
            <xsd:extension base="tFlowNode">
                <xsd:sequence>
                    <xsd:element ref="ioSpecification" minOccurs="0" maxOccurs="1"/>
                    <xsd:element ref="property" minOccurs="0" maxOccurs="unbounded"/>
                    <xsd:element ref="dataInputAssociation" minOccurs="0" maxOccurs="unbounded"/>
                    <xsd:element ref="dataOutputAssociation" minOccurs="0" maxOccurs="unbounded"/>
                    <xsd:element ref="resourceRole" minOccurs="0" maxOccurs="unbounded"/>
                    <xsd:element ref="loopCharacteristics" minOccurs="0"/>
                </xsd:sequence>
                                ...
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>

In the above resourceRole is the head element of a substitution group consisting of the following:

  • <xsd:element name="resourceRole" type="tResourceRole"/>
  • <xsd:element name="performer" type="tPerformer" substitutionGroup="resourceRole"/>

There's something buggy about the handling of substitution group.

@eed3si9n eed3si9n closed this in a3789e7 Nov 16, 2011

@eed3si9n

This comment has been minimized.

Show comment
Hide comment
@eed3si9n

eed3si9n Nov 16, 2011

Owner

0.6.7-SNAPSHOT is out with the fix.

The sample I created uses sbt-scalaxb: https://github.com/eed3si9n/scalaxb-sample/tree/bpmn/bpmn

Owner

eed3si9n commented Nov 16, 2011

0.6.7-SNAPSHOT is out with the fix.

The sample I created uses sbt-scalaxb: https://github.com/eed3si9n/scalaxb-sample/tree/bpmn/bpmn

@bmjsmith

This comment has been minimized.

Show comment
Hide comment
@bmjsmith

bmjsmith Nov 22, 2011

Thanks Martin for the pointer to the plugin and Eugene for the fix, I'll try both out. Much appreciated.

Thanks Martin for the pointer to the plugin and Eugene for the fix, I'll try both out. Much appreciated.

@bmjsmith

This comment has been minimized.

Show comment
Hide comment
@bmjsmith

bmjsmith Dec 7, 2011

Just to confirm, I've tried 0.6.7-SNAPSHOT now by building myself and it's working fine for me. Thanks again for the fix. Oh and Martin the eclipse plugin works like a charm.

bmjsmith commented Dec 7, 2011

Just to confirm, I've tried 0.6.7-SNAPSHOT now by building myself and it's working fine for me. Thanks again for the fix. Oh and Martin the eclipse plugin works like a charm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment