Author |
Message
|
akir |
Posted: Tue Apr 01, 2008 6:12 am Post subject: Runtime Manipulation of Message Set using ESQL |
|
|
 Acolyte
Joined: 28 Jun 2007 Posts: 51
|
Hello All,
I need to manipulate the Message Set and change its default values in runtime using ESQL Code.
Ex:like setting the Max Occurs of an Element in a Message.
Can anybody help me in this regard. _________________ Thanks and Regards,
Akir
Tell everyone what you want to do and someone will want to help you do it.-W. Clement Stone |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Apr 01, 2008 6:58 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
You can't do this.
You can't manipulate message sets at all in runtime. From ESQL or anything else. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
jonasb |
Posted: Tue Apr 01, 2008 9:09 am Post subject: |
|
|
Apprentice
Joined: 20 Dec 2006 Posts: 49 Location: Sweden
|
Just set maxOccurs high enough (e.g. -1 = unbounded) in the message set and enforce any special runtime rules (I'm guessing message data dependant rules) in a java or ESQL-node. _________________ contact admin |
|
Back to top |
|
 |
kimbert |
Posted: Wed Apr 02, 2008 4:35 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
Just set maxOccurs high enough (e.g. -1 = unbounded) in the message set and enforce any special runtime rules |
That may be the correct approach. Or maybe it's the wrong approach. Nobody knows, because we don't know what the problem is yet.
akir : Your message model cannot and must not change. It is intended to describe the messages which your message flow is processing. If it is not doing that properly, either change the message definition or create one or more alternative message definitions and select the appropriate one in your message flow logic. If you want further help, you'll have to tell us what you're trying to do. |
|
Back to top |
|
 |
akir |
Posted: Wed Apr 02, 2008 8:52 am Post subject: |
|
|
 Acolyte
Joined: 28 Jun 2007 Posts: 51
|
contact admin wrote: |
enforce any special runtime rules |
Can you help me do that.I think it is not possible. _________________ Thanks and Regards,
Akir
Tell everyone what you want to do and someone will want to help you do it.-W. Clement Stone |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Apr 02, 2008 8:59 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
kimbert wrote: |
If you want further help, you'll have to tell us what you're trying to do. |
_________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
akir |
Posted: Wed Apr 02, 2008 9:15 am Post subject: |
|
|
 Acolyte
Joined: 28 Jun 2007 Posts: 51
|
jefflowrey wrote: |
kimbert wrote: |
If you want further help, you'll have to tell us what you're trying to do. |
|
Please check out the Link where I have described the same.
http://mqseries.net/phpBB2/viewtopic.php?t=42565&sid=82db5010177cc1a91cb9135a90c08eb6 _________________ Thanks and Regards,
Akir
Tell everyone what you want to do and someone will want to help you do it.-W. Clement Stone
Last edited by akir on Wed Apr 02, 2008 9:18 am; edited 1 time in total |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Apr 02, 2008 9:17 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
And?
You didn't like the factual answer you were given? _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
akir |
Posted: Wed Apr 02, 2008 9:27 am Post subject: |
|
|
 Acolyte
Joined: 28 Jun 2007 Posts: 51
|
I have designed a COBOL file with keywords "occurs depending on" a virtual field named ITEM-COUNT.
Code: |
DETAILS OCCCURS 1 TO 999999 TIMES DEPENDING ON ITEM-COUNT |
Generated Message Set using that.
Its value is dynamically set using ESQL based on the Input Items Count.
After its purpose is solved, I am removing it from the Output using SubString Function.
Code: |
SET cInputBody = CAST(BITSTREAM(InputBody) AS CHARACTER CCSID InputRoot.Properties.CodedCharSetId);
SET cOutputBody = CAST( (SUBSTRING(cInputBody FROM 1 FOR 166) || SUBSTRING(cInputBody FROM 174 FOR (LENGTH(cInputBody) - 173)) )AS BLOB CCSID InputRoot.Properties.CodedCharSetId);
SET OutputRoot.BLOB.BLOB = cOutputBody;
|
_________________ Thanks and Regards,
Akir
Tell everyone what you want to do and someone will want to help you do it.-W. Clement Stone |
|
Back to top |
|
 |
kimbert |
Posted: Wed Apr 02, 2008 11:01 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Hi akir,
The magic numbers 166 and 174 are a feature of the physical format of the input message. Having physical format information in your message flow.is not a good idea.
In your other thread I offered these options:
Quote: |
a) If the repeating structure is the final structure in the message, then you can set maxOccurs to -1 ( i.e. unbounded ).
b) Otherwise, you must use OCCURS DEPENDING ON, as wbi_telecom suggests. |
Why did you not take option a)? Please answer by posting a description of your message structure. |
|
Back to top |
|
 |
akir |
Posted: Wed Apr 02, 2008 1:04 pm Post subject: |
|
|
 Acolyte
Joined: 28 Jun 2007 Posts: 51
|
kimbert wrote: |
Why did you not take option a)? |
My Message Structure is of the Format
HEADER[1]
DETAILS[N]
TRAILER[1]
When I am placing N cardinality as -1 for DETAILS for CWF Message Set and since I am using Left Pad with Space in the Message Set,the flow keeps on running filling on the rest of the DETAILS which are not populated with Space.Thus we are encountering a infinite loop. _________________ Thanks and Regards,
Akir
Tell everyone what you want to do and someone will want to help you do it.-W. Clement Stone |
|
Back to top |
|
 |
kimbert |
Posted: Wed Apr 02, 2008 2:38 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
So the receiving application has to do arithmetic involving the size of the message and the size of the DETAILS record in order to work out how many occurrences of DETAILS there are
I suppose it's pointless to ask who designed the message format. You probably can't change it anyway.
You could try putting the ITEM-COUNT field as the first field in the message. That would make it easier ( and a tiny bit faster ) to remove it.
Alternatively, you could move TRAILER into a separate message definition. That would make DETAILS the last structure in the message. You could then serialize HEADER and DETAILS into one BLOB, serialize TRAILER into another, and join the two. On balance, it's probably easier to take my first option. |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Apr 02, 2008 6:35 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
The last time I had to deal with this kind of problem, where I had what should have been straight forward Tagged Fixed-Length data (header, details and trailer were all tagged!) except for the packed decimal fields...
I ended up creating a "fake" occurs depending on for the details, which was only used for purposes of parsing the data with MRM.
However, this was also in version 2.1
In v6.1, I should be able to parse this format in TDS directly.
So, Akir should strongly consider if his/her data is actually tagged or delimited in some way, such that MRM can distinguish between the last Details and the Trailer. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
akir |
Posted: Thu Apr 03, 2008 5:16 am Post subject: |
|
|
 Acolyte
Joined: 28 Jun 2007 Posts: 51
|
If I use a TDS Message Set for COBOL File it is working fine.
But client is insisting on using a CWF Message Set only.
I don't know reasons. _________________ Thanks and Regards,
Akir
Tell everyone what you want to do and someone will want to help you do it.-W. Clement Stone |
|
Back to top |
|
 |
|