When creating a flow in the Flogo app, you can create it without attaching it to a trigger. This method of creating a blank flow is useful when the logic for the flow is available, but you do not know the
condition under which the flow should activate. You can start by creating a flow with the logic and attach it to one or more triggers at a later time.
Follow these steps to create a flow without a trigger:
Procedure
1. Click an app name on the Apps page in Flogo Enterprise to open its page.
2. Click the +Create if this is the first flow in the app. If one or more flows exist, click the Create button.
The Create flows and triggers 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. The New flow button is selected by default.
To create a flow from a Swagger specification, refer to Using a Swagger Specification for details. To create a flow from a GraphQL schema, refer to Using a GraphQL Schema for details.
5. Click Create.
You will be prompted to select one of the following options:
6. Select Configure flow inputs and outputs.
The flow gets created with the flow details page opens displaying the Input tab of the Flow Inputs
& Outputs tab.
You can configure the inputs and/or outputs to the flow in the Input or Output tab. See Flow Inputs and Outputs Tab
Mapping trigger outputs to flow inputs and flow outputs to trigger reply creates a contract between the trigger and the flow. Hence, when you attach the flow to a trigger later, you must map the output of the trigger to the input to the flow. You have the option to attach your flow to one or more triggers at any later time after the flow has been created. See Attaching a Flow to One or More Triggers for details.
7. Enter a JSON schema containing the input fields to the flow in the Input Settings tab.
8. Enter the JSON schema containing the flow output fields in the Output Settings tab.
9. Click the left facing arrow on top of the blue label when done to retract the Flow Inputs & Outputs page.
10. Add a Return activity to the flow. Click and drag the Return activity to the right to make room to add other activities.
11. Hover your mouse over the shaded square to expose the add activity button ( ). Click the add activity button to add an activity.
After adding an activity, be sure to configure its properties by clicking on the activity tile. If there are any errors in the activity, fix the errors before proceeding. See Errors and Warnings section for more details.
12. Continue adding activities by clicking the successive ( ) buttons. To add an activity between two exisiting activities, you can drag the activities to the right in order to make room for the new activity then click the button to add the new activity.
13. Click the Return activity to configure the parameters that the flow outputs after completing execution. The Return activity displays the parameters that you had configured in the Output Settings tab of the Flow Inputs & Outputs dialog.
Anything that the flow outputs after execution must be mapped into the Return activity of the flow.
If any trigger needs to send a response back to a server, its output must be mapped to the output of the Return activity.
14. When you are ready to add a trigger, refer to Adding Triggers to a Flow to add one or more triggers to the flow. For triggers that need to send back a response to the server, you must map the flow output (elements in the Return activity) to the reply of the trigger (Map from Flow Outputs tab in the trigger configuration dialog).
Flow Inputs & Outputs Tab
Use this tab to enter the input to the flow and the flow output. This tab is particularly useful when you create blank flows that are not attached to any triggers.
Both the Input as well as Output tabs have two views:
● JSON schema view
You can enter either the JSON data or JSON schema in this view. You must click Save to save your changes or Discard to revert the changes. If you entered JSON data, the data gets converted to a JSON schema automatically when you click Save.
● list view
This view allows you to view the data that you entered in the JSON schema view in a list format.
Optionally, you can enter your data directly in this view by adding parameters one at a time. You can also mark any parameters as required by selecting its checkbox. When creating a parameter, if you select its data type as an array or an object, an ellipsis (…) appear to the right of the data type.
Click the ellipsis to provide a schema for the object or array and either click Save to save the changes or Discard to discard your changes.
Attaching a Flow to One or More Existing Trigger
If you had created a blank flow without attaching it to a trigger, you can attach it to an existing trigger that is being used by another flow in the same app.
A flow that was created without being attached to a trigger has its input and output parameters defined in the Flow Inputs & Outputs tab that you can access by clicking the blue bar with the same label. You must map the input parameters defined in the Input tab of this dialog to the trigger output parameters.
This mapping must be done in the trigger. The mapping creates a contract between the trigger and the flow and is mandatory for the flow and the trigger to interact with each other.
Procedure
1. You can use one of these methods to attach the flow to a trigger:
● From the app details page:
1. Open the app details page by clicking on the app.
2. Hover over No trigger, then click Add trigger.
● From the flow details page:
1. Open the flow details page by clicking on the flow on the app details page.
2. Click the the Add a new trigger icon ( ).
2. Click Select Existing and then click the trigger you want to use in the right pane.
3. For REST and GraphQL triggers, you will be prompted to enter additional handler setting details.
Refer to the "REST Trigger" section in the TIBCO Flogo® Activities and Triggers Guide. Refer to the
"GraphQL Trigger" section in the TIBCO Flogo® Activities and Triggers Guide.
After you select Copy Schema or Just add a trgger, the flow details page opens displaying the trigger icon on the top left corner.
4. Click the trigger icon to configure the trigger as needed. For REST and GraphQL triggers, be sure to map the trigger outputs to flow inputs and the flow outputs to the trigger reply.
5. Optionally, attach the flow to additional triggers by clicking the icon and following the steps above.
Attaching a Flow to a New Trigger
You can attach your flow to a new trigger that is not being used by another flow in the same app.
Procedure
1. You can use one of these methods to attach the flow to a trigger:
● From the app details page:
1. Open the app details page by clicking on the app.
2. Hover over No trigger, then click Add trigger.
● From the flow details page:
1. Open the flow details page by clicking on the flow on the app details page.
2. Click the the Add a new trigger icon ( ).
2. Click Select New and then click the trigger you want to use in the right pane.
3. Enter the handler setting information in the case of a REST and GraphQL trigger. Refer to the "REST Trigger" section in the TIBCO Flogo® Activities and Triggers Guide.
4. If you are attaching your flow to a REST or GraphQL trigger that is the first REST or GraphQL in the app, you get prompted with the following dialog.
For more information, see Creating a Flow Attached to a REST Trigger or Creating a Flow Attached to a GraphQL Trigger.
The selected trigger icon appears to the extreme left side of the flow page as follows:
5. Click the trigger icon to configure the trigger as needed. For REST and GraphQL triggers, be sure to map the trigger outputs to flow inputs and the flow outputs to the trigger reply.
6. Optionally, attach the flow to additional triggers by clicking the icon and following the steps above.