Need "usersys/envelopescripts/x12/x12.py" file

114 views
Skip to first unread message

Harold DeWayne

unread,
May 16, 2013, 6:27:52 AM5/16/13
to bots...@googlegroups.com
I am working on an outbound X12 file and I'm getting an error of

OutMessageError: In enveloping "frompartner" or "topartner"


I think that means I am missing the x12 envelopescript or the one I have is corrupt.  From my understanding, this file should be the same for all x12 translations... can anyone send be a working x12.py file please.




Thanks.
Harold.

Harold DeWayne

unread,
May 16, 2013, 6:31:49 AM5/16/13
to bots...@googlegroups.com
Or tell me what I'm doing wrong.

&^)

Thanks again.

HD

henk-jan ebbers

unread,
May 16, 2013, 6:36:19 AM5/16/13
to bots...@googlegroups.com

in order to envelope bots will need to know the partners.
most convenient is to use the QUERY in grammar of the incoming messages to get the partners.

all x12.py files in the plugins are working.
the plugins also demonstrate correct handling of from- and topartners.


kind regards,
henk-jan


On 05/16/2013 12:27 PM, Harold DeWayne wrote:
> I am working on an outbound X12 file and I'm getting an error of
>
> OutMessageError: In enveloping "frompartner" or "topartner"
>
>
> I _think_ that means I am missing the x12 envelopescript or the one I have is corrupt. From my understanding, this file should be the same for all x12 translations... can anyone send be a working
> x12.py file please.
>
>
>
>
> Thanks.
> Harold.
> --
> 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.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

henk-jan ebbers

unread,
May 16, 2013, 6:50:04 AM5/16/13
to bots...@googlegroups.com
mmmmh, this is not very well documented.

have to find where to do this....

kind regards,
henk-jan


On 05/16/2013 12:31 PM, Harold DeWayne wrote:
> Or tell me what I'm doing wrong.
>
> &^)
>
> Thanks again.
>
> HD
>
> On Thursday, May 16, 2013 6:27:52 AM UTC-4, Harold DeWayne wrote:
>
> I am working on an outbound X12 file and I'm getting an error of
>
> OutMessageError: In enveloping "frompartner" or "topartner"
>
>
> I _think_ that means I am missing the x12 envelopescript or the one I have is corrupt. From my understanding, this file should be the same for all x12 translations... can anyone send be a
> working x12.py file please.
>
>
>
>
> Thanks.
> Harold.
>

Harold DeWayne

unread,
May 16, 2013, 9:55:34 AM5/16/13
to bots...@googlegroups.com
Figured it out...

The issue was NOT a missing/invalid x12.py file... the isue was missing topartner/frompartner information in the "route".  Now to figure out how to get that information in the envelopescript(?)... I know the information is in the XML... just gotta retreive it.


Thanks all.

HD

henk-jan ebbers

unread,
May 16, 2013, 10:00:31 AM5/16/13
to bots...@googlegroups.com


it is in the grammar.
it is called QUERIES.
it's sort of 'get' but is done before mapping script etc.
see plugins for examples, or x12.py or envelope.py (in x12 grammars)

kind regards,
henk-jan
> > To unsubscribe from this group and stop receiving emails from it, send an email to botsmail+u...@googlegroups.com <javascript:>.
> > For more options, visit https://groups.google.com/groups/opt_out <https://groups.google.com/groups/opt_out>.

Harold DeWayne

unread,
May 17, 2013, 9:52:25 PM5/17/13
to bots...@googlegroups.com
OK. I Think I figured out ow to use the queries, but I'm apparently not getting values (I still have to define the partners in the route in order to get a translation to work.)

Here's my grammar file with my queries defined:

#grammar automatically generated by bots open source edi translator.
from bots.botsconfig import *

# Global Variables for XML
pfx = r'{http://quantumedgetechnology/edgetms/schemas}'
xsi=r'{http://www.w3.org/2001/XMLSchema-instance}'

syntax = {}

structure = [
{ID:pfx+'RailBilling',MIN:1,MAX:99999,

    # Retreive the Sender/Receiver ID and application control number from the data
    QUERIES:{
        'frompartner':  {'BOTSID':'RailBilling','RailBilling__sender':None},
        'topartner':    {'BOTSID':'RailBilling','RailBilling__receiver':None},
        'cntrl':        {'BOTSID':'RailBilling','RailBilling__cntrl':None},
        },
    LEVEL:[

    {ID:pfx+'Shipment',MIN:0,MAX:99999},
    {ID:pfx+'Reference',MIN:0,MAX:99999},
    {ID:pfx+'Location',MIN:0,MAX:99999,LEVEL:[
    {ID:pfx+'Contact',MIN:0,MAX:99999},
    ]},
    {ID:pfx+'Routing',MIN:0,MAX:99999},
]},
]


recorddefs = {
    pfx+'Location':
        [
        ['BOTSID', 'M', 256, 'AN'],
        [pfx+'Location__address', 'C', 256, 'AN'],
        [pfx+'Location__city', 'C', 256, 'AN'],
        [pfx+'Location__country', 'C', 256, 'AN'],
        [pfx+'Location__name', 'C', 256, 'AN'],
        [pfx+'Location__postal', 'C', 256, 'AN'],
        [pfx+'Location__state', 'C', 256, 'AN'],
        [pfx+'Location__type', 'C', 256, 'AN'],
        ],
    pfx+'RailBilling':
        [
        ['BOTSID', 'M', 256, 'AN'],
        [pfx+'RailBilling__cntrl', 'C', 256, 'AN'],
        [pfx+'RailBilling__receiver', 'C', 256, 'AN'],
        [pfx+'RailBilling__sender', 'C', 256, 'AN'],
        [pfx+'RailBilling__xmlns', 'C', 256, 'AN'],
        [pfx+'RailBilling__xmlns:xsi', 'C', 256, 'AN'],
        [pfx+'RailBilling__'+xsi+'schemaLocation', 'C', 256, 'AN'],
        ],
    pfx+'Contact':
        [
        ['BOTSID', 'M', 256, 'AN'],
        [pfx+'Contact__function', 'C', 256, 'AN'],
        [pfx+'Contact__name', 'C', 256, 'AN'],
        [pfx+'Contact__type', 'C', 256, 'AN'],
        [pfx+'Contact__value', 'C', 256, 'AN'],
        ],
    pfx+'Shipment':
        [
        ['BOTSID', 'M', 256, 'AN'],
        [pfx+'Shipment__authority_type', 'C', 256, 'AN'],
        [pfx+'Shipment__billing_code', 'C', 256, 'AN'],
        [pfx+'Shipment__carrier_id', 'C', 256, 'AN'],
        [pfx+'Shipment__commodity_code', 'C', 256, 'AN'],
        [pfx+'Shipment__commodity_desc', 'C', 256, 'AN'],
        [pfx+'Shipment__dramp_city', 'C', 256, 'AN'],
        [pfx+'Shipment__dramp_state', 'C', 256, 'AN'],
        [pfx+'Shipment__eq_initial', 'C', 256, 'AN'],
        [pfx+'Shipment__eq_length', 'C', 256, 'AN'],
        [pfx+'Shipment__eq_number', 'C', 256, 'AN'],
        [pfx+'Shipment__eq_type', 'C', 256, 'AN'],
        [pfx+'Shipment__id', 'C', 256, 'AN'],
        [pfx+'Shipment__oramp_city', 'C', 256, 'AN'],
        [pfx+'Shipment__oramp_state', 'C', 256, 'AN'],
        [pfx+'Shipment__pay_method', 'C', 256, 'AN'],
        [pfx+'Shipment__price_type', 'C', 256, 'AN'],
        [pfx+'Shipment__purpose', 'C', 256, 'AN'],
        [pfx+'Shipment__qualifier', 'C', 256, 'AN'],
        [pfx+'Shipment__quantity', 'C', 256, 'AN'],
        [pfx+'Shipment__quantity_type', 'C', 256, 'AN'],
        [pfx+'Shipment__quote_number', 'C', 256, 'AN'],
        [pfx+'Shipment__release_date', 'C', 256, 'AN'],
        [pfx+'Shipment__scac', 'C', 256, 'AN'],
        [pfx+'Shipment__tariff_agency_code', 'C', 256, 'AN'],
        [pfx+'Shipment__transport_type', 'C', 256, 'AN'],
        [pfx+'Shipment__weight', 'C', 256, 'AN'],
        [pfx+'Shipment__weight_code', 'C', 256, 'AN'],
        [pfx+'Shipment__weight_qualifier', 'C', 256, 'AN'],
        ],
    pfx+'Reference':
        [
        ['BOTSID', 'M', 256, 'AN'],
        [pfx+'Reference__type', 'C', 256, 'AN'],
        [pfx+'Reference__value', 'C', 256, 'AN'],
        ],
    pfx+'Routing':
        [
        ['BOTSID', 'M', 256, 'AN'],
        [pfx+'Routing__desc', 'C', 256, 'AN'],
        [pfx+'Routing__rail_scac', 'C', 256, 'AN'],
        [pfx+'Routing__sequence_code', 'C', 256, 'AN'],
        [pfx+'Routing__service_code', 'C', 256, 'AN'],
        [pfx+'Routing__service_code_type', 'C', 256, 'AN'],
        ],
    }

Can anyone tell me why I'm having trouble?   Thanks.

Harold.

henk-jan ebbers

unread,
May 18, 2013, 5:55:40 AM5/18/13
to bots...@googlegroups.com
yes, should work if you include the namespace.

kind regards,
henk-jan

Harold DeWayne

unread,
May 18, 2013, 6:24:22 AM5/18/13
to bots...@googlegroups.com
THANK YOU.  I just realized that I had left the namespace (pfx+) off the queries.   Fixed that and it works like a charm.


    QUERIES:{
        'frompartner':  {'BOTSID':pfx+'RailBilling',pfx+'RailBilling__sender':None},
        'topartner':    {'BOTSID':pfx+'RailBilling',pfx+'RailBilling__receiver':None},
        'cntrl':        {'BOTSID':pfx+'RailBilling',pfx+'RailBilling__cntrl':None},
        },


Harold.
Reply all
Reply to author
Forward
0 new messages