ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » how to model the message

Post new topic  Reply to topic Goto page 1, 2  Next
 how to model the message « View previous topic :: View next topic » 
Author Message
PRKUMAR
PostPosted: Fri Nov 09, 2012 12:13 am    Post subject: how to model the message Reply with quote

Apprentice

Joined: 04 Sep 2012
Posts: 36

Hi,
I am getting a file with below records structure:

file header - (fixed length record , occur only once in the file)
order (occurs multiple times, each order contains one order header and multiple order items)

It means:
File header (occurs once) cardinality 1-1
order (occurs multiple times) cardinality 1 to many
order header(occurs once) cardinality 1-1
order items(occurs 10 times) cardinality 1-10

Each record is delimited by newline

How to model a message set with this type of file structure?
Back to top
View user's profile Send private message
Esa
PostPosted: Fri Nov 09, 2012 12:40 am    Post subject: Reply with quote

Grand Master

Joined: 22 May 2008
Posts: 1387
Location: Finland

I think you should read what the InforCenter says about data patterns for TDS messages.
Back to top
View user's profile Send private message
smdavies99
PostPosted: Fri Nov 09, 2012 12:55 am    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

The structure you have shown is pretty common. There has been a good deal of discussion about this type of message here over the years.
Have you searched for similar posts?
Have you tried any of the suggestions?
Failing that,
Some of my esteemed colleagues here would be willing to model it for you but it would cost $$$,Yen,££££ etc. Rates start at $400 per day (plus expenses).
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
kimbert
PostPosted: Fri Nov 09, 2012 1:24 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

You cannot expect any useful answer based on that information. Please supply the following information:
- version of WMB
- example input message
- snippet of xsd showing the logical structure that you need
- full details on how the parser should recognise each type of record. This is very important.

Please put the example message and the xsd snippet in [c o d e] tags. The button is just above the edit window.

@Esa: You may be correct about using TDS and data patterns, but we don't yet know enough about the format to be sure.
Back to top
View user's profile Send private message
PRKUMAR
PostPosted: Fri Nov 09, 2012 1:55 am    Post subject: Reply with quote

Apprentice

Joined: 04 Sep 2012
Posts: 36

Version of MB is 6.1
Example of input message:
Code:

ARTDEB V3   PSMED001 PLAQ_ghi                                                                                                                                                                                           
                 1TES9505  CHOTixier Gregory      PLO CNO2  51376     041120120212201205112012        CPV/UE/VO - UCT                                             PLACE DES CARMES DECFP11250                       18121
70951508    1    CTES9505010002                  022667                                   E2                (E MAJUSCULE)  02 03010 -S E2 (E MINUSCULE)                                                             1   1
                 1TES9505  CHOTixier Gregory      PLO CNO2  51376     041120120212201205112012        CPV/UE/VO - UCT                                             PLACE DES CARMES DECFP11250                       18121
70951508    1    CTES9505010002                  022667                                   E2                (E MAJUSCULE)  02 03010 -S E2 (E MINUSCULE)                                                             1   1
70951508    1    CTES9505010002                  022667                                   E2                (E MAJUSCULE)  02 03010 -S E2 (E MINUSCULE)                                                             1   1



The XSD snippet is as below:
Code:

