|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Accessing UDP from Node Properties Directly |
« View previous topic :: View next topic » |
Author |
Message
|
ReemRashwan |
Posted: Tue Apr 27, 2021 5:41 am Post subject: Accessing UDP from Node Properties Directly |
|
|
Novice
Joined: 09 Mar 2021 Posts: 12
|
Hi,
Can we specify a UDP variable name in node properties directly? If yes, how can we achieve that?
Current scenario:
I have http request node whose 'Web service URL' changes according to environment (ex: test, prod).
What I have for now:
1. A compute node before httprequest
Code: |
DECLARE httpURL EXTERNAL CHARACTER 'http://exampleURL';
CREATE COMPUTE MODULE udpFlow_Compute2
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
SET OutputLocalEnvironment.Destination.HTTP.RequestURL = httpURL;
RETURN TRUE;
END;
END MODULE;
|
2. An HTTPRequest node with 'Web service URL' whose value is the same as httpURL.
3. The same httpURL variable defined in UDP tab with default value as empty.
---
Is there a shorter way to use UDPs?
What is the purpose of 'Mandatory' option in UDP tab if am supposed to specify and initial value anyway in ESQL in order to use that udp for other nodes? |
|
Back to top |
|
 |
abhi_thri |
Posted: Tue Apr 27, 2021 11:17 am Post subject: Re: Accessing UDP from Node Properties Directly |
|
|
 Knight
Joined: 17 Jul 2017 Posts: 516 Location: UK
|
ReemRashwan wrote: |
Hi,
Can we specify a UDP variable name in node properties directly? If yes, how can we achieve that?
|
hi...UPD is defined at a flow level only, as long as it is defined at the schema level scope and not within a specific node level it should be accessible from multiple nodes but not sure what is the relevance for your scenario as you are only accessing it from a single Compute node before the httprequest.
ReemRashwan wrote: |
2. An HTTPRequest node with 'Web service URL' whose value is the same as httpURL.
3. The same httpURL variable defined in UDP tab with default value as empty.
---
Is there a shorter way to use UDPs? |
Yes, this sounds fine...the HTTPRequest node 'Web service URL' and the UPD values at ESQL and flow level can hold a dummy value which you can then later override via BAR overide or so which will vary per environment.
ReemRashwan wrote: |
What is the purpose of 'Mandatory' option in UDP tab if am supposed to specify and initial value anyway in ESQL in order to use that udp for other nodes? |
hmmm...don't think it is necessary to initialise any value at ESQL level but it is a good practice, for eg:- you can see spot the value from ESQL if the value was not overridden for some reason. The actual value which will get used will depend on the prcedence order...see this topic https://www.ibm.com/docs/en/integration-bus/10.0?topic=properties-user-defined#ac00643_ |
|
Back to top |
|
 |
ReemRashwan |
Posted: Wed Apr 28, 2021 12:55 am Post subject: Re: Accessing UDP from Node Properties Directly |
|
|
Novice
Joined: 09 Mar 2021 Posts: 12
|
abhi_thri wrote: |
hi...UPD is defined at a flow level only, as long as it is defined at the schema level scope and not within a specific node level it should be accessible from multiple nodes but not sure what is the relevance for your scenario as you are only accessing it from a single Compute node before the httprequest.
|
I agree with you that UDPs are flow level variables. I don't want to restrict them to a single node, rather I want to specify them directly in any node property directly.
Example: in an HTTPRequest node 'Web service URL' property, I want to specify a udp named httpURL like this: ${udp.httpURL} (just an example, this is not going to work).
abhi_thri wrote: |
Yes, this sounds fine...the HTTPRequest node 'Web service URL' and the UPD values at ESQL and flow level can hold a dummy value which you can then later override via BAR overide or so which will vary per environment.
|
That's interesting, a dummy value instead of actual default value.
abhi_thri wrote: |
hmmm...don't think it is necessary to initialise any value at ESQL level but it is a good practice, for eg:- you can see spot the value from ESQL if the value was not overridden for some reason. The actual value which will get used will depend on the prcedence order...see this topic (I can't post links yet )
|
I tried to initialize a udp in schema level using:
Code: |
DECLARE httpURL EXTERNAL CHARACTER; |
but got the following errors:
1. If I don't specify a value in the bar file and in ESQL
Code: |
BIP4055E: (.httpURL, 1.1) : User defined attribute must specify an initial value expression.
User defined attributes must either be given an initial value on the DECLARE statement or be given a value at deploy time.
Set the value of the User Defined Attribute at deploy time.
|
2. If I specify a value in bar file but not in code:
Code: |
BIP4055E: (.httpURL, 1.1) : User defined attribute must specify an initial value expression.
|
While in both scenarios the udp wasn't set as mandatory. If I specify any value in the code, the problem is solved.
Any ideas why 2 didn't work? |
|
Back to top |
|
 |
abhi_thri |
Posted: Sat May 01, 2021 12:32 am Post subject: Re: Accessing UDP from Node Properties Directly |
|
|
 Knight
Joined: 17 Jul 2017 Posts: 516 Location: UK
|
ReemRashwan wrote: |
1. If I don't specify a value in the bar file and in ESQL
Code: |
BIP4055E: (.httpURL, 1.1) : User defined attribute must specify an initial value expression.
User defined attributes must either be given an initial value on the DECLARE statement or be given a value at deploy time.
Set the value of the User Defined Attribute at deploy time.
|
|
hi...the above is expected as the UDP needs a value at the deployment time via one of the methods (i.e at esql, or flow level, or bar file etc)
ReemRashwan wrote: |
2. If I specify a value in bar file but not in code:
Code: |
BIP4055E: (.httpURL, 1.1) : User defined attribute must specify an initial value expression.
|
While in both scenarios the udp wasn't set as mandatory. If I specify any value in the code, the problem is solved.
Any ideas why 2 didn't work? |
this is odd, so you have built the bar file and set a value for the UPD by browsing to the flow via BAR->Manage but that still failed with above error? I just crosschecked for a non-mandatory UPD at my side (v10.0.0.7) with no value set at Esql or flow level but only at the BAR file and it deployed fine...what version of IIB are you using? In anycase as I mentioned it is a good practice to set a default dummy value so that it is easier to diagnose issues in case the deployment time override failed for some reason. |
|
Back to top |
|
 |
ReemRashwan |
Posted: Tue May 04, 2021 3:43 am Post subject: Re: Accessing UDP from Node Properties Directly |
|
|
Novice
Joined: 09 Mar 2021 Posts: 12
|
abhi_thri wrote: |
hi...the above is expected as the UDP needs a value at the deployment time via one of the methods (i.e at esql, or flow level, or bar file etc)
|
Please chech following attempts.
abhi_thri wrote: |
this is odd, so you have built the bar file and set a value for the UPD by browsing to the flow via BAR->Manage but that still failed with above error?
|
Yes.
abhi_thri wrote: |
I just crosschecked for a non-mandatory UPD at my side (v10.0.0.7) with no value set at Esql or flow level but only at the BAR file and it deployed fine...
|
This didn't work for me
abhi_thri wrote: |
what version of IIB are you using?
|
Version: 10.0.0.7
abhi_thri wrote: |
In anycase as I mentioned it is a good practice to set a default dummy value so that it is easier to diagnose issues in case the deployment time override failed for some reason. |
I will do that.
Here is my attempt to better understand UDPs.
Without defining udp in ESQL:
Quote: |
Mandatory at flow without esql without specifiying value at bar -> Deployed
Mandatory at flow without esql with specifiying value at bar -> Deployed
Optional at flow without esql without specifying value at bar -> Deployed
Optional at flow without esql without specifying value at bar -> Deployed |
Anyway I think this is useless because I can't access the variable anywhere in the flow or node properties without defining it in esql first. I am right?
---------------------
With defining udp in ESQL:
Quote: |
Mandatory at flow without value in flow level without value in esql without value in bar -> BIP4055E: (.httpURL, 1.1) : User defined attribute must specify an initial value expression.
Mandatory at flow without value in flow level without value in esql with value in bar -> BIP4055E: (.httpURL, 1.1) : User defined attribute must specify an initial value expression. This is what I wanted to work, to prevent deploying applications without specifying mandatory attributes.
Mandatory at flow without value in flow level with value in esql without value in bar -> Deployed
Mandatory at flow without value in flow level with value in esql with value in bar -> Deployed
Optional at flow without value in flow level without value in esql without value in bar -> BIP4055E: (.httpURL, 1.1) : User defined attribute must specify an initial value expression.
Optional at flow without value in flow level without value in esql with value in bar -> BIP4055E: (.httpURL, 1.1) : User defined attribute must specify an initial value expression. This what worked for you
Optional at flow without value in flow level with value in esql without value in bar -> Deployed
Optional at flow without value in flow level with value in esql with value in bar -> Deployed |
Thank you in advance. |
|
Back to top |
|
 |
abhi_thri |
Posted: Tue May 04, 2021 7:14 am Post subject: Re: Accessing UDP from Node Properties Directly |
|
|
 Knight
Joined: 17 Jul 2017 Posts: 516 Location: UK
|
ReemRashwan wrote: |
Anyway I think this is useless because I can't access the variable anywhere in the flow or node properties without defining it in esql first. I am right?
|
Yes, that is correct, there is no point in defining an UPD at flow level if you are not planning to use it somehow.
Are you deploying as Source or as 'Compile and in-line resources', because there seems to be a difference in behaviour. If deploying as Source, regardless of whether the UPD is mandatory/optional the deployment works fine even if no value is set at esql/flow or at bar level.
If deploying as 'Compile and in-line resources' the deployment fails when the value is not set anywhere for both mandatory/optional scenarios, in this case the deployment only works when the value is set at some level (eg:- at Bar file).
So I think it is worth raising a PMR unless IBM has addressed this already in further fixpacks as ideally the behaviour should be consistent regardless of the deployment method used. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|