Author |
Message
|
saviobarr |
Posted: Tue Dec 22, 2015 12:32 pm Post subject: Override UDP in a subflow |
|
|
Centurion
Joined: 21 Oct 2014 Posts: 100 Location: Sao Paulo, Brazil
|
Hi masters,
I have a subflow which has few UDPs. In the main flow, I have to override the current UDP values before the message reaches the subflow. I put a Compute node on my flow right before the subflow, and tried to set these values using ESQL, but those UDP variables does not appear in the message tree.
The knowledge center shows to do it in Java using setUserDefinedProperty() method, but I wouldn't like to use a JCN nor Java classes.
Savio Barros |
|
Back to top |
|
 |
mqjeff |
Posted: Tue Dec 22, 2015 1:25 pm Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Presumably you mean you need to set them to different values for each message that passes through, rather than to a single value that is different from the default when you deploy.
User Defined properties are accessed in ESQL through EXTERNAL variables. _________________ chmod -R ugo-wx / |
|
Back to top |
|
 |
saviobarr |
Posted: Tue Dec 22, 2015 1:51 pm Post subject: |
|
|
Centurion
Joined: 21 Oct 2014 Posts: 100 Location: Sao Paulo, Brazil
|
Presumably you mean you need to set them to different values for each message that passes through, rather than to a single value that is different from the default when you deploy.
mqjeff wrote: |
User Defined properties are accessed in ESQL through EXTERNAL variables. |
Hi mqjeff,
I am able to access it, but not to change it. I tried to set a new value, but I got the following error:
Value of constant "address" cannot be changed.
My ESQL piece of code:
CREATE COMPUTE MODULE MAIN_Compute
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
-- CALL CopyMessageHeaders();
-- CALL CopyEntireMessage();
SET address = 'TEST';
RETURN TRUE;
END;
END MODULE; |
|
Back to top |
|
 |
saviobarr |
Posted: Tue Dec 22, 2015 2:27 pm Post subject: |
|
|
Centurion
Joined: 21 Oct 2014 Posts: 100 Location: Sao Paulo, Brazil
|
|
Back to top |
|
 |
mqjeff |
Posted: Wed Dec 23, 2015 6:25 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Well done! And thanks for sharing the resolution!
 _________________ chmod -R ugo-wx / |
|
Back to top |
|
 |
whiting |
Posted: Wed Dec 23, 2015 9:41 am Post subject: Environment variable |
|
|
Acolyte
Joined: 26 Mar 2002 Posts: 64 Location: Greenville, SC
|
Given your description of what you want to do, you might try a variable in the environment tree.
You can set it in the parent message flow and access it in the subflow.
i.e. in the parent message flow:
Code: |
SET Environment.Variables.decisionKey = 'HIGH';
in the subflow:
-- Or whatever logic you want to apply here
IF Environment.Variables.decisionKey = 'HIGH' THEN
SET OutputRoot.XMLNSC.myMessage.quantity = 1;
ELSE
SET OutputRoot.XMLNSC.myMessage.quantity = 10;
END IF; |
|
|
Back to top |
|
 |
|