Creating a Flow Attached to a REST (Receive HTTP Message) Trigger

When creating a flow with a REST trigger, you have the option to either enter the schema in the Configure trigger dialog during flow creation or you can use a Swagger specification file that you have saved either in TIBCO Cloud™ Integration - API Modeler or on your local machine.

If you want to use a Swagger specification file, refer to the Using a Swagger Specification section for details.

You can create a REST flow by entering a JSON schema or dragging and dropping a Swagger JSON file. See Using a Swagger Specification section for how to use a Swagger file.

To create a REST flow by entering the schema, do the following:

Procedure

  1. Click an app name on the Apps page in TIBCO Cloud Integration - Flogo (PAYG) to open its page.
  2. Click Create.
    The Add triggers and flows dialog opens.
  3. Enter a name for the flow in the Name text box.
    Flow names within an app must be unique. An app cannot contain two flows with the same name.
  4. Optionally, enter a brief description of what the flow does in the Description text box.
  5. New flow is selected by default. Click Create.
  6. Select Start with a trigger.
    The triggers catalog opens with all the available triggers showing.
  7. Click Receive HTTP Message card to create a REST trigger.
    The trigger configuration dialog opens.
  8. Select the REST operation under Method that you want to implement by clicking it .
    Note: A flow can have multiple REST triggers. Two REST triggers cannot have an identical port, path, and method combination. Each REST trigger needs to differ from the other REST triggers for the same flow with either a unique port, path, or operation (GET, PUT, POST, DELETE).
  9. Enter a resource path in the Resource Path text box.
  10. Enter the JSON schema or JSON sample data for the operation in the Enter a JSON Schema or an example of your JSON message. This will be the schema for both input and output.
  11. Click Continue.
  12. Select one of the following dialog:

    If you select Copy Schema, the schema that you entered in Step 10 above automatically gets copied or displayed in a tree format to the following locations when the trigger gets added:
    • Trigger output in the Map to Flow Inputs tab of the trigger
    • Flow input in the Input Settings tab of the Flow Inputs & Outputs accordian tab.
    • Trigger reply (If the trigger has a reply) in the Reply Settings of the trigger.

    Refer to the "REST Trigger" section in the TIBCO Flogo® Activities and Triggers Guide for details on configuration parameters.

    If you select Just add the trigger, a REST trigger gets added to the flow without any configuration. You can configure this REST trigger by clicking on the trigger from the app details page at a later time. Any changes made to the trigger must be explicitly saved by clicking Save.

    The flow page opens.

  13. Map the trigger output to the flow input.
    1. Open the trigger configuration dialog by clicking on the trigger.
    2. Open the Map to Flow Inputs tab.
    3. Map the elements under Flow input to their corresponding elements under Trigger Output one at a time.
  14. Map the flow output to the trigger reply as follows:
    1. In the trigger configuration dialog, click the Map from Flow Outputs tab.
    2. Map the elements under Trigger Reply to their corresponding elements under Flow Output.
    3. Close the dialog by clicking on the x at its top right corner.
  15. Click Save to save your changes.
  16. Add activites to the flow by hovering your mouse cursor next to the Flow Inputs & Outputs tab and clicking the plus sign.