Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved


Chapter 5 Using the TIBCO Hawk Messaging Microagent : Specifying Field Names in Parameters

Specifying Field Names in Parameters
The fieldName attribute in an inputParameter, outputParameter, or constantParameter element can specify a single field name, nested fields, repeating fields or arrays.
The following example shows how to specify a single field name:
   <constantParameter
      name = "A first level field"
      fieldName = "STR_FIELD"
      type = "STRING"
      value = "test"
   >
   </constantParameter>
A nested field must be in the form of F1[.F2[...[.FN]]] where F1 - FN are the message field names in each nested level. For example, a message has a field NESTED_FIELD, which is another message and that message has a field L2. For a parameter corresponding to the value of the field L3 in NESTED_FIELD.L2, its fieldName attribute should be:
   <constantParameter
      name = "A nested field"
      fieldName = "NESTED_FIELD.L2.L3"
      type = "I8"
      value = "1"
      >
   </constantParameter>
If a field is a repeating field, the instance number (starting from 1) must also be specified using the notation of {instance number} appended after the field name. For example, NESTED_FIELD.L2.L3R{1} means the field L3R belongs to the first instance of the repeating field L3R of NESTED_FIELD.L2. In the second example, NESTED_FIELD.L2.L3R{2} means the field L3R belongs to the second instance of the repeating field L3R of NESTED_FIELD.L2.
   <constantParameter
      name = "First repeating field L3R in L2"
      fieldName = "NESTED_FIELD.L2.L3R{1}"
      type = "I16"
      value = "2"
   >
   </constantParameter>
   <inputParameter
      name = "Second repeating field L3R in L2"
      fieldName = "NESTED_FIELD.L2.L3R{2}"
      type = "I64"
   >
   </inputParameter>
If a field is an array, a parameter can be used to represent only one element in an array. The element index number (starting from 0) must be specified using the notation of [index number] appended after the field name. For example, NESTED_FIELD.L2.L3A[0] means the first array element in field L3A where L3A is a field of L2 and L2 is field of NESTED_FIELD. In the second example, NESTED_FIELD.L2.L3A[1] means the second array element in field L3A where L3A is a field of L2 and L2 is field of NESTED_FIELD.
   <constantParameter
      name = "First array element of L3A in L2"
      fieldName = "NESTED_FIELD.L2.L3A[0]"
      type = "U32"
      value = "4"
   >
   </constantParameter>
   <inputParameter
      name = "Second array element of L3A in L2"
      fieldName = "NESTED_FIELD.L2.L3A[1]"
      type = "U8"
   >
   </inputParameter>
Note that the type of "array of TibrvMsg" is not supported and a fieldName such as F1.F2[2].F3 is not valid. When repeating fields or array fields appear in the input or constant parameters (for sending), the sequence numbers or the index numbers must be in order that is., no skipping is allowed.
 

Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved