Search code examples
referenceibm-integration-busextended-sql

IBM Integration Bus ESQL Reference to OutputRoot not working


I have started working fairly recently with IBM Integration Bus v10.0.0.9, using their documentation on how it all works along with the ESQL syntax and tips.

According to this they recommend using references to access message trees so as to not make so many navigations. They even show how to use reference variables here for the OutputRoot message tree.

Knowing this, I have been trying to do the following in a ComputeNode:

-- ComputeNode MRM Writer
DECLARE refPointer REFERENCE TO OutputRoot.MRM.PARENT_NODE;
SET refPointer.CHILD_NODE = 'Some value';

In theory, this should be equivalent to:

SET OutputRoot.MRM.PARENT_NODE.CHILD_NODE = 'Some value';

However, when trying to reach the value on the next ComputeNode I find that it's null:

-- ComputeNode MRM Reader
DECLARE someValue CHARACTER InputRoot.MRM.PARENT_NODE.CHILD_NODE;

I have tried to use CREATE LASTCHILD OF OutputRoot.MRM DOMAIN 'MRM' NAME 'PARENT_NODE'; and then trying the reference but still gives a null value. And I know that the problem is from using the reference for when I use the full path the value is present. I also know that the references do work because I am using a reference variable to obtain values from the InputRoot message tree.

What can I do to make the reference work? Or is it not possible to use them for some domains and if so which ones?

EDIT

I have noted that this problem is general and it occurs even with a regular OutputRoot.XMLNSC reference. So the problem isn't really with the MRM domain but with the references themselves. I also noted that if I set an environment vatriable to the reference and then set the OutputRoot.MRM to the value of the environment variable it seems to work out, but it's rather redundant to do so and for some reason it sometimes fails.

-- Redundant workaround:
SET Environment.Variables.Output = refPointer;
SET OutputRoot.MRM.PARENT_NODE = Environment.Variables.Output;
SET Environment.Variables.Output = NULL;

Solution

  • You need to create a child property before assign:

    CREATE FIELD OutputRoot.MRM.PARENT_NODE TYPE NameValue VALUE 'This is my TestCase';