• 沒有找到結果。

Starting with a Trigger

在文檔中 TIBCO Flogo® Enterprise (頁 69-75)

When creating a new flow, if you know the circumstances under which you want the flow to activate, select Start with a trigger option and select an available trigger that activates the flow.

Warning: If an app has multiple triggers that require a port to be specified, for example, REST and/or GraphQL triggers, make sure that the port number is unique for each trigger. Two triggers in the same app cannot run on the same port.

If you are unsure of the circumstances under which the flow should be activated, or if you want the flow to be activated under more than one situation, use the Configure flow inputs and outputs option and attach the flow to the trigger(s) at a later time as needed.

See Creating a Flow without a Trigger for more details on this.

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 2.0 or OpenAPI 3.0 specification file that you have saved either in TIBCO Cloud™ Integration - API Modeler or on your local machine.

for details.

Note: If you would like to have two flows using the same operation on the same resource, make sure that you configure different ports for each flow while creating the flows in the Settings tab of the ReceiveHTTPMessage trigger.

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

Warning: If you modify the Reply Settings tab of a ReceiveHTTPMessage trigger, the corresponding ConfigureHTTPResponse activities within that flow do not change appropriately. This happens specifically when removing fields from the Reply Settings tab. Redo the mappings for the

ConfigureHTTPResponse activity.

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

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 text box. This is 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 this step above automatically gets copied or displayed in a tree format to the following locations when the trigger gets added:

 l Trigger output, in the Map to Flow Inputs tab of the trigger

 l Flow input, in the Input Settings tab of the Flow Inputs & Outputs accordion tab.

 l Trigger reply (If the trigger has a reply), in the Reply Settings of the trigger.

Refer to the "REST Trigger" section in TIBCO Flogo® Enterprise Activities, Triggers, and Connections.  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.

 a. Open the trigger configuration dialog by clicking on the trigger:

 b. Open the Map to Flow Inputs tab.

 c. 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:

 a. In the trigger configuration dialog, click the Map from Flow Outputs tab.

 b. Map the elements under Trigger Reply to their corresponding elements under Flow Output.

 c. Close the dialog by clicking on the x at its top right corner.

 15. Click Save to save your changes.

 16. Add activities to the flow by hovering your mouse cursor next to the Flow Inputs &

Outputs tab and clicking the plus sign.

Creating a Flow attached to the GraphQL Trigger

You create GraphQL flows by uploading a GraphQL schema file with an extension .gql or .graphql. Flogo Enterprise creates the appropriate flows based on your schema. When the flow gets created, a

GraphQL trigger automatically gets generated and attached to each flow that gets created.

Refer to the section, Using GraphQL Schema on how to create a flow using a GraphQL schema. Also, refer to the "GraphQL Trigger" section in TIBCO Flogo® Enterprise Activities, Triggers, and Connections for details on the GraphQL trigger.

Creating a Flow Attached to Other Triggers

This section applies to triggers that are not REST, gRPC or GraphQL triggers.

To create a flow with such a trigger:

Procedure

 1. Click an app name in the Apps page in Flogo Enterprise to open its page.

 2. If this is the first flow in the app, click the Create link, or if another flow exists in the app, click the Create button.

The Add triggers and flows dialog box 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 and click Create.

 5. Select Start with a trigger.

The triggers catalog opens. If there are existing triggers in the app, they are displayed in the Select existing trigger tab.

 6. To create a new trigger, click Add new trigger.

 7. Click the trigger that you want to add.

The flow details page is displayed with the trigger.

 8. Click the trigger to display its properties. For example, the image below shows the Timer trigger.

 9. Configure the properties for the trigger. See the respective trigger section in TIBCO Flogo® Enterprise Activities, Triggers, and Connections for details.

 10. Add activities to the flow by clicking the + icon next to the Flow Inputs & Outputs tab:

Creating a Flow Attached to a gRPC Trigger

You create gRPC flows by uploading a gRPC Protobuf file with an extension, .proto. Flogo Enterprise creates the appropriate flows based on your methods. It implements one flow per method. A gRPC trigger automatically gets generated and the flows are attached to the trigger.

See Using gRPC for information on how to create a flow using a gRPC Protobuf. Also, for details on the gRPC trigger, see the "gRPC Trigger" section in TIBCO Flogo® Enterprise Activities, Triggers, and Connections.

在文檔中 TIBCO Flogo® Enterprise (頁 69-75)

相關文件