Author |
Message
|
DELLIPIZ |
Posted: Tue Dec 21, 2004 11:51 am Post subject: Saving MQMD.MsgId within an MRM. |
|
|
Acolyte
Joined: 08 Oct 2003 Posts: 70
|
Hi,
I have a field MESSAGEID in my MRM that I want to use to store the MQMD.MsgID. Then in another seperate flow, I want to set my MQMD.CorrelId to that MESSAGID.
When I try the first part with:
SET OutputRoot.MRM.MESSAGEID = InputRoot.MQMD.MsgId;
I get the following error:
CWF Internal Error</DESCRIPTN><DETAIL><INSERTS>1=Invalid logical type for string physical type., 2=MESSAGEID, 3=2
Any suggestions for this????
Thanks!
-Lori |
|
Back to top |
|
 |
JT |
Posted: Tue Dec 21, 2004 12:17 pm Post subject: |
|
|
Padawan
Joined: 27 Mar 2003 Posts: 1564 Location: Hartford, CT.
|
What is the type characteristic of the MESSAGEID element, i.e. string, short, etc..?
The MQMD.MsgId is binary, so depending on the type of your MRM element, you may have to perform a CAST to move it to MRM.MESSAGEID. |
|
Back to top |
|
 |
JT |
Posted: Tue Dec 21, 2004 12:19 pm Post subject: |
|
|
Padawan
Joined: 27 Mar 2003 Posts: 1564 Location: Hartford, CT.
|
Quote: |
1=Invalid logical type for string physical type |
Just noticed the first Insert. MESSAGEID is defined as a string, so you'll have to perform the CAST. |
|
Back to top |
|
 |
DELLIPIZ |
Posted: Tue Dec 21, 2004 12:37 pm Post subject: |
|
|
Acolyte
Joined: 08 Oct 2003 Posts: 70
|
Thanks!
So I tried this:
SET OutputRoot.MRM.MESSAGEID = CAST(InputRoot.MQMD.MsgId as CHAR);
I have MESSAGEID defined as STRING 48. Since I thought that that was the max length of the MQMD.MsgID.
However, I am getting the following error:
The field length was greater than maxLen</DESCRIPTN><DETAIL><INSERTS>1=MESSAGEID, 2=REQUEST_INFO_MSG, 3=48, 4=51
What should I define that field as? Why is it 51 now?
Also, after I get that working and I go to move that MESSAGEID to the MQMD.CorrelId in another flow, is the command I need:
SET OutputRoot.MQMD.CorrelId = CAST(OutputRoot.MRM.MESSAGEID as BLOB);
???
Thanks again!
-Lori |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Dec 21, 2004 12:37 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
But Message IDs and Correlation Ids are BINARY data, not Strings. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
JT |
Posted: Tue Dec 21, 2004 12:48 pm Post subject: |
|
|
Padawan
Joined: 27 Mar 2003 Posts: 1564 Location: Hartford, CT.
|
The CAST encapsulated the msgid value with x'' (48 + 3 = 51), so try this:
Code: |
SET OutputRoot.MRM.MESSAGEID = SUBSTRING(CAST(InputRoot.MQMD.MsgId as CHAR) FROM 3 for 48); |
Quote: |
Also, after I get that working and I go to move that MESSAGEID to the MQMD.CorrelId in another flow, is the command I need:
SET OutputRoot.MQMD.CorrelId = CAST(OutputRoot.MRM.MESSAGEID as BLOB); |
Not quite. Since you'll be setting the correlation id in another message flow, and depending upon your input and output message structures, you may want to do this:
Quote: |
SET OutputRoot.MQMD.CorrelId = CAST(InputRoot.MRM.MESSAGEID as BLOB); |
|
|
Back to top |
|
 |
DELLIPIZ |
Posted: Tue Dec 21, 2004 12:49 pm Post subject: |
|
|
Acolyte
Joined: 08 Oct 2003 Posts: 70
|
It was suggested to cast it as a string. That won't work? |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Dec 21, 2004 12:53 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
It won't work to treat message Ids and correlation Ids as string data, because they can contain non-printable characters, including potentially binary 0.
This can hose up any program that is not expecting them. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
kirani |
Posted: Tue Dec 21, 2004 12:57 pm Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
If you are defining your field as CHAR then make sure your field length is greater than or equal to 48 bytes long. If you want to store X'' then it should be 51 bytes long. _________________ Kiran
IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries
|
|
Back to top |
|
 |
|