Navigating message tree could be replaced by a reference (2 lines) (WMB)
Navigating the message tree can cause re-parsing of the message. By making use of a reference the code
runs faster.
There is more information available from IBM here.
For example |
SET personName = OutputRoot.XMLNSC.Request.Person.Name; SET Environment.Variables.P1.Name = OutputRoot.XMLNSC.Request.Person.Name; SET Environment.Variables.P1.Age = OutputRoot.XMLNSC.Request.Person.Age; SET Environment.Variables.P1.PostCode = OutputRoot.XMLNSC.Request.Person.PostCode; SET Environment.Variables.P1.FirstName = OutputRoot.XMLNSC.Request.Person.FirstName; SET Environment.Variables.P1.LastName = OutputRoot.XMLNSC.Request.Person.LastName; |
Preferred |
DECLARE reqRef REFERENCE TO OutputRoot.XMLNSC.Request.Person; SET personName = reqRef.Name; SET Environment.Variables.P1.Name = reqRef.Name; SET Environment.Variables.P1.Age = reqRef.Age; SET Environment.Variables.P1.PostCode = reqRef.PostCode; SET Environment.Variables.P1.FirstName = reqRef.FirstName; SET Environment.Variables.P1.LastName = reqRef.LastName; |