Author |
Message
|
LH33 |
Posted: Thu Jun 05, 2003 10:34 am Post subject: Help in Setting Destination Labels |
|
|
Master
Joined: 21 Nov 2002 Posts: 200
|
I have a requirement to set Destination Lables for Route To Label processing. I want to set the Label Names equal to the first verb in the XML. For Example, I will be getting XML with 3 different verbs:
<CreateJob revision="1.0.0" environment="Test" >
(rest of XML message)
<ChangeJob revision="1.0.0" environment="Test" >
(rest of XML message)
<CloseJob revision="1.0.0" environment="Test" >
(rest of XML message)
Can someone help me with the code to set the DestinationData[2]. Here is my current code:
SET OutputRoot = InputRoot;
-- Enter SQL below this line. SQL above this line might be regenerated, causing any modifications to be lost.
SET OutputLocalEnvironment.Destination.RouterList.DestinationData[1].labelname = 'CompleteFlow';
SET OutputLocalEnvironment.Destination.RouterList.DestinationData[2].labelname = "InputRoot.XML.*[1]";
I want the DestinationData[2].labelname to be equal to the Highlighted verb shown above. Thanks for any help!! |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Jun 05, 2003 1:43 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Code: |
SET OutputLocalEnvironment.Destination.RouterList.DestinationData[2].labelname = InputRoot.XML.*[1] NAME |
Notice I took the quotes out, as they don't really add any value, and notice that I specified NAME after the field reference. That says 'take the name of the field, not it's value'.
This may not work in 2.0 versions. |
|
Back to top |
|
 |
LH33 |
Posted: Fri Jun 06, 2003 5:23 am Post subject: |
|
|
Master
Joined: 21 Nov 2002 Posts: 200
|
Jeff,
Thank you so much!! Have a good one!! |
|
Back to top |
|
 |
LH33 |
Posted: Fri Jun 06, 2003 7:44 am Post subject: |
|
|
Master
Joined: 21 Nov 2002 Posts: 200
|
Jeff or anyone,
I put this code in and I am getting a syntax error:
SET OutputLocalEnvironment.Destination.RouterList.DestinationData[2].labelname = InputRoot.XML.*[1] NAME;
When I use quotes around it I get a BIP4240 error.
Can someone help with the syntax? |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Jun 06, 2003 9:08 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Are you looking to put quotes around the name of the tag inside the label? So that the label is "<double-quote><tag name><double-quote>"?
Or are you trying to do
Code: |
SET OutputLocalEnvironment.Destination.RouterList.DestinationData[2].labelname = "InputRoot"."XML".*[1] NAME; |
?
Cause you don't need to do the later. Of course, I can't think of a good reason for doing the former, either - as putting them into the label means you have to retype them when you assign the property on the Label Node. BUT, if you wanted to do the former, then
Code: |
SET OutputLocalEnvironment.Destination.RouterList.DestinationData[2].labelname = '"'||InputRoot.XML.*[1] NAME||'"'; |
.
You may have to cast the name part as a character first.
And again, when you put your tag name into the property of your label node, you'll have to include the quotes for this to work. Otherwise you'll get an unknown label error at the RouteToLabel node. |
|
Back to top |
|
 |
LH33 |
Posted: Fri Jun 06, 2003 9:13 am Post subject: |
|
|
Master
Joined: 21 Nov 2002 Posts: 200
|
Jeff,
Thanks a lot for your help. I actually used the following code and it worked:
SET OutputLocalEnvironment.Destination.RouterList.DestinationData[2].labelname = FIELDNAME(InputRoot.XML.*[1]);
Thanks!! Lisa |
|
Back to top |
|
 |
|