DFDLSchemas / EDIFACT

DFDL Schemas for UN/EDIFACT
25 stars 11 forks source link

Replaced use of discriminator with choiceDsipatchKey #2

Closed gdesrosi closed 5 years ago

smhdfdl commented 5 years ago

@mbeckerle @gdesrosi Converting to use direct dispatch choice is fine. A bit of background as to why the EDIFACT schemas have discriminators....

We have a Java tool that reads EDI specs and generates DFDL schemas. It works with EDIFACT (and derivatives) and X12 (and derivatives). Firstly, it was created before IBM DFDL added direct dispatch choice. Secondly, for X12 the segment that contains the transaction identifier (the 'ST') is considered to be inside the transaction, unlike EDIFACT where the 'UNH' is outside the message, so direct dispatch choice can't be used for X12.

The tool is driven by templates, some are generic and some are specific. The templates at the message/transaction level are specific to EDIFACT and X12, so it looks straightforward to convert the EDIFACT templates to use direct dispatch choice. I'll see if I can do that sometime soon, so that the IBM generated schemas match the public GitHub schemas going forward.