<?xml version="1.0" encoding="iso-8859-1"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
   targetNamespace="http://www.michelin.com/schemas/technicalcomponent/eai/v1_0/PLQ_PLQV_New_Orders" xmlns:plq="http://www.michelin.com/PLQ">
   <xsd:element name="Orders">
      <xsd:complexType>
         <xsd:sequence>
            <xsd:element name="Order" type="plq:Order" minOccurs="0" maxOccurs="unbounded"/>
         </xsd:sequence>
         <xsd:attribute name="type" type="plq:String5" use="required" />
         <xsd:attribute name="siteCode" type="plq:String5" use="required" />
          <xsd:attribute name="siteActivity" type="plq:String8" use="required" />         
      </xsd:complexType>
   </xsd:element>
   <!-- Basic types -->
   <xsd:simpleType name="String1">
      <xs:restriction base="xs:string">
        <xs:minLength value="1" />
        <xs:maxLength value="1" />
      </xs:restriction>
   </xsd:simpleType>   
   <xsd:simpleType name="String3">
      <xs:restriction base="xs:string">
        <xs:minLength value="1" />
        <xs:maxLength value="3" />
      </xs:restriction>
   </xsd:simpleType>
   <xsd:simpleType name="String4">
      <xs:restriction base="xs:string">
        <xs:minLength value="1" />
        <xs:maxLength value="4" />
      </xs:restriction>
   </xsd:simpleType>
   <xsd:simpleType name="String5">
      <xs:restriction base="xs:string">
        <xs:minLength value="1" />
        <xs:maxLength value="5" />
      </xs:restriction>
   </xsd:simpleType>
   <xsd:simpleType name="String6">
      <xs:restriction base="xs:string">
        <xs:minLength value="1" />
        <xs:maxLength value="6" />
      </xs:restriction>
   </xsd:simpleType>
   <xsd:simpleType name="String8">
      <xs:restriction base="xs:string">
        <xs:minLength value="1" />
        <xs:maxLength value="8" />
      </xs:restriction>
   </xsd:simpleType>
   <xsd:simpleType name="String9">
      <xs:restriction base="xs:string">
        <xs:minLength value="1" />
        <xs:maxLength value="9" />
      </xs:restriction>
   </xsd:simpleType>
   <xsd:simpleType name="String10">
      <xs:restriction base="xs:string">
        <xs:minLength value="1" />
        <xs:maxLength value="10" />
      </xs:restriction>
   </xsd:simpleType>
   <xsd:simpleType name="String12">
      <xs:restriction base="xs:string">
        <xs:minLength value="1" />
        <xs:maxLength value="12" />
      </xs:restriction>
   </xsd:simpleType>
   <xsd:simpleType name="String20">
      <xs:restriction base="xs:string">
        <xs:minLength value="1" />
        <xs:maxLength value="20" />
      </xs:restriction>
   </xsd:simpleType>
   <xsd:simpleType name="String40">
      <xs:restriction base="xs:string">
        <xs:minLength value="1" />
        <xs:maxLength value="40" />
      </xs:restriction>
   </xsd:simpleType>
   <xsd:simpleType name="String45">
      <xs:restriction base="xs:string">
        <xs:minLength value="1" />
        <xs:maxLength value="45" />
      </xs:restriction>
   </xsd:simpleType>
   <xsd:simpleType name="Integer2">
      <xs:restriction base="xs:integer">
        <xs:minLength value="1" />
        <xs:maxLength value="2" />
      </xs:restriction>
   </xsd:simpleType>
   <xsd:simpleType name="Integer4">
      <xs:restriction base="xs:integer">
        <xs:minLength value="1" />
        <xs:maxLength value="4" />
      </xs:restriction>
   </xsd:simpleType>
   <!-- Complex types -->
   <xsd:complexType name="Order">   
      <xsd:sequence>
         <xsd:element name="Header" type="plq:Header" minOccurs="1" maxOccurs="1"/>
         <xsd:element name="Line" type="plq:Line" minOccurs="1" maxOccurs="10"/>
      </xsd:sequence>   
   </xsd:complexType>
   <xsd:complexType name="Header">   
      <xsd:sequence>
         <xsd:element name="Sender" type="plq:String20" minOccurs="1" maxOccurs="1"/>
         <xsd:element name="Service" type="plq:String10" minOccurs="1" maxOccurs="1"/>
         <xsd:element name="Phone" type="plq:String10" minOccurs="1" maxOccurs="1"/>
         <xsd:element name="Receiver" type="plq:String20" minOccurs="1" maxOccurs="1"/>
         <xsd:element name="Comments" type="plq:String40" minOccurs="1" maxOccurs="1"/>
         <xsd:element name="Delivery" type="plq:String20" minOccurs="1" maxOccurs="1"/>
      </xsd:sequence>   
      <xsd:attribute name="status" type="plq:String1" use="required" />
      <xsd:attribute name="orderCode" type="plq:String3" use="required" />
      <xsd:attribute name="orderNumber" type="plq:String5" use="required" />
      <xsd:attribute name="up" type="plq:String3" use="required" />
      <xsd:attribute name="orderDate" type="plq:String8" use="required" />
      <xsd:attribute name="delayDate" type="plq:String8" use="required" />
      <xsd:attribute name="sentDate" type="plq:String8" use="required" />
      <xsd:attribute name="closeDate" type="plq:String8" use="required" />
      <xsd:attribute name="userName" type="plq:String12" use="required" />
      <xsd:attribute name="siteSection" type="plq:String12" use="required" />
      <xsd:attribute name="ups2" type="plq:String3" use="required" />
      <xsd:attribute name="ticking" type="plq:String6" use="required" />
   </xsd:complexType>
   <xsd:complexType name="Line">   
      <xsd:sequence>
         <xsd:element name="Label" type="plq:String45" minOccurs="4" maxOccurs="4"/>
      </xsd:sequence>   
      <xsd:attribute name="design" type="plq:String5" use="required" />
      <xsd:attribute name="landmark" type="plq:String4" use="required" />
      <xsd:attribute name="index" type="plq:String3" use="required" />
      <xsd:attribute name="compif" type="plq:String5" use="required" />
      <xsd:attribute name="statusL" type="plq:String1" use="required" />
      <xsd:attribute name="orderNumber" type="plq:String7" use="required" />
      <xsd:attribute name="lineNumber" type="plq:Integer2" use="required" />
      <xsd:attribute name="quantity" type="plq:Integer4" use="required" />
      <xsd:attribute name="valid" type="plq:String1" use="required" />
      <xsd:attribute name="ticking" type="plq:String6" use="required" />
   </xsd:complexType>
