Return CONTRL when error in incoming message

149 views
Skip to first unread message

Jean-François

unread,
Apr 25, 2012, 12:04:59 PM4/25/12
to Bots Open Source EDI Translator
Hi All,

I'm on my way to implement the sending of CONTRL message in case there
is a problem with the incoming message. I'm not sure I understand the
logic behind the "ConfirmRules".
I guess I have to create the following "negative" rule:
- Confirm type: send an edifact confirmation (CONTRL) when receiving
- Ruletype: all (??)
- FromPartner: (None)
- ToPartner: (None)
- Route: (??)
- Channel: test_out_edi
EdiType: edifact
MessageType: CONTRLD3UNEGG504

If the message is successfully processed, I send an APERAK back to the
sender, saying "message received and OK" (even though this is not
Bots' job to do that). But how can I send a CONTRL mentioning an error
in the message (for instance InMessageFieldError: Record "QTY" numeric
field "C186.6060" has non-numerical content: "0,5656545452131") to my
counter-party? I need to send a CONTRL with status 18 (saying
something is wrong in the message you sent me).

Thanks for your suggestions... I'm diving in my code again :-)

Kind regards,

JF

hjeb...@gmail.com

unread,
Apr 25, 2012, 12:18:54 PM4/25/12
to bots...@googlegroups.com


kind regards,
Henk-Jan Ebbers
www.ebbersconsult.com
t: 0031 30 2888358

Bots Open Source EDI Translator: http://bots.sourceforge.net
I guess what you want is to send a CONTRL message when receiving edifact messages in channel test_out.edi

than:

positieve rule
- Confirm type: send an edifact confirmation (CONTRL) when receiving
- Ruletype: channel
- FromPartner: (None)
- ToPartner: (None)
- Route: (??)
- Channel: test_out_edi
EdiType: (none)
MessageType: ---

henk-jan

Jean-François

unread,
Apr 25, 2012, 12:42:41 PM4/25/12
to Bots Open Source EDI Translator
Hi Henk-Jan,

What I would like to do is to send a CONTRL if the message I receive
(an ORDRSP, for instance) contains an error. I can receive this
message from any channel.
I thought the "test_out_edi" was the channel where I could send my
CONTRL to...

If the message I receive is OK, I send an APERAK, using the ALT
mapping - that's not an issue and it's working great. Problem is: how
can I tell my counterparty (using CONTRL) there is something wrong
with the message they sent me...

Thanks

JF

On Apr 25, 6:18 pm, "hjebb...@gmail.com" <hjebb...@gmail.com> wrote:
> kind regards,
> Henk-Jan Ebberswww.ebbersconsult.com

hjeb...@gmail.com

unread,
Apr 25, 2012, 6:40:08 PM4/25/12
to bots...@googlegroups.com
actually a confirmation is only send if the message is OK.
but, as always, there might be a solution in Bots ;-))
I use this at the moment in a test-service: if you send an email as with DESADV D 01B to easyd...@gmail.com, you will get an errorreport back.
this works by having an extra route that runs after the rregular routes; this picks up the errors and makes it (now) into a report.
that sounds more like what you have in mind. I do not know if this is 'general' enough; probelm might be to convert the bots errors in a CONTRL message....
(in bots 2.2.0 bots does not stop parsing after one error, so this might be a complete list of errors in an edifact interchange)

henk-jan

Jean-François

unread,
Apr 26, 2012, 1:57:48 AM4/26/12
to Bots Open Source EDI Translator
Hi Henk-Jan,
If the message is OK, we have to send a CONTRL saying: message
received and structure OK. But if message is NOK, we have to send a
CONTRL saying: your message does contain an error, without specifiying
it (like you do in an APERAK).

So the following mapping should do the trick:

mport bots.transform as transform
import time

def main(inn,out):
ref = transform.unique('messagecounter')

out.put({'BOTSID':'UNH','0062':ref,'S009.0065':'CONTRL','S009.0052':'D','S009.0054':'3','S009.0051':'UN','S009.0057':'EGG504'})
sender= inn.ta_info['frompartner']
receiver= inn.ta_info['topartner']
out.ta_info['topartner'] =sender
out.ta_info['frompartner'] =receiver
out.ta_info['testindicator'] = inn.ta_info['testindicator']

out.put({'BOTSID':'UNH'},
{'BOTSID':'UCI','0020':'SearchForMessageRefInSourceFile','S002.0004':sender,'S002.0007':'14','S003.0010':receiver,'S003.0007':'14','0083':'4','0085':'18'})
out.put({'BOTSID':'UNH'},{'BOTSID':'UNT','0074':out.getcount()
+1,'0062':ref})

So do you suggest that an additional should be run, querying the DB to
select errors and generating a CONTRL for those errors (one per
message)?

Thanks for your feedback!

JF

On Apr 26, 12:40 am, "hjebb...@gmail.com" <hjebb...@gmail.com> wrote:
> actually a confirmation is only send if the message is OK.
> but, as always, there might be a solution in Bots ;-))
> I use this at the moment in a test-service: if you send an email as with DESADV D 01B to easydes...@gmail.com, you will get an errorreport back.

hjeb...@gmail.com

unread,
Apr 26, 2012, 5:36:21 AM4/26/12
to bots...@googlegroups.com
dependss.

1. CONTRL is on interchange level.
are your mappings on interchanges?

2. edifact errors will not be picked up.

henk-jan

Jean-François

unread,
Apr 26, 2012, 9:13:16 AM4/26/12
to Bots Open Source EDI Translator
Henk-Jan,

As I told in my first post, I do not clearly understand the "Confirm
Rules" procedure. So that's why I implemented an ALT translation, and
I can send a CONTRL OK to my counterparty.
I guess I can query the DB and retreive UNB information of all last
run edifact messages in error > generate a CONTRL for each of them.
Is this the way to do ? What do you suggest? How can I intervene at
interchange level?

Thanks
JF

On 26 avr, 11:36, "hjebb...@gmail.com" <hjebb...@gmail.com> wrote:
> dependss.
>
> 1. CONTRL is on interchange level.
>      are your mappings on interchanges?
>
> 2. edifact errors will not be picked up.
>
> henk-jan
>
> On 04/26/2012 07:57 AM, Jean-François wrote:
>
>
>
>
>
>
>
> > Hi Henk-Jan,
> > If the message is OK, we have to send a CONTRL saying: message
> > received and structure OK. But if message is NOK, we have to send a
> > CONTRL saying: your message does contain an error, without specifiying
> > it (like you do in an APERAK).
>
> > So the following mapping should do the trick:
>
> > mport bots.transform as transform
> > import time
>
> > def main(inn,out):
> >      ref = transform.unique('messagecounter')
>
> > out.put({'BOTSID':'UNH','0062':ref,'S009.0065':'CONTRL','S009.0052':'D','S0 09.0054':'3','S009.0051':'UN','S009.0057':'EGG504'})
> >      sender= inn.ta_info['frompartner']
> >      receiver= inn.ta_info['topartner']
> >      out.ta_info['topartner'] =sender
> >      out.ta_info['frompartner'] =receiver
> >      out.ta_info['testindicator'] = inn.ta_info['testindicator']
>
> >      out.put({'BOTSID':'UNH'},
> > {'BOTSID':'UCI','0020':'SearchForMessageRefInSourceFile','S002.0004':sender ,'S002.0007':'14','S003.0010':receiver,'S003.0007':'14','0083':'4','0085':' 18'})

henk-jan ebbers

unread,
Apr 27, 2012, 6:51:59 PM4/27/12
to bots...@googlegroups.com
hi Jean-François,



On 04/26/2012 03:13 PM, Jean-François wrote:
> Henk-Jan,
>
> As I told in my first post, I do not clearly understand the "Confirm
> Rules" procedure.
at the moment, confirm messages are not send for edifact errors.

> So that's why I implemented an ALT translation, and
> I can send a CONTRL OK to my counterparty.
if they use only one message per interchange.
> I guess I can query the DB and retreive UNB information of all last
> run edifact messages in error> generate a CONTRL for each of them.
> Is this the way to do ? What do you suggest? How can I intervene at
> interchange level?
use the confirm rules ;-)

for edifact errors: as said, there is a hook.
but it is not very easy at the moment.

henk-jan

Jean-François

unread,
May 2, 2012, 5:34:19 AM5/2/12
to Bots Open Source EDI Translator
Hi Henk-Jan,
Indeed, there is a problem... we've parsed the bots code. We're still
working on this - as soon as we go further (at least to solve our
current problem), we'll keep the mailing list aware :-)
Many thanks
Kind regards,
JF

Klaas Feenstra

unread,
Jul 29, 2022, 4:30:15 AM7/29/22
to Bots Open Source EDI Translator
Hi Henk-Jan, 

For some simple edi checks, I use sometimes the easydesadv test service. From some days, I realise this is not working anymore. Is this service depreciated, or just a service that is hanging?

Kind regards,

Klaas

Op donderdag 26 april 2012 om 00:40:08 UTC+2 schreef hjebbers:

Henk-Jan Ebbers

unread,
Jul 29, 2022, 5:19:56 AM7/29/22
to bots...@googlegroups.com
ik ga dit checken. dank je wel.
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/2a40917d-f71e-4681-819d-dd03aa94a6a6n%40googlegroups.com.

Klaas Feenstra

unread,
Aug 16, 2022, 6:31:32 AM8/16/22
to Bots Open Source EDI Translator
Hallo Henk Jan,

Heb je nog wat kunnen vinden? Ik heb zojuist nog geprobeerd, maar kreeg nog geen rapport terug.

Op vrijdag 29 juli 2022 om 11:19:56 UTC+2 schreef hjebbers:

Eppye Bots

unread,
Aug 16, 2022, 6:43:08 AM8/16/22
to 'Chuck Turco' via Bots Open Source EDI Translator
google email lukt niet meer.
moet dit idd omzetten naar ander email adres.

kind regards, Henk-Jan Ebbers


Reply all
Reply to author
Forward
0 new messages