Gmail Agenda Documenten Reader Het internet meer »
Onlangs bekeken groepen | Help | Aanmelden
Google Discussiegroepen Startpagina
Fixed file grammar for EDI-output
Er zijn momenteel te veel onderwerpen in deze discussiegroep die als eerste worden weergegeven. Als je dit onderwerp als eerste wilt weergeven, moet je deze optie verwijderen van een ander onderwerp.
Er is een fout opgetreden bij het verwerken van je verzoek. Probeer het opnieuw.
Markeren
  13 berichten - Alles samenvouwen  -  Alles naar het vertalen Vertaald (alle originelen weergeven)
De groep waarnaar je een bericht verzendt, is een Usenet-groep. Berichten die je in deze groep verzendt, zijn zichtbaar voor iedereen op het Internet
Je antwoord is niet verzonden.
Uw bericht is geplaatst
 
Van:
Aan:
Cc:
Reactie op:
Cc toevoegen | Reactie toevoegen | Onderwerp bewerken
Onderwerp:
Validatie:
Typ ter verificatie de tekens uit de onderstaande afbeelding of de getallen die je hoort wanneer je klikt op het pictogram voor toegankelijkheid. Luister en typ de nummers die je hoort
 
Markus Imhof  
Profiel weergeven   Naar het vertalen Vertaald (origineel weergeven)
 Meer opties 18 dec 2009, 14:56
Van: Markus Imhof <marku...@gmx.de>
Datum: Fri, 18 Dec 2009 05:56:21 -0800 (PST)
Lokaal: vr 18 dec 2009 14:56
Onderwerp: Fixed file grammar for EDI-output
Hi everyone,

i have a fixed-width file and want to generate an EDI-order from it.

Each line has an record identifier at the beginning ('054') and has
header-information for the order plus informations about the article.

Actually my grammar looks like this

syntax = {
        'charset'     : 'us-ascii',
        'checkfixedrecordtooshort': True,
         'noBOTSID': True,
        }

structure=    [
    {ID:'054',MIN:1,MAX:10000,
    },
    ]

recorddefs = {
    '054':[
            ['BOTSID','C',3,'A'],
            ['SUPPLIER', 'M', 13, 'AN'],
            ['TESTFLAG', 'C', 1, 'AN'],
            ['FUNCTION', 'C', 1, 'AN'],
            ['DELIVERYTPE', 'C', 2, 'AN'],
            ['REFNUMBER', 'M', 12, 'AN'],
            ['REFTYPE','M',1,'AN'],
            ['ORDERDATE','M',6,'N'],
            ['Article','M',10,'AN'],
            ['Quantity','M',2,'AN'],
         ],

And my  mapping.script

def main(inn,out):

    #write header
    #....
    out.put({'BOTSID':'UNH','0062': inn.get({'BOTSID':'054',
'REFNUMBER': None}  ) })
    out.put({'BOTSID':'UNH','S009.0065':'ORDERS'})
    out.put({'BOTSID':'UNH','S009.0052':'D'})
    out.put({'BOTSID':'UNH','S009.0054':'96A'})
    out.put({'BOTSID':'UNH','S009.0051':'UN'})
    out.put({'BOTSID':'UNH','S009.0057':'EAN008'})

     for lin in inn.getloop({'BOTSID':'054'}):
        lou = out.putloop({'BOTSID':'UNH'},{'BOTSID':'LIN'})
        lou.put({'BOTSID':'LIN'},
{'BOTSID':'QTY','C186.6063':'21','C186.6060':lin.get
({'BOTSID':'054','Quantity':None})})
       #write some more stuff

The problem is that for each inout-line a new UNH-segment is created
while a new UNH-segment should only be created when the REFNUMBER
changes.

A changed REFNUMBER signals a new order from another customer of my
company within the EDI-order that is sent to the supplier.

I've worked quite long with the BOTS-Framework and it works like a
charm but I couldn't solve the mentioned problem. Can someone please
give me a hint?

kind regards,
Markus


    Doorsturen  
Je moet je aanmelden voordat je berichten kunt plaatsen.
Als je een bericht wilt verzenden, moet je eerst deelnemen aan deze discussiegroep.
Werk je bijnaam bij op de pagina met abonnementsinstellingen voordat je een bericht plaatst.
Je hebt geen toestemming om berichten te plaatsen.
henk-jan ebbers  
Profiel weergeven   Naar het vertalen Vertaald (origineel weergeven)
 Meer opties 18 dec 2009, 15:10
Van: henk-jan ebbers <hjebb...@gmail.com>
Datum: Fri, 18 Dec 2009 15:10:50 +0100
Lokaal: vr 18 dec 2009 15:10
Onderwerp: Re: [Mail list Bots OS EDI software] Fixed file grammar for EDI-output
Hai markus,

there is a thing for this.
in a grammar use nextmessageblock
in plugin edifact_orders2csv this is demonstrated.
in the nextmessageblock you specify which 'trigger' must be used to
split up the incoming file in 'messages';
as long as the value of the trigger changes, bots considers it to be one
message;
all lines belonging to this message are send as one 'block'.

kind regards,
henk-jan


    Doorsturen  
Je moet je aanmelden voordat je berichten kunt plaatsen.
Als je een bericht wilt verzenden, moet je eerst deelnemen aan deze discussiegroep.
Werk je bijnaam bij op de pagina met abonnementsinstellingen voordat je een bericht plaatst.
Je hebt geen toestemming om berichten te plaatsen.
Markus Imhof  
Profiel weergeven   Naar het vertalen Vertaald (origineel weergeven)
 Meer opties 18 dec 2009, 15:34
Van: Markus Imhof <marku...@gmx.de>
Datum: Fri, 18 Dec 2009 06:34:16 -0800 (PST)
Lokaal: vr 18 dec 2009 15:34
Onderwerp: Re: Fixed file grammar for EDI-output
Hi Henk-Jan,

thanks for the reply. I've already experimented with nextmessageblock
and with this example.

My extension of the fixed file-grammar was like there

nextmessageblock = ({'BOTSID':'HEA','REFNUMBER':None})

which resulted in an

Traceback (most recent call last): ScriptError: Script file "C:
\Python26\lib\site-packages\bots\bots.usersys\mappings
\fixed.FixedToEdi": "Traceback (most recent call last):
MpathRootError: get(({'SUPPLIER': None, 'BOTSID': '054'},)): "root" of
incoming message is empty; either split messages or use inn.getloop
".

I don't get the trick what is wrong about this.

I also don't have a nested recordset where each "HEA"-line has several
"LIN".lines below it like shown with the CSV-examples.

How can I model this? As far as I I've occupied me with the framework
it shouldn't be difficult at all but I'm a python-newbie.and thankful
for every hint.

kind regards,
Markus

On 18 Dez., 15:10, henk-jan ebbers <hjebb...@gmail.com> wrote:


    Doorsturen  
Je moet je aanmelden voordat je berichten kunt plaatsen.
Als je een bericht wilt verzenden, moet je eerst deelnemen aan deze discussiegroep.
Werk je bijnaam bij op de pagina met abonnementsinstellingen voordat je een bericht plaatst.
Je hebt geen toestemming om berichten te plaatsen.
henk-jan ebbers  
Profiel weergeven   Naar het vertalen Vertaald (origineel weergeven)
 Meer opties 18 dec 2009, 15:46
Van: henk-jan ebbers <hjebb...@gmail.com>
Datum: Fri, 18 Dec 2009 15:46:05 +0100
Lokaal: vr 18 dec 2009 15:46
Onderwerp: Re: [Mail list Bots OS EDI software] Re: Fixed file grammar for EDI-output
several things:

1. remove from syntax:

         'noBOTSID': True,

as you fixed file does have a recordID, does it?

Markus Imhof wrote:
> Hi Henk-Jan,

> thanks for the reply. I've already experimented with nextmessageblock
> and with this example.

> My extension of the fixed file-grammar was like there

> nextmessageblock = ({'BOTSID':'HEA','REFNUMBER':None})

2. your BOTSID is '054'

> which resulted in an

> Traceback (most recent call last): ScriptError: Script file "C:
> \Python26\lib\site-packages\bots\bots.usersys\mappings
> \fixed.FixedToEdi": "Traceback (most recent call last):
> MpathRootError: get(({'SUPPLIER': None, 'BOTSID': '054'},)): "root" of
> incoming message is empty; either split messages or use inn.getloop
> ".

3. to solve this error take a look at the specific script in plugin
edifact_orders2csv
    when I made the plugin I had the same error you had, and I solved in
this script.

kind regards,
henk-jan


    Doorsturen  
Je moet je aanmelden voordat je berichten kunt plaatsen.
Als je een bericht wilt verzenden, moet je eerst deelnemen aan deze discussiegroep.
Werk je bijnaam bij op de pagina met abonnementsinstellingen voordat je een bericht plaatst.
Je hebt geen toestemming om berichten te plaatsen.
Markus Imhof  
Profiel weergeven   Naar het vertalen Vertaald (origineel weergeven)
 Meer opties 18 jan, 12:47
Van: Markus Imhof <marku...@gmx.de>
Datum: Mon, 18 Jan 2010 03:47:39 -0800 (PST)
Lokaal: ma 18 jan 2010 12:47
Onderwerp: Re: Fixed file grammar for EDI-output
Thanks Henk-Jan,

i've got it running since two weeks now, it's great.

Now I want to setup a POP3-channel for incoming EDI-messages.

I could not get the trick how to configure this: The messages are
picked up from my POP3-account but I get an error-message:

KQ_InvoicesFromSuppliers         file to recieve                 InvoicePOP3IN
                                         0       pop3://edi.invoice@kuechen-
quelle...@q03maranello.q03.quelle.net       1       2010-01-18 12:40:02
                                 text/plain

raw infile      Partial         InvoicePOP3IN                                           0       6127    1       2010-01-18
12:40:02                                        text/plain

mimein  Error   InvoicePOP3IN                                           0       6127    1       2010-01-18 12:40:02
Traceback (most recent call last): UnboundLocalError: local variable
'topartner' referenced before assignment                                 text/plain

I've setup a partner with the supplier ILN as partner-id and the email
of the message sender. The email itself has an attachment with the EDI-
message.

I'm not referencing the toPartner-variable from within my translation
so I'm curious what has happened there?

regards,
Markus

PS: is there a way to automate the processing of all routes, e.g.a run
each two hours instead of clicking manually on the browser?


    Doorsturen  
Je moet je aanmelden voordat je berichten kunt plaatsen.
Als je een bericht wilt verzenden, moet je eerst deelnemen aan deze discussiegroep.
Werk je bijnaam bij op de pagina met abonnementsinstellingen voordat je een bericht plaatst.
Je hebt geen toestemming om berichten te plaatsen.
henk-jan ebbers  
Profiel weergeven   Naar het vertalen Vertaald (origineel weergeven)
 Meer opties 18 jan, 12:56
Van: henk-jan ebbers <hjebb...@gmail.com>
Datum: Mon, 18 Jan 2010 12:56:57 +0100
Lokaal: ma 18 jan 2010 12:56
Onderwerp: Re: [Mail list Bots OS EDI software] Re: Fixed file grammar for EDI-output
Hi Markus,

looks like a (smaller) bug.
I will have a look at it.
can you set 2 things in infog/bots.ini:
    debug = True
    log_file_level = DEBUG
that gives some more clues about what went wrong.
could you can send the log file for the error (after running with the
changed setting)?

about the automating:
no, Bots does no scheduling.
but all OS'es have scheduling tools (eg CRON)

kind regards,
henk-jan


    Doorsturen  
Je moet je aanmelden voordat je berichten kunt plaatsen.
Als je een bericht wilt verzenden, moet je eerst deelnemen aan deze discussiegroep.
Werk je bijnaam bij op de pagina met abonnementsinstellingen voordat je een bericht plaatst.
Je hebt geen toestemming om berichten te plaatsen.
Markus Imhof  
Profiel weergeven   Naar het vertalen Vertaald (origineel weergeven)
 Meer opties 18 jan, 13:20
Van: Markus Imhof <marku...@gmx.de>
Datum: Mon, 18 Jan 2010 04:20:41 -0800 (PST)
Lokaal: ma 18 jan 2010 13:20
Onderwerp: Re: Fixed file grammar for EDI-output
Hello Henk-Jan,

my version is Bots 1.6.0 running on Win32 with Python 2.6.4

The logfile is now as following

20100118 13:12:43 INFO     bots : Python version: "2.6.4 (r264:75708,
Oct 26 2009, 08:23:19) [MSC v.1500 32 bit (Intel)]".
20100118 13:12:43 INFO     bots : Bots configuration file: "config".
20100118 13:12:43 INFO     bots : Bots database configuration file: "C:
\Python26\lib\site-packages\bots\config\botstg.cfg".
20100118 13:12:44 INFO     bots : Database: "sqlite:///C:\Python26\lib
\site-packages\bots/botssys/sqlitedb/botsdb".
20100118 13:12:44 INFO     bots : New run.
20100118 13:12:44 INFO     bots : running route InvoicesFromSuppliers
9999
20100118 13:12:44 DEBUG    bots : (try) to read user routescript route
"InvoicesFromSuppliers".
20100118 13:12:44 DEBUG    bots : import file "C:\Python26\lib\site-
packages\bots\bots.usersys\routescripts\InvoicesFromSuppliers".
20100118 13:12:44 DEBUG    bots : start communication channel
"InvoicePOP3IN" type pop3 in.
20100118 13:12:44 DEBUG    bots : (try) to read user
communicationscript channel "InvoicePOP3IN".
20100118 13:12:44 DEBUG    bots : import file "C:\Python26\lib\site-
packages\bots\bots.usersys\communicationscripts\InvoicePOP3IN".
20100118 13:12:44 DEBUG    bots : exception Traceback (most recent
call last):
UnboundLocalError: local variable 'topartner' referenced before
assignment

