Coercing of Activity Input, Output, and Trigger Reply Fields

In the OSS marked Activity input, output, or trigger reply configuration, if you have defined a parameter, but have not defined or cannot define a schema for the parameter, you can coerce the parameter to take the value from a schema that you dynamically define during design time. This feature is particularly useful for apps that were created in Project Flogo and imported to Flogo. Such apps most likely have activities for which input parameters or output are not defined with a schema.

Currently, coercion of parameters is supported only for the following data types:

After you enter the schema, it is displayed in a tree format under Activity inputs, Output tab, or Trigger reply in the mapper. All subsequent activities also display the elements of the schema under the Activity in the Upstream Output. The schema elements are now available for you to map.

Important Considerations

To provide the schema for coercion:

    Procedure
  1. On the flow details page, click the activity or trigger to open its configuration.
  2. Click any of the following tabs that you want to configure:
    • Input: To configure a parameter in the activity input
    • Output: To configure the schema for the activity output
    • Map from Flow Outputs: To configure the trigger reply
  3. To configure a schema:
    • For a parameter in activity input, hover your mouse cursor over the parameter name for which you want to configure the schema under Activity inputs.
    • For the Activity output, hover your mouse cursor over the parameter name for which you want to configure the schema.
    • For a parameter in the trigger reply, hover your mouse cursor over the parameter name.

    Click the ellipsis icon () that is displayed next to it. Clear mappings and Coerce with schema options are displayed.

  4. Click the Coerce with schema option.
    Note: The Coerce with schema icon is displayed against the parameter name for only those parameters that do not have a schema defined on the Input Settings tab (or a schema cannot be defined because the Activity does not have an Input Settings tab, for example, the OSS-marked activities) and whose data type is one of the following: array, param, object, or any.
  5. Enter the schema for the parameter or activity output and click Apply. The mapper validates that the data type of the schema you entered matches the data type of the parameter being coerced. If the data types do not match, Apply remains disabled and you see an error. For activity input and trigger reply, the schema you enter displays in a tree format under the parameter name in the mapper.
    • For the activity output, the schema is displayed in a tree format on the Output tab of the activity. Available data displays the output of the preceding activities.
  6. Click Save to persist the schema into the database or Discard to discard the schema. Now you can map the child elements within the parameter. In the case of the activity Output tab, the output tree does not display in the current activity but is displayed in the mapper for subsequent activities only. Once persisted in the database, these schema trees get displayed in the Available data area of the mapper for subsequent activities. This allows you to map to them in subsequent activities.