</xsd:schema>


Each file contains following records:
1 file header record
n order records (each order record contains 1 order header record and 10 order line records)
FileHeade record always starts with ARTDEB
Order header record always starts with 17 blank spaces.
Order line record always start with 5digit numeric value
In the file, each record is separated by a new line.
Back to top
View user's profile Send private message
PRKUMAR
PostPosted: Fri Nov 09, 2012 4:01 am    Post subject: Reply with quote

Apprentice

Joined: 04 Sep 2012
Posts: 36

can someone please reply how to model this type of file structure ?
Back to top
View user's profile Send private message
smdavies99
PostPosted: Fri Nov 09, 2012 5:18 am    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

PRKUMAR wrote:
can someone please reply how to model this type of file structure ?


Have you given any thought whatsoever to the questions I posed in my previous post?

What have you tried? What went wrong? how do you know what went wrong?

and before someone else asks,

Have you had an formal training in the product?
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Fri Nov 09, 2012 5:49 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

The method used to model this message is to construct a message definition that accurately matches the structure of the message.

Are you having trouble constructing a message definition?

Or are you having trouble matching the structure of the message?

Or are you having trouble getting your message definition to *accurately* match the structure of the message definition?

IF you are having trouble with the first one, then you need to acquire more education and training, and we *DO NOT* provide that here.

IF you are having trouble with the second one, then you need to sit next to someone who understands the structure of this message and have them work with you as you construct the model.

IF you are having trouble with the third one, then you need to perform a process known as 'troubleshooting'. This is a basic process used in any kind of software development at all. It requires that you TEST things, CAPTURE the analysis of those tests, EXAMINE the results, and then THINK about how to fix it.

But you're simply not going to get anyone here to provide you with an MXSD file that you can import into your toolkit. So give up on that notion right now.
Back to top
View user's profile Send private message
Esa
PostPosted: Fri Nov 09, 2012 6:06 am    Post subject: Reply with quote

Grand Master

Joined: 22 May 2008
Posts: 1387
Location: Finland

kimbert wrote:

@Esa: You may be correct about using TDS and data patterns, but we don't yet know enough about the format to be sure.


I agree, we don't know enough. But that does not change the fact that the OP should read the InfoCenter.
Back to top
View user's profile Send private message
PRKUMAR
PostPosted: Fri Nov 09, 2012 11:07 am    Post subject: Reply with quote

Apprentice

Joined: 04 Sep 2012
Posts: 36

I am facing problem in constructing the message definition.
I have tried creating message definition like this:
For FileHeader, OrderHeader and OrderLine complex elements, I have given group terminator as <CR><LF>. For OrderLine element, I have set minoccurs =1 and maxoccurs = 10 and also for each Order(it contains 1 orderheader and n orderLine elements) element I have set cardinality as min=1 and max=unbounded.
When I try to parse a message with 1 file header, 1 order( having only one OrderHeader and One OrderLine elements). I am getting error as "not enough data in the bitstream for OrderLine(2) record.
Back to top
View user's profile Send private message
PRKUMAR
PostPosted: Mon Nov 12, 2012 2:47 am    Post subject: Reply with quote

Apprentice

Joined: 04 Sep 2012
Posts: 36

the file structure is like below:


File header (1 time)
Order (n times)

Order header ( 1 time)
Oder Line(n times)

I have created the TDS message definition as below:

Msg_1 (Data Element Separation: Use Data Pattern)
FILE_HEADER ( Data Element Separation: Fixed Length, Data Pattern: A.*\r\n, Group Terminator: <CR><LF>)
ORDER (Data Element Separation: Use Data Pattern, Data Pattern: +(space and +))

ORDER_HEADER ( Data Element Separation: Fixed Length, Data Pattern: +(space and +), Group Terminator: <CR><LF>)
LINE_HEADER ( Data Element Separation: Fixed Length, Data Pattern: [0-9], Group Terminator: <CR><LF>)



Example of input message:
ARTEB………. -> (FILE HEADER)
DSDDK DS SD KFDS IDFI -> (ORDER HEADER WHICH IS STARTING WITH 17SPACES)
123 DFKSDFIDS DS DI -> (ORDER LINE 1)
345 DSIDID S -> (ORDER LINE2)
EIFMDISDID D I -> (ORDER HEADER WHICH IS STARTING WITH 17SPACES)
433DFJSDI DFDSI -> (ORDER LINE 1)
988MEIDMD DID -> (ORDER LINE 2)


I am getting error as “not enough data in bitstream’.
Please let me know which properties do I need to set/updated.
Back to top
View user's profile Send private message
Esa
PostPosted: Mon Nov 12, 2012 3:37 am    Post subject: Reply with quote

Grand Master

Joined: 22 May 2008
Posts: 1387
Location: Finland

PRKUMAR wrote:

LINE_HEADER ( Data Element Separation: Fixed Length, Data Pattern: [0-9], Group Terminator: <CR><LF>)

...

433DFJSDI DFDSI -> (ORDER LINE 1)
988MEIDMD DID -> (ORDER LINE 2)


I am getting error as “not enough data in bitstream’.


The second line seems a bit shorter that the first, but I guess it's padded with spaces?

I bet there is no linebreak after the last record, in which case you should use something else than a group terminator...
Back to top
View user's profile Send private message
kimbert
PostPosted: Mon Nov 12, 2012 3:42 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

@PRKUMAR: There is a standard way to diagnose TDS modeling problems.
- Disconnect the debugger
- Insert Trace nodes into the flow
- Take a debug-level user trace ( mqsichangetrace etc )
- Read the trace carefully - the TDS parser will emit a lot of useful information.
Back to top
View user's profile Send private message
mayheminMQ
PostPosted: Mon Nov 12, 2012 7:50 am    Post subject: Reply with quote

Voyager

Joined: 04 Sep 2012
Posts: 77
Location: UK beyond the meadows of RocknRoll

One thing from the top of the head is..

With the input you have, the definition of your msgset would be 1-10 for Order and Order Lines. You have not defined any other separator for the records apart from just CRLF.

This will lead to 10 lines following the first line to sit in the order field. You will need to find a way to differentiate the records with something else apart from just CRLF as the message set has no other way of understanding your message.

Your error in layman terms means, there are still mandatory fields in your message that havent got any data in because they are sitting in fields above this field.

You will have see the message in debug mode. ( Click the nice green bug in your toolbar)
_________________
A Colorblind man may appear disadvantaged but he always sees more than just colors...
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Nov 12, 2012 10:44 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

mayheminMQ wrote:
You will have see the message in debug mode. ( Click the nice green bug in your toolbar)


Absolutely not!

The debugger tells you what happened, not why!

The advice given by @kimbert is the correct way forward. The debugger will not be much help in this, especially not as much help as a trace.

Unless you have a new and interesting way of using the debugger you'd care to share?
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » how to model the message
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.