20100118 13:12:44 DEBUG    bots : finished communication channel
"InvoicePOP3IN" type pop3 in.
20100118 13:12:44 DEBUG    bots : start communication channel
"InvoicesFromSuppliers_Out" type file out.
20100118 13:12:44 DEBUG    bots : (try) to read user
communicationscript channel "InvoicesFromSuppliers_Out".
20100118 13:12:44 DEBUG    bots : import file "C:\Python26\lib\site-
packages\bots\bots.usersys\communicationscripts
\InvoicesFromSuppliers_Out".
20100118 13:12:44 DEBUG    bots : finished communication channel
"InvoicesFromSuppliers_Out" type file out.
20100118 13:12:44 DEBUG    bots : finished route
KQ_InvoicesFromSuppliers 9999
20100118 13:12:44 INFO     bots : Bots Report; type: new, time:
2010-01-18 13:12:44
    1 files received/processed in run.
    1 files with errors,
    0 files send in run.

One thing that is quite obviously is that the directory

C:\Python26\lib\site-packages\bots\bots.usersys\communicationscripts\

does not contain a file called

InvoicePOP3IN (which is the name of my In-Channel for POP3)

Another thing is that I attach the EDI-message to the email but I
could not find out whether this is the correct procedure (e.g. instead
of using the mail body)..

