Author |
Message
|
pawel_janowski |
Posted: Thu Sep 09, 2010 2:40 am Post subject: Accessing node properties from ESQL |
|
|
Apprentice
Joined: 13 Dec 2006 Posts: 38
|
Hello!
Is it possible to get the Queue Name defined as a Output Node property from the ESQL Code f Compute Node within the same message flow?
Or maybe it is possible to get the value of the property promoted to subflow?
Any ideas.
Regars.
Pawel _________________ Pawel Janowski |
|
Back to top |
|
 |
smdavies99 |
Posted: Thu Sep 09, 2010 4:25 am Post subject: Re: Accessing node properties from ESQL |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
pawel_janowski wrote: |
Is it possible to get the Queue Name defined as a Output Node property from the ESQL Code f Compute Node within the same message flow?
Or maybe it is possible to get the value of the property promoted to subflow?
|
Yes to both.
For the ESQL Solution, it uses the OutputLocalEnvironment folder.
This is how you implement distribution lists.
The info about how to setup the data is in the docs/infocentre.
Search for
Populating Destination in the local environment tree _________________ 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 |
|
 |
pawel_janowski |
Posted: Thu Sep 09, 2010 4:38 am Post subject: Re: Accessing node properties from ESQL |
|
|
Apprentice
Joined: 13 Dec 2006 Posts: 38
|
Yes to both.
For the ESQL Solution, it uses the OutputLocalEnvironment folder.
This is how you implement distribution lists.
The info about how to setup the data is in the docs/infocentre.
Search for
Populating Destination in the local environment tree[/quote]
Yes, I know I can setup the destination queue from the ESQL and I frequently use this. But I'm interested in the name (of a queue) which was defined as the Output Node property durring the phase of development. I don't want to change it - I want to know what the queue it is.
Regards,
Pawel _________________ Pawel Janowski |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Sep 09, 2010 4:42 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Do you want to know what it is BEFORE you invoke the node, or AFTER? |
|
Back to top |
|
 |
pawel_janowski |
Posted: Thu Sep 09, 2010 5:01 am Post subject: |
|
|
Apprentice
Joined: 13 Dec 2006 Posts: 38
|
mqjeff wrote: |
Do you want to know what it is BEFORE you invoke the node, or AFTER? |
Well, truly - I promote the property 'Queue Name' of the Output Node to the subflow and set the desired value at the subflow level. Inside of this subflow I'd like to find out what is the actual value of that promoted property. I think that the actual value should be visible (somehow) inside of this subflow (as it is set BEFORE).
Regards,
Pawel _________________ Pawel Janowski |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Sep 09, 2010 5:11 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
The MQOutput node will populate WrittenDestination after it is invoked.
Regardless of whether or not it is promoted, there is no mechanism in ESQL to inquire about properties of even the Compute node executing the code, much less some random node that hasn't even been invoked yet.
That doesn't mean you can't solve your difficulty and achieve what you want using an EXTERNAL variable. This is left as an exercise.
You need to consider carefully what you are trying to do - the purpose to which you intend to put this information. If it is anything other than creating an application level log of what queue is being used, then you're probably misusing queue names. If it is an application level log of what queue is being used, then WrittenDestination is sufficient and probably a better choice. |
|
Back to top |
|
 |
pawel_janowski |
Posted: Thu Sep 09, 2010 6:40 am Post subject: |
|
|
Apprentice
Joined: 13 Dec 2006 Posts: 38
|
mqjeff wrote: |
The MQOutput node will populate WrittenDestination after it is invoked.
Regardless of whether or not it is promoted, there is no mechanism in ESQL to inquire about properties of even the Compute node executing the code, much less some random node that hasn't even been invoked yet.
That doesn't mean you can't solve your difficulty and achieve what you want using an EXTERNAL variable. This is left as an exercise.
You need to consider carefully what you are trying to do - the purpose to which you intend to put this information. If it is anything other than creating an application level log of what queue is being used, then you're probably misusing queue names. If it is an application level log of what queue is being used, then WrittenDestination is sufficient and probably a better choice. |
Of course I need this value just for some logging purposes. So the best solution seems to be implementing an user exit.
Thanks.
Pawel _________________ Pawel Janowski |
|
Back to top |
|
 |
Vitor |
Posted: Thu Sep 09, 2010 6:41 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
pawel_janowski wrote: |
So the best solution seems to be implementing an user exit. |
Yikes......  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Sep 09, 2010 7:20 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
pawel_janowski wrote: |
So the best solution seems to be implementing an user exit. |
Vitor wrote: |
Yikes......  |
If you are positive that you need to log an event "I am about to write to Queue X", then again an ESQL EXTERNAL variable that is tied to a USER DEFINED PROPERTY is the best choice.
If you merely need to log an event "I have written to Queue X" then putting a compute node after MQOutput and using WrittenDestination is the best choice. |
|
Back to top |
|
 |
llaros |
Posted: Wed Jul 13, 2011 5:35 am Post subject: |
|
|
Apprentice
Joined: 22 Jan 2008 Posts: 37
|
InputRoot.MQMD.SourceQueue |
|
Back to top |
|
 |
Vitor |
Posted: Wed Jul 13, 2011 5:45 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
llaros wrote: |
InputRoot.MQMD.SourceQueue |
a) This thread is nearly a year old so the OP's probably found a way to meet the requirement, or given up.
b) That's all very well on input, but the OP was asking about the name of the queue the MQOutput node was going to use. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
WGerstma |
Posted: Mon Jul 18, 2011 10:59 am Post subject: |
|
|
Acolyte
Joined: 18 Jul 2011 Posts: 55
|
I think, this mission cannot be accomplished. However I see a proper workaround.
Create a Userdefined Property to be accessed in your ESQL via the EXTERNAL KeyWord. Than promote your userdefined property along with the Queuename property of the Output Node to a single property on flow level.
This ensures, you always have the proper queuename accessible in your ESQL.
What I am wondering: If you need this just for logging purposes, why not doing this after the OutputNode and just get the Queuename from the WrittenDestination? |
|
Back to top |
|
 |
cutejigs |
Posted: Mon Oct 01, 2012 5:19 pm Post subject: |
|
|
Novice
Joined: 20 Jan 2010 Posts: 20
|
hi WGerstma,
came across this thread because I am facing the same challenge in my subflow, setting the LocalEnvironment.TimeoutRequest before sending the message to Timeout Control node. I have promoted the Timeout Control node property unique identifier to access it in my ESQL.
"Create a Userdefined Property to be accessed in your ESQL via the EXTERNAL KeyWord. Than promote your userdefined property along with the Queuename property of the Output Node to a single property on flow level. "
on this solution, is it possible to use a single property to be shared by both UDP and Node property? can you give instruction on how to do this?
thanks!
jigs |
|
Back to top |
|
 |
dragonMastar |
Posted: Thu May 21, 2015 3:10 am Post subject: |
|
|
Newbie
Joined: 27 Apr 2015 Posts: 9
|
Quote: |
For the ESQL Solution, it uses the OutputLocalEnvironment folder.
This is how you implement distribution lists.
The info about how to setup the data is in the docs/infocentre.
Search for
Populating Destination in the local environment tree
|
we are supposed to read "Destination list " in both the quotes right?  |
|
Back to top |
|
 |
|