same xml grammar to different edifact message types

59 views
Skip to first unread message

Vo Ta

unread,
Jul 6, 2022, 10:15:06 AM7/6/22
to Bots Open Source EDI Translator
Hey BOTS Pros!

I'm stuck, hopefully anyone can point me in the right direction.

There is a xml-grammer (attached) which contains a general format for all messagetypes(ORDERS, INVOIC, ORDRSP,...). The messagetype is defined in a field <message_type> in the xml.
Now i want to translate files from xml to edifact D96A.
But how do i set up a translation rule with 2 different mapping-scripts that will have the right "Tomessagetype", according to the "Frommessagetype".

It only works for one messagetype at the moment(INVOIC)
My translationrules looks like this:
Fromeditype: xml
Frommessagetype: unidoc
Mappingscript: xml_invoice_to_D96A
Toeditype: edifact
ToMessagetype: INVOICD96AUNEAN008

When i want to create a second translationrule for ORDRSP with
Mappingscript: xml_ordrsp_to_D96A
ToMessagetype: ORDRSPD96AUNEAN005
i get the follow error:
"Combination of fromeditype,frommessagetype,alt,frompartner,topartner already exists."

Does anyone have an idea?

Thanks!
BR
unidoc.py

Henk-Jan Ebbers

unread,
Jul 6, 2022, 10:33:26 AM7/6/22
to bots...@googlegroups.com
use the 'alt' field.
in mapping tabel you can specify 'alt'
in grammar, in QUERIES you can indicate which field is used as alt.

kind regards, henk-jan ebbers


--
You received this message because you are subscribed to the Google Groups "Bots Open Source EDI Translator" group.
To unsubscribe from this group and stop receiving emails from it, send an email to botsmail+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/botsmail/43ef3717-fddd-4fa7-a453-a68cdd778483n%40googlegroups.com.

Vo Ta

unread,
Jul 6, 2022, 2:57:15 PM7/6/22
to Bots Open Source EDI Translator
Thank you for your quick response!

but i didn't get it... sorry

I edited my grammar and inserted a query for "alt" like this: 
'alt':          {'BOTSID':'transmission','message_type':None}

Then i use the "Alternative translation"-field and insert what? The different messagetypes i want to process in this translation? ORDRSP, INVOICE? Is it possible to use comma-seperated values in the alt-field?
And there is only one field for the mapping-script... how does bots determine which mapping-script to use?

PS.: as this is the third time you help me out, may i buy you a beer or coffee? :) Do you have a donation link?

Henk-Jan Ebbers

unread,
Jul 6, 2022, 5:16:34 PM7/6/22
to bots...@googlegroups.com

editype messagetype alt    mappingscript
xml     whatever    ordrsp mapping_for_ordrsp
xml     whatever    invoic mapping_for_invoic



kind regards, henk-jan ebbers


Henk-Jan Ebbers

unread,
Jul 6, 2022, 5:18:00 PM7/6/22
to bots...@googlegroups.com
field alt is used in the loo-up to find right translation.
kind regards, henk-jan ebbers


Vo Ta

unread,
Jul 8, 2022, 8:34:05 AM7/8/22
to Bots Open Source EDI Translator
ahh... OK.
Got it now - many thanks!

what about your donation-link?
Reply all
Reply to author
Forward
0 new messages