> about the automating:
> no, Bots does no scheduling.
> but all OS'es have scheduling tools (eg CRON)

That is what was my initial thought, too. But is there a python-script
that can be called in order to run one sepcial or every active route
defined so that I can automate the processing?

kind regards,
Markus


    Doorsturen  
Je moet je aanmelden voordat je berichten kunt plaatsen.
Als je een bericht wilt verzenden, moet je eerst deelnemen aan deze discussiegroep.
Werk je bijnaam bij op de pagina met abonnementsinstellingen voordat je een bericht plaatst.
Je hebt geen toestemming om berichten te plaatsen.
henk-jan ebbers  
Profiel weergeven   Naar het vertalen Vertaald (origineel weergeven)
 Meer opties 18 jan, 13:48
Van: henk-jan ebbers <hjebb...@gmail.com>
Datum: Mon, 18 Jan 2010 13:48:59 +0100
Lokaal: ma 18 jan 2010 13:48
Onderwerp: Re: [Mail list Bots OS EDI software] Re: Fixed file grammar for EDI-output
Hi markus,

in bots.ini,  debug is still False it seems. Can you make it 'True'?

I do not need the edi message.

>> about the automating:
>> no, Bots does no scheduling.
>> but all OS'es have scheduling tools (eg CRON)

> That is what was my initial thought, too. But is there a python-script
> that can be called in order to run one sepcial or every active route
> defined so that I can automate the processing?

yes. see http://bots.sourceforge.net/en/install.shtml
try bots-engine --help  (on linux, use right path on windows)


    Doorsturen  
Je moet je aanmelden voordat je berichten kunt plaatsen.
Als je een bericht wilt verzenden, moet je eerst deelnemen aan deze discussiegroep.
Werk je bijnaam bij op de pagina met abonnementsinstellingen voordat je een bericht plaatst.
Je hebt geen toestemming om berichten te plaatsen.
Markus Imhof  
Profiel weergeven   Naar het vertalen Vertaald (origineel weergeven)
 Meer opties 18 jan, 14:03
Van: Markus Imhof <marku...@gmx.de>
Datum: Mon, 18 Jan 2010 05:03:45 -0800 (PST)
Lokaal: ma 18 jan 2010 14:03
Onderwerp: Re: Fixed file grammar for EDI-output
Oh pardon, i did not save the ini-File :o(

0100118 13:55:07 INFO     bots : New run.
20100118 13:55:07 INFO     bots : running route InvoicesFromSuppliers
9999
20100118 13:55:07 DEBUG    bots : (try) to read user routescript route
"InvoicesFromSuppliers".
20100118 13:55:07 DEBUG    bots : import file "C:\Python26\lib\site-
packages\bots\bots.usersys\routescripts\InvoicesFromSuppliers".
20100118 13:55:07 DEBUG    bots : start communication channel
"InvoicePOP3IN" type pop3 in.
20100118 13:55:07 DEBUG    bots : (try) to read user
communicationscript channel "InvoicePOP3IN".
20100118 13:55:07 DEBUG    bots : import file "C:\Python26\lib\site-
packages\bots\bots.usersys\communicationscripts\InvoicePOP3IN".
20100118 13:55:08 DEBUG    bots : exception Traceback (most recent
call last):
  File "C:\Python26\lib\site-packages\bots\communication.py", line
417, in mime2file
    topartner=topartner,
UnboundLocalError: local variable 'topartner' referenced before
assignment

20100118 13:55:08 DEBUG    bots : finished communication channel
"InvoicePOP3IN" type pop3 in.
20100118 13:55:08 DEBUG    bots : start communication channel
"InvoicesFromSuppliers_Out" type file out.
20100118 13:55:08 DEBUG    bots : (try) to read user
communicationscript channel "InvoicesFromSuppliers_Out".
20100118 13:55:08 DEBUG    bots : import file "C:\Python26\lib\site-
packages\bots\bots.usersys\communicationscripts
\InvoicesFromSuppliers_Out".
20100118 13:55:08 DEBUG    bots : finished communication channel
"InvoicesFromSuppliers_Out" type file out.
20100118 13:55:08 DEBUG    bots : finished route InvoicesFromSuppliers
9999
20100118 13:55:08 INFO     bots : Bots Report; type: new, time:
2010-01-18 13:55:07
    1 files received/processed in run.
    1 files with errors,
    0 files send in run.

> yes. seehttp://bots.sourceforge.net/en/install.shtml
> try bots-engine --help  (on linux, use right path on windows)

Great! That is what I was looking for!

bots-engine.exe --new

Kind Regards,
Markus


    Doorsturen  
Je moet je aanmelden voordat je berichten kunt plaatsen.
Als je een bericht wilt verzenden, moet je eerst deelnemen aan deze discussiegroep.
Werk je bijnaam bij op de pagina met abonnementsinstellingen voordat je een bericht plaatst.
Je hebt geen toestemming om berichten te plaatsen.
henk-jan ebbers  
Profiel weergeven   Naar het vertalen Vertaald (origineel weergeven)
 Meer opties 18 jan, 17:06
Van: henk-jan ebbers <hjebb...@gmail.com>
Datum: Mon, 18 Jan 2010 17:06:47 +0100
Lokaal: ma 18 jan 2010 17:06
Onderwerp: Re: [Mail list Bots OS EDI software] Re: Fixed file grammar for EDI-output
Hi Markus,

I see in the change log that I fixed someting like this in 1.6.1
(updating to 1.6.1 is easy with plugin)

can you try that to see if it still happens?

kind regards,,
henk-jan


    Doorsturen  
Je moet je aanmelden voordat je berichten kunt plaatsen.
Als je een bericht wilt verzenden, moet je eerst deelnemen aan deze discussiegroep.
Werk je bijnaam bij op de pagina met abonnementsinstellingen voordat je een bericht plaatst.
Je hebt geen toestemming om berichten te plaatsen.
Markus Imhof  
Profiel weergeven   Naar het vertalen Vertaald (origineel weergeven)
 Meer opties 18 jan, 17:34
Van: Markus Imhof <marku...@gmx.de>
Datum: Mon, 18 Jan 2010 08:34:52 -0800 (PST)
Lokaal: ma 18 jan 2010 17:34
Onderwerp: Re: Fixed file grammar for EDI-output
Hi Henk-Jan,

I've upgraded to 1.6.1 but the error didn't change, it's still

Traceback (most recent call last): File "c:\python26\lib\site-packages
\bots\communication.py", line 417, in mime2file topartner=topartner,
UnboundLocalError: local variable 'topartner' referenced before
assignment

It seems this code before is not running through

for toname,tomail in tos:   #all tos-addresses are checked; inly one
needs to be authorised.
                    try:
                        topartner =  self.mailaddress2idpartner
(tomail)
                        break
                    except botslib.AuthorizeError:
                        pass

or perhaps 'tomail' is unitialized?

What does the framework try to do there?

kind regards,
markus

On 18 Jan., 17:06, henk-jan ebbers <hjebb...@gmail.com> wrote:


    Doorsturen  
Je moet je aanmelden voordat je berichten kunt plaatsen.
Als je een bericht wilt verzenden, moet je eerst deelnemen aan deze discussiegroep.
Werk je bijnaam bij op de pagina met abonnementsinstellingen voordat je een bericht plaatst.
Je hebt geen toestemming om berichten te plaatsen.
henk-jan ebbers  
Profiel weergeven   Naar het vertalen Vertaald (origineel weergeven)
 Meer opties 18 jan, 17:46
Van: henk-jan ebbers <hjebb...@gmail.com>
Datum: Mon, 18 Jan 2010 17:46:40 +0100
Lokaal: ma 18 jan 2010 17:46
Onderwerp: Re: [Mail list Bots OS EDI software] Re: Fixed file grammar for EDI-output
Hi Markus,

bots uses the email address to identify the partner.
I think the error occurs when the email-address is not found.
(I think Bots should geven an error, but does not give the right error).

You will have to add a partner with their email address.
If you do that, does it run OK?

kind regards,
henk-jan


    Doorsturen  
Je moet je aanmelden voordat je berichten kunt plaatsen.
Als je een bericht wilt verzenden, moet je eerst deelnemen aan deze discussiegroep.
Werk je bijnaam bij op de pagina met abonnementsinstellingen voordat je een bericht plaatst.
Je hebt geen toestemming om berichten te plaatsen.
henk-jan ebbers  
Profiel weergeven   Naar het vertalen Vertaald (origineel weergeven)
 Meer opties 19 jan, 14:54
Van: henk-jan ebbers <hjebb...@gmail.com>
Datum: Tue, 19 Jan 2010 14:54:11 +0100
Lokaal: di 19 jan 2010 14:54
Onderwerp: Re: [Mail list Bots OS EDI software] Re: Fixed file grammar for EDI-output
Hi markus,

I tested this some more .
this is a bug (will be fixed in 1.6.2).
the error is correct but is quite confusing.
a workaround is: configure the incoming email address in bots (in partners)
(if the email address is known, all goes OK.)

thanks for letting me know,
henk-jan


    Doorsturen  
Je moet je aanmelden voordat je berichten kunt plaatsen.
Als je een bericht wilt verzenden, moet je eerst deelnemen aan deze discussiegroep.
Werk je bijnaam bij op de pagina met abonnementsinstellingen voordat je een bericht plaatst.
Je hebt geen toestemming om berichten te plaatsen.
Einde van berichten
« Terug naar Discussies « Nieuwer onderwerp     Ouder onderwerp »

Discussiegroep maken - Google Discussiegroepen - Google Startpagina - Servicevoorwaarden - Privacybeleid
©2010 Google