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 TIBCO Cloud Integration - Flogo (PAYG). Such apps will 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:
  • array
  • object
  • param
  • any

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

Note the following:

  • Coercing is supported only in the Default category activities which are the activities marked as OSS, with the exception of the Return and Start a SubFlow activities. These two activities display flow-level data. The the flow-level inputs and outputs can be entered or modified only in the Flow Inputs & Outpts accordian tab, hence they cannot be coerced from within the Input tab of the activity itself.
  • Currently, coercion is supported only for top-level parameters. Nested coercion (for example, an object within an object) is not supported.
  • Currently, coercing a schema for trigger input is not supported. The coercing option is not available in the Map to Flow Inputs tab in the trigger configuration. This is because the parameters you see in this tab are flow input parameters and are not related to the trigger. You have the option to coerce these parameters in the Input tab of the Flow Inputs & Outputs accordion tab.
  • After you have mapped a child element within a parameter, if you change the name of the parent or the child, your mapping will be lost. However, if you change the data type of the element, the mapping is preserved, but you see an error related to the mismatch in data type.
  • The schema you enter is preserved when you export and import the app.
  • If you edit the schema at a later time, as long as you click the Apply button after editing, your edits will display in the mapper. You must then click Save in the mapper to persist your schema changes.
  • You cannot coerce a parameter or edit its schema in any activity appearing in a subflow. For example, if the OracleDatabaseQuery activity appears in both the main flow and the subflow, you cannot edit the schema of any of its parameters in the subflow. But you can edit the schema of the OracleDatabaseQuery activity in the main flow. This is because the subflow activity input and output schemas are inherited from the main flow. There is a possibility that the same subflow could be used in multiple main flows, so if you edit an activity in the subflow it could break another main flow which uses the subflow.

To provide the schema for coercion, do the following:

Procedure

  1. On the flow details page, click on the activity or trigger as the case may be, to open its configuration.
  2. Click any of the following that what you want to configure:
    • Input tab to configure an parameter in the activity input
    • Output tab to configure the schema for the activity output
    • Map from Flow Outputs tab if configuring 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 Input.
    • 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.

    The Coerce with schema icon () that appears next to it.

  4. Click the Coerce with schema icon.
    Note: The Coerce with schema icon appears against the parameter name for only those parameters that do not have a schema defined in 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 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, the Apply button 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 in the Output tab of the activity. Upstream Output 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 will display in the mapper for subsequent activities only. Once persisted in the database, these schema trees get displayed in the Upstream Output area of the mapper for subsequent activities. This allows you to map to them in subsequent activities.
Related concepts