Mapper
An activity has access to the output data from the flow trigger in addition to any activity that has been previously executed in the flow provided that the trigger or activity has an output. You can map the fields from the output of the trigger or a preceding activity to the input data field of a subsequent activity in the same flow. Activities also have access to the flow input fields specified in the Flow Inputs and Outputs tab. This lets you pass data between activities in a flow.
When configuring an activity, trigger, or the flow inputs and outputs, you enter the input schema or the output schema to use in the Input Settings or Output Settings tab respectively. The elements in this schema display in a tree format in the Input or Output tab respectively. Use the mapper to map these elements to data from preceding activities, trigger, or the flow itself. To access the mapper, click an activity in the flow to open its configuration area. To map an element, click the element in the schema tree which opens the mapper for that element in the right pane. The mapper displays the output data from the preceding activities, trigger, and the flow that you can use to map to the selected field. Both the mapping and the mapped fields must be of compatible type. Activity fields can also be mapped to the flow input fields defined in the Flow Inputs & Outputs tab.
The following image shows the different areas of the mapper:
- The left most pane displays the tabs that you use to configure the activity. Clicking a tab opens the configuration area related to that tab.
- The pane next to the tabs pane displays the input tree for the elements in the current activity that can be mapped to the output of a preceding activity, trigger, or flow input.
- The third pane displays the mapper with the flow input, or the output from preceding activities or the trigger. The output is organized in a tree format where each node represents a scope. See Scopes in Flogo Enterprise Mapper section for details on each scope. One or more of the following scopes are displayed depending on the location of your activity within the flow:
- Pane #4 displays the functions that are available for you to use when mapping an element. You can use these functions in conjunction with an output element. For example, string.concat(str1, str2) where you can replace str1 and str2 with either manually entered strings or type string elements from an output tree displayed in the output pane of the Mapper(see #3 above).
- The editor pane allows you to either type in a value for the input element manually or if you have mapped an input element to the output of a previous activity, trigger, or flow input, the mapped expression is displayed in the editor. If the expression you entered or mapped is unsupported, you will see a validation error pop up when you hover your mouse cursor over the expression.
- Literal values - Literal values can be strings or numeric values. These values can either be manually typed in or mapped to a value from the output of the trigger or a preceding activity in the same flow. To specify a string, enclose the string in double quotes. To specify a number, type the number into the text box for the field. Constants and literal values can also be used as input to functions and expressions.
- Direct mapping of a field in the Input tab to a field of the same type that appears in the output of the trigger or any previous activities in the flow
- Mapping using functions - The mapper provides commonly used functions that you can use in conjunction with the data to be mapped. The functions are categorized into groups. Click a function to use its output in your input data. When you use a function, placeholders are displayed for the function parameters. You click a placeholder parameter within the function, then click an element from the schema tree which replaces the placeholder. Functions are placed into the following categories:
- Expressions - You can enter an expression whose evaluated value will be mapped to the input field
- A single element from the input to another single element in the output array.
- An array of primitive data type to another array of primitive data type.
When mapping an array of primitive data type, you only need to map the array root. The array elements get automatically mapped.
- An array of non-primitive data types (object data type or array data type) to another array of the same non-primitive data type.
When mapping an array of non-primitive data type, you must first map the root array, then in addition map each element within the non-primitive data type individually too.
- For elements that are objects, mapping is supported at both the element (property) level and the root level. When mapping at the root level, you can manually enter a schema in the mapper. The element names and types of this schema must match the element name and type of the object you are mapping. You can either map at the element level or at the root level of the object but if you choose to map at the root level, you cannot override the mapping for a single element within the object.
- When configuring an object, you don't necessarily need to have a literal value for an element within the object. You can use an expression as the element value where the expression gets evaluated in the context during runtime.
See the Using the Mapper topic for detailed info on how to use the mapper.
This section contains the following topics:
- Using the Mapper
The mapper opens when you click any element in the schema tree that needs to be mapped.