• 沒有找到結果。

Starting with a Trigger

When creating a new flow, if you know the circumstances under which you want the flow to activate, you can select an available trigger that will activate the flow.

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 and add the trigger(s) at a later time as needed to the flow. See Creating a Flow without a Trigger for more details on this.

Follow these steps if you selected Start with a trigger when creating the flow:

Procedure

1. In the Add a trigger dialog, click a trigger with which to start the flow.

A flow gets created with the trigger you selected.

2. Click the trigger to open its properties dialog and configure the trigger properties. Refer to the appropriate section for the type of trigger that you want to create.

The following general category triggers are available for you to select:

Timer

REST

3. Hover next to the Flow Inputs & Outputs accordian tab until you see the ( ) buttons. Click the ( ) button to add an activity. Continue adding activities by clicking the successive ( ) buttons.

After adding an activity, be sure to configure its properties by clicking on the activity tile. If one or more activities are not configured properly in a flow, the Errors button on the lower right of the page shows the number of errors in the flow. click the Errors button to view the errors.

4. Be sure to fix the errors before proceeding.

After you have created the flow, you can either create more flows or build the app once you are done creating all the flows you need.

Creating a Flow with a Timer Trigger

A flow that is activated by a timer must be created with the Timer trigger.

To create a flow with the Timer trigger, follow these steps:

Procedure

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

2. Click the Create Flow button.

The Create a Flow dialog opens.

3. Enter a name for the flow in the Flow 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 Add a trigger dialog opens with all the available triggers showing.

6. Click Timer Trigger.

The flow page is displayed with the Timer trigger.

7. Click the Timer Trigger to display its properties.

8. Configure the trigger properties for the trigger. See Timer Trigger for details.

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

Creating a Flow with a REST Trigger (Receive HTTP Message) A REST flow starts with a REST trigger.

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 Configuration tab of the

ReceiveHTTPMessage trigger.

To create a REST flow, do the following:

Procedure

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

2. Click the Create Flow button.

The Create a Flow dialog opens.

3. Enter a name for the flow in the Flow 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 Add a trigger dialog opens with all the available triggers showing.

6. Click Receive HTTP Message, the REST trigger.

The Configure Trigger dialog opens.

7. Select the REST operation you want to implement by clicking on the box for the operation under Method.

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).

8. Enter a resource path in the Resource Path text box.

9. 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.

10. Click Continue.

11. If this is the first REST trigger you are adding to the flow, you get the following dialog:

If you select Copy Schema, the schema that you entered in step 9 above gets automatically gets copied to the following locations when the trigger gets added:

Trigger output in the Output 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.

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 it at a later time.

The flow page opens with the Input Settings tab of the Flow Inputs & Outputs accordian tab open.

12. Collapse the Flow Inputs & Outputs tab to see the buttons for adding activity in the flow.

13. Map the trigger output to the flow input.

a) Open the trigger configuration dialog by clicking on it.

b) Open the Output 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 Reply tab.

b) Map the elements under Trigger Reply to their corresponding elements under Flow Output one at a time.

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

15. Add activites to the flow by hovering your mouse cursor next to the Flow Inputs & Outputs tab and clicking the plus sign.

Refer to the REST Trigger for details on configuration parameters.

Creating a Connection Flow

When creating a flow with a Connection trigger, all the connections that you have created for an app are available for you. You can choose from any of the available connections.

Prerequisites

Make sure you have created the relevant connection prior to creating a flow with the connection. See Using Connectors for details on creating a connection.

Creating a Connection Flow

To create a flow with a connection as a trigger, follow these steps:

1. On the page for the app, click the Create a Flow button.

2. In the Create a Flow dialog, enter Flow Name and optionally a Description for the flow in their respective text boxes.

3. Click the trigger card corresponding to the connection type you want to create under Select a trigger type.

Only the connections for those connectors that have a trigger available will be listed. If a connector does not have a trigger, its connection will not be listed. For connectors that do not have a trigger, you can create a flow using the Timer or REST (Receive HTTP Message) trigger.

If the list of available connections is too long, you can search for a specific connection by entering its name in the Search text box.

If you have multiple connections for a connection type, you can change the connection and object after you have created the flow. You have the option to do so when configuring the trigger on the flow page.

相關文件