EDIFACT support in smooks for different agencies other than UN control agency

134 views
Skip to first unread message

Akash Verma

unread,
Jan 17, 2024, 2:42:30 AM1/17/24
to Smooks Users
Hi,

We have a use case where we need to generate EDIFACT for message type OUTORD where the control agency is KE(Korea) not UN and currently in smooks we don’t have the support for the same. Is there any way we can add EDIFACT support for different agencies other than UN control agency?


Thanks,
Akash.

Claude

unread,
Jan 17, 2024, 3:08:03 AM1/17/24
to Smooks Users
You are referring to data element 0051 right? I did a quick check of the DFDL schema and KE is enumerable: https://github.com/smooks/smooks-edi-cartridge/blob/v2.0.0-RC3/common-schemas/src/main/resources/EDIFACT-Common/EDIFACT-Service-Segments-4.1.dfdl.xsd#L1149 . How are you setting it?

Claude

Akash Verma

unread,
Jan 18, 2024, 2:48:11 AM1/18/24
to Smooks Users
Hi Claude,

No, I'm referring to the whole S009 tag inside the "UNH"
```
"UNH" : {
...,
"S009" : {
"E0065": "OUTORD",
"E0052": "1",
"E0054": "921",
"E0051": "KE"
}
}

```
If you see here we have the E0065/messageType as 'OUTORD' (which isn't supported in UN Edifact) and Schema Version '1.921' is also different which is not present in the UN as it's regulated by 'KE'. 
How can we add support for these type of EDIFACT which are supported by different regulators other than the UN and they that there own EDIFACT versions and messageType?
Message has been deleted

Claude Mamo

unread,
Jan 18, 2024, 5:14:23 AM1/18/24
to smook...@googlegroups.com
[Re-posting without attachment]

Got you. There is a mechanism to override the DFDL schemas in the EDIFACT cartridge so that you can have custom schemas but it needs to be documented. I've pushed an example demonstrating how to override a schema: https://github.com/claudemamo/smooks-examples/tree/edifact-schema-override/xml-to-edifact-override. What I did was to:
  1. Create a directory in the example's classpath (i.e., src/main/resources) named 1921 as per the EDIFACT directory version in your post
  2. Extract EDIFACT-Messages.dfdl.xsd and EDIFACT-Segments.dfdl.xsd from the D03B EDIFACT schema pack archive (you should use a schema pack that closely matches what you need in terms of segments and data elements)
  3. Copy the schemas to the 1921 directory
  4. Tweak the EDIFACT-Messages.dfdl.xsd such that the INVOIC message type in now OUTORD (I just could have easily added a new message type named OUTORD instead of renaming INVOIC)
  5. Create a Smooks config which references the custom DFDL schema to turn the XML to EDIFACT:
<?xml version="1.0"?>
<smooks-resource-list xmlns="https://www.smooks.org/xsd/smooks-2.0.xsd"
xmlns:edifact="https://www.smooks.org/xsd/smooks/edifact-2.0.xsd"
xmlns:core="https://www.smooks.org/xsd/smooks/smooks-core-1.6.xsd">

<core:smooks filterSourceOn="/Interchange">
<core:action>
<core:inline>
<core:replace/>
</core:inline>
</core:action>
<core:config>
<smooks-resource-list>
<edifact:unparser schemaUri="/1921/EDIFACT-Messages.dfdl.xsd" unparseOnNode="*">
<edifact:messageTypes>
<edifact:messageType>OUTORD</edifact:messageType>
</edifact:messageTypes>
</edifact:unparser>
</smooks-resource-list>
</core:config>
</core:smooks>

</smooks-resource-list>
Would be great if you could open a PR to smooks-examples once you override a schema so that we can have a realistic example to share with the rest of the world.

Claude

--
You received this message because you are subscribed to the Google Groups "Smooks Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to smooks-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/smooks-user/5d473289-485d-4f7f-9d7d-7abeb3b5a954n%40googlegroups.com.

Akash Verma

unread,
Jan 19, 2024, 12:25:23 AM1/19/24
to Smooks Users
Sure, thanks Claude.

Akash

Claude

unread,
Nov 15, 2024, 10:04:58 AM11/15/24
to Smooks Users
This example is part of the catalogue. Thanks for bringing this use case to our attention.

Claude
Reply all
Reply to author
Forward
0 new messages