Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

the attr of minOccurs became "realOccurs" in the EDI mapping #255

Closed
nonicknamelala opened this issue Feb 17, 2020 · 2 comments
Closed

the attr of minOccurs became "realOccurs" in the EDI mapping #255

nonicknamelala opened this issue Feb 17, 2020 · 2 comments
Assignees
Milestone

Comments

@nonicknamelala
Copy link

	<medi:segmentGroup minOccurs="1" maxOccurs="-1" xmltag="tolb">
		<medi:segment segcode="LIN" xmltag="tolb-lin" maxOccurs="1" ignoreUnmappedFields="true">
			<medi:field xmltag="line-no" />
			<medi:field xmltag="lin2" />
			<medi:field xmltag="olitn" />
		</medi:segment>
		<medi:segment segcode="QTY" xmltag="tolb-qty" maxOccurs="1" ignoreUnmappedFields="true">
			<medi:field xmltag="qty" />
		</medi:segment>
	</medi:segmentGroup>

I'm testing edi-to-java with a customer order in the format of EANCOM, I set a group segment for the SKU lines in the mapping file such as above. there are 2 SKUs in the EDI, but it only mapped 1 SKU. then I changed minOccurs to "2" in medi:segmentGroup, then it mapped 2 SKUs. it seems the attr of minOccurs became "realOccurs".

@nonicknamelala
Copy link
Author

nonicknamelala commented Feb 17, 2020

after testing, I found if adding the last segment "PAC" in the segmentGroup of the EDI file, and set it's minOccurs="1"(it is necessary), then it works as expected, I ignored that segment before. That's to say the last segment is necessary in the segmentGroup even it is useless. But it brings another problem that, if all the segments after "QTY" is optional, how to solve that?

	<medi:segmentGroup maxOccurs="1000" minOccurs="1" xmltag="tolb">
		<medi:segment segcode="LIN" xmltag="tolb-lin" maxOccurs="1" minOccurs="1" ignoreUnmappedFields="true">
			<medi:field xmltag="line-no" />
			<medi:field xmltag="lin2" />
			<medi:field xmltag="olitn" />
		</medi:segment>
		<medi:segment segcode="QTY" xmltag="tolb-qty" maxOccurs="1" minOccurs="1" ignoreUnmappedFields="true">
			<medi:field xmltag="qty" />
		</medi:segment>
		<medi:segment segcode="PAC" xmltag="tolb-pac" maxOccurs="1" minOccurs="1" ignoreUnmappedFields="true" />
	</medi:segmentGroup>

@cjmamo cjmamo self-assigned this Apr 10, 2020
@cjmamo
Copy link
Member

cjmamo commented Apr 11, 2020

The issue is no longer applicable: the next Smooks release replaces MEDI with DFDL.

@cjmamo cjmamo closed this as completed Apr 11, 2020
@cjmamo cjmamo added this to the v2.0.0-M1 milestone Aug 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants