Author |
Message
|
IntegratorWMB |
Posted: Thu Sep 11, 2008 6:42 am Post subject: Global and Local Element - Usage |
|
|
Apprentice
Joined: 06 Dec 2007 Posts: 27
|
In an ANSI X12 message set ., you have element# with some simple restriction. e.g. EL350 - length of 11 chars and atleast 1 char must present.
A segment can contain one (or) more of EL350 elements.
A message contains more than one segment.
Currently WMB developers in our company had created EL350 as a global element and it is used at various part of the message.
I asked them to make EL350 as a type and then create a local element of that type with a unique name on each segment wherever it is used. Also they dont have a definite answer for what happens if a segment contain more than one EL350 element (if it is defined global).
My understanding can be wrong. But In a case like this what would you prefer ...define EL350 as a type and create local reference (or) a global element and create a reference.
Thanks |
|
Back to top |
|
 |
kimbert |
Posted: Thu Sep 11, 2008 11:08 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
I asked them to make EL350 as a type and then create a local element of that type with a unique name on each segment wherever it is used. |
What are your reasons? What's wrong with using a reference to a global element?
Quote: |
Also they dont have a definite answer for what happens if a segment contain more than one EL350 element (if it is defined global). |
Why not set maxOccurs on the element reference? |
|
Back to top |
|
 |
IntegratorWMB |
Posted: Thu Sep 11, 2008 11:48 am Post subject: |
|
|
Apprentice
Joined: 06 Dec 2007 Posts: 27
|
Thanks for your reply.
As mentioned my understanding of global element and user defining a type in message broker is limited.
I will give an example:
One of the X12 segment contains 4 Elements.
Element Name : TDS01 and Element Type: EL610
Element Name : TDS02 and Element Type : EL610
Element Name : TDS03 and Element Type : EL610
Element Name : TDS04 and Element Type : EL610
Note: EL610 is nothing but a string with max len = 15 chars and min len = 1 char.
and an example X12 message for that segment looks like:
TDS*48510*45672*112323*1132
When trying to capture this in the message set, we are having one GlobalElement EL610 and created a complexType TDSData to which we had added 4 EL610 as a reference.
My question for the incoming message if I want to get those values how will I do?
Message.TDSData.EL610 = ? and how can I access all the values.
Thanks |
|
Back to top |
|
 |
IntegratorWMB |
Posted: Thu Sep 11, 2008 11:51 am Post subject: |
|
|
Apprentice
Joined: 06 Dec 2007 Posts: 27
|
Hence I thought having EL610 as a type and define 4 local Elements in TDSData say TDSData01 with EL610 as its type etc., Then I can access the value say
InputMessage.TDSData.TDSData01 etc.,
Thanks |
|
Back to top |
|
 |
kimbert |
Posted: Thu Sep 11, 2008 1:59 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Aha! So the published standard gives these elements different names. In that case, you should do the same in your logical message definition. So I agree with your suggestion - create a global complex type and 4 local elements which refer to it. |
|
Back to top |
|
 |
|