Author |
Message
|
KIT_INC |
Posted: Fri Apr 12, 2013 10:02 am Post subject: Get value from a message definition of another message set |
|
|
Knight
Joined: 25 Aug 2006 Posts: 589
|
I am running WMB V7 on AIX.
I have a message definition under MSGSET1 which contain a fixed value field call WarehouseNumber.
I am building a new message flow which is not using MSGSET1. But I need to get the value of WarehouseNumber from MSGSET1. I can have my new message flow referncing MSGSET1. But I am not sure how I can get the value of WarehouseNumber. |
|
Back to top |
|
 |
lancelotlinc |
Posted: Fri Apr 12, 2013 10:06 am Post subject: Re: Get value from a message definition of another message s |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
KIT_INC wrote: |
I am not sure how I can get the value of WarehouseNumber. |
Why is this different from before? Can you not reference it like you have done previously?
For example:
Code: |
SET WhNum = InputRoot.XMLNSC.WarehouseNumber; |
_________________ http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER |
|
Back to top |
|
 |
KIT_INC |
Posted: Fri Apr 12, 2013 10:31 am Post subject: |
|
|
Knight
Joined: 25 Aug 2006 Posts: 589
|
But the flow does not use MSGSET1. My InputRoot is a different message |
|
Back to top |
|
 |
lancelotlinc |
Posted: Fri Apr 12, 2013 10:40 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
KIT_INC wrote: |
But the flow does not use MSGSET1. My InputRoot is a different message |
Does that different message possess the desired element? Why not put a few Trace nodes in that demonstrate your query? Then post the results back here. _________________ http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER |
|
Back to top |
|
 |
KIT_INC |
Posted: Fri Apr 12, 2013 8:20 pm Post subject: |
|
|
Knight
Joined: 25 Aug 2006 Posts: 589
|
Let me explain my situation.
Our client send us 3 message sets
MSGSET1 contain message MSG1 which has a fixed value field called WarehouseNumber
MSGSET2 contains message MSG2
MSGSET3 contains message MSG3
We have a message flow (MF1) which use message defintion MSG2 as input and message defintion MSG3 as output. It does not use MSG1 at all.
The InputRoot of the flow is MSG2 and the outputRoot of the flow is MSG3.
Some Logic in this message flow (MF1) use value of WarehouseNumber to make decision. What we are doing now is read (by human eye) the WarehouseNumber from MSG1 and hardcoded that in MF1. The problem is when our client send us an Update of MSG1 which changed the value of WarehouseNumber, we have to remember to change the ESQL in the MF1.
What we like to do is to see if there is a way to get the value of WarehouseNumber while we are executing the message flow MF1.If we can do it, we will change the logic of MF1 to get the value instead of hard code. Then all we have to do is to re-deploy MF1 with the updated MSGSET1/MSG1 when we get an update from our client. |
|
Back to top |
|
 |
fjb_saper |
Posted: Sun Apr 14, 2013 6:11 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
What you need is a persistency store to save the value of warehousenumber. You then need to define it as a shared variable in flow1 and retrieve it from the persistency store. You need also msg1 to be an input node to flow1. Upon message receipt you change the shared variable's value and persist the new value to the persistency store....
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
KIT_INC |
Posted: Sun Apr 14, 2013 5:44 pm Post subject: |
|
|
Knight
Joined: 25 Aug 2006 Posts: 589
|
Thanks, that's a good idea.
I don't think there is anyway to bring in a field from just the message definition without bringing the message itself into the flow. |
|
Back to top |
|
 |
kimbert |
Posted: Mon Apr 15, 2013 1:19 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
I hesitate to disagree with fjb_saper, but I think a User Defined Property would be more appropriate here. The goal is to allow Flow1 and Flow2 to share a constant ( or rarely-changed) value.
The constant value happens to be the value of a 'fixed' attribute in an xsd, but that's not useful - there is no way to query a deployed model ( xsd ) to find the value of a model property. |
|
Back to top |
|
 |
KIT_INC |
Posted: Mon Apr 15, 2013 1:20 pm Post subject: |
|
|
Knight
Joined: 25 Aug 2006 Posts: 589
|
We have considered the use of UDP because it is a lot simpler. But that still involve a manual change when a new message set is shipped to us. I agreed also that should be part of the change control. But people make careless mistake from time to time. The problem is if the wrong WarehouseNumber is used, we may not know about it until days later. We were burned badly before. |
|
Back to top |
|
 |
kimbert |
Posted: Tue Apr 16, 2013 12:36 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
OK - how about this.
When you deploy the message set, do it using a script. The script reads the value of the fixed attribute from the mxsd file using one of the standard Java XML processing classes ( an mxsd is an xsd, and an xsd is XML ). Then the script uses the CMP API to set the value of the UDP. |
|
Back to top |
|
 |
|