Using the Mapper

The mapper opens when you click any element in the schema tree that needs to be mapped.

Important: Be sure to keep the following in mind when using the mapper:
  • If the schema contains an array with only one element, the field for that element is not marked as required (does not have a red asterisk against it) in the Mapper.
  • The in and new attributes are treated as special characters if used in the schema that you enter in the REST activity or trigger. For example, mappings such as $flow.body ["in"] and $flow.body ["new"] are not supported. If an imported app contains these attributes, after the app is imported into TIBCO Cloud Integration- Flogo (PAYG), it results in runtime errors.
  • Use of anonymous array is not supported in the Flow Input & Output tab and the Return activity configurations. To map to an anonymous array, you must create a top level object or a root element and render that.
  • You can not use a resolver (identified with a beginning $ sign) in an expression, for example renderJSON($flow, true). You can use an object or element under it for example, renderJSON($flow.input, true).

You can only map one element at a time, be it an individual field or an array of primitive data types or non-primitive data types. When mapping array of primitive types, you map the array root and its containing elements will automatically get mapped. When mapping an array of non-primitive data types, you must first map the root array, then map each element of the non-primitive data type individually. For example, to map an array named Employee Records containing Employee objects that is made up of employee name, employee ID, and department, you have to first map Employee Records, then map each element of the Employee object individually.

Here is an example of what the mapper looks like.

In the example above, to map the message field in the LogMessage activity Input tab, you would need to do the following:

Procedure

  1. Click message to open the mapper in the gray box to its right.
    The mapper opens to the right with the selected field (message) displayed over a text box in which you can either manually enter a value for message or map it to an element from the output of a preceding activity or flow input element.

    In the example shown above, you can see that the output schema of the preceding activity (InvokeRESTService) as well as the flow input schema appear under Upstream Output. Function categories are displayed under Functions. You can expand any of the function categories to display the functions in that category. Clicking on a function adds the function in the text box for you to use when mapping.

  2. Expand {}InvokeRESTService > responseBodyor $flow > body.
  3. You have the option to manually type in the data in the text box or map it to one of the elements under responseBody or body.
  4. To map an element, expand body and click on the desired element. The mapping appears in the text box.

    This section covers the following topics: