(PAYG)
User's Guide
Software Release 2.6.1
June 2019
Important Information
SOME TIBCO SOFTWARE EMBEDS OR BUNDLES OTHER TIBCO SOFTWARE. USE OF SUCH EMBEDDED OR BUNDLED TIBCO SOFTWARE IS SOLELY TO ENABLE THE FUNCTIONALITY (OR PROVIDE LIMITED ADD-ON FUNCTIONALITY) OF THE LICENSED TIBCO SOFTWARE. THE EMBEDDED OR BUNDLED SOFTWARE IS NOT LICENSED TO BE USED OR ACCESSED BY ANY OTHER TIBCO SOFTWARE OR FOR ANY OTHER PURPOSE.
USE OF TIBCO SOFTWARE AND THIS DOCUMENT IS SUBJECT TO THE TERMS AND CONDITIONS OF A LICENSE AGREEMENT FOUND IN EITHER A SEPARATELY EXECUTED SOFTWARE LICENSE AGREEMENT, OR, IF THERE IS NO SUCH SEPARATE AGREEMENT, THE CLICKWRAP END USER LICENSE AGREEMENT WHICH IS DISPLAYED DURING DOWNLOAD OR INSTALLATION OF THE SOFTWARE (AND WHICH IS DUPLICATED IN THE LICENSE FILE) OR IF THERE IS NO SUCH SOFTWARE LICENSE AGREEMENT OR CLICKWRAP END USER LICENSE AGREEMENT, THE LICENSE(S) LOCATED IN THE “LICENSE” FILE(S) OF THE
SOFTWARE. USE OF THIS DOCUMENT IS SUBJECT TO THOSE TERMS AND CONDITIONS, AND YOUR USE HEREOF SHALL CONSTITUTE ACCEPTANCE OF AND AN AGREEMENT TO BE BOUND BY THE SAME.
ANY SOFTWARE ITEM IDENTIFIED AS THIRD PARTY LIBRARY IS AVAILABLE UNDER SEPARATE SOFTWARE LICENSE TERMS AND IS NOT PART OF A TIBCO PRODUCT. AS SUCH, THESE SOFTWARE ITEMS ARE NOT COVERED BY THE TERMS OF YOUR AGREEMENT WITH TIBCO, INCLUDING ANY TERMS CONCERNING SUPPORT, MAINTENANCE, WARRANTIES, AND INDEMNITIES. DOWNLOAD AND USE OF THESE ITEMS IS SOLELY AT YOUR OWN
DISCRETION AND SUBJECT TO THE LICENSE TERMS APPLICABLE TO THEM. BY PROCEEDING TO DOWNLOAD, INSTALL OR USE ANY OF THESE ITEMS, YOU ACKNOWLEDGE THE
FOREGOING DISTINCTIONS BETWEEN THESE ITEMS AND TIBCO PRODUCTS.
This document is subject to U.S. and international copyright laws and treaties. No part of this document may be reproduced in any form without the written authorization of TIBCO Software Inc.
TIBCO, the TIBCO logo, Two-Second Advantage, TIB, Information Bus, Rendezvous, TIBCO
Rendezvous, TIBCO Cloud Integration, TIBCO Flogo, TIBCO Flogo Apps, TIBCO Flogo Enterprise, and TIBCO Cloud™ Integration- Flogo® (PAYG) are either registered trademarks or trademarks of TIBCO Software Inc. in the United States and/or other countries.
All other product and company names and marks mentioned in this document are the property of their respective owners and are mentioned for identification purposes only.
This software may be available on multiple operating systems. However, not all operating system platforms for a specific software version are released at the same time. Please see the readme.txt file for the availability of this software version on a specific operating system platform.
THIS DOCUMENT IS PROVIDED “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT.
THIS DOCUMENT COULD INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS. CHANGES ARE PERIODICALLY ADDED TO THE INFORMATION HEREIN; THESE CHANGES WILL BE INCORPORATED IN NEW EDITIONS OF THIS DOCUMENT. TIBCO SOFTWARE INC. MAY MAKE IMPROVEMENTS AND/OR CHANGES IN THE PRODUCT(S) AND/OR THE PROGRAM(S) DESCRIBED IN THIS DOCUMENT AT ANY TIME.
THE CONTENTS OF THIS DOCUMENT MAY BE MODIFIED AND/OR QUALIFIED, DIRECTLY OR INDIRECTLY, BY OTHER DOCUMENTATION WHICH ACCOMPANIES THIS SOFTWARE,
INCLUDING BUT NOT LIMITED TO ANY RELEASE NOTES AND "READ ME" FILES.
This and other products of TIBCO Software Inc. may be covered by registered patents. Please refer to TIBCO's Virtual Patent Marking document (https://www.tibco.com/patents) for details.
Copyright © 2016 - 2019. TIBCO Software Inc. All Rights Reserved.
Contents
TIBCO Documentation and Support Services. . . .6
Overview. . . . 7
Concepts. . . .7
Developing TIBCO Flogo® Apps. . . .8
Creating a TIBCO Flogo® App. . . .8
Reverting Changes to an App. . . .8
Building the App. . . .8
Building APIs. . . .10
Using a Swagger Specification. . . .10
Using GraphQL Schema. . . .11
Flogo Runtime. . . .13
Environment Variables. . . .13
Healthcheck API. . . .13
Runtime Statistics. . . .13
Go Language Runtime Statistics and Profiling. . . .14
Application Metrics. . . .15
Enabling Application Metrics. . . .16
Enabling statistics collection using environment variables. . . .16
Fields returned in the response from the API call. . . .16
Prometheus. . . .17
Using Prometheus to Analyze Flogo App Metrics. . . .18
Often-Used Queries. . . .19
Using Connectors. . . .21
Creating Connections. . . 21
Editing or Deleting Existing Connections. . . .21
Flows. . . . 23
Creating a Flow. . . .23
Starting with a Trigger. . . .24
Creating a Flow with a REST (Receive HTTP Message) Trigger. . . .24
Creating a Flow with the GraphQL Trigger. . . .26
Creating a Flow with Other Triggers. . . .26
Creating a Flow without a Trigger. . . .28
Adding Triggers to a Flow. . . .29 . . . .
Creating Subflows. . . .30
Creating a Flow Execution Branch. . . .31
Types of Branch Conditions. . . .32
Setting Branch Conditions. . . .32
Deleting a Branch. . . .34
Duplicating a Flow. . . .35
Editing a Flow. . . .35
Reverting Changes to a Flow. . . .35
Switching Between Flows in an App. . . .36
Deleting a Flow. . . .36
Converting a Legacy Triggered Flow to a Blank Flow. . . .36
Configuring the Error Handler. . . .37
Adding an Activity. . . .39
Configuring an Activity. . . .39
Using the Iterator in an Activity. . . .41
Deleting an Activity. . . .42
Flow Tester. . . .43
Testing Flows from the UI. . . .43
What is a Launch Configuration?. . . .43
Creating and Using a Launch Configuration. . . 43
Configuring a Launch Configuration. . . .47
Exporting a Launch Configuration. . . .49
Importing a Launch Configuration. . . .49
Cloning a Launch Configuration. . . .50
Deleting a Launch Configuration. . . .51
Mapper. . . .52
Using the Mapper. . . .54
Scopes in Flogo Enterprise Mapper. . . .55
Reserved Keywords to be Avoided in Schemas. . . .56
Mapping a Single Element. . . .57
Using Functions. . . 58
Using Expressions. . . .59
Supported Operators. . . .59
Mapping Array of Primitive Types. . . .60
Mapping an Array of Objects. . . .60
Clear Mapping of Child Elements in Objects and Arrays. . . .62
Mapping an Array to a Non-Array Structure. . . .63
Application Properties. . . .64
Creating Application Properties. . . .64
App Properties Dialog Views. . . .64
Creating a Standalone Application Property. . . .65
Creating a Group. . . .66
Deleting a Group or Property. . . .67
Using Application Properties in a Flow. . . .68
Using Application Properties in the Mapper. . . .69
Unlinking an Application Property from a Field Value. . . .69
Using Application Properties in Connections. . . .69
Editing an Application Property. . . .72
Changing the Default Value of a Property from the App Properties Dialog. . . .72
Changing the Name or Data Type of an Application Property after Using It. . . .72
When Importing an App. . . .72
Exporting Application Properties to a File. . . .72
Application Configuration Management. . . .74
Consul. . . .74
Using Consul with TIBCO Cloud Integration- Flogo (PAYG). . . .74
Consul Connection Parameters. . . 75
Setting the Consul Connection Parameters. . . .76
AWS Systems Manager Parameter Store. . . .78
Using the Parameter Store with Flogo Enterprise. . . .78
Parameter Store Connection Parameters. . . .79
Setting the Parameter Store Connection Parameters. . . .80
Evironment Variables. . . .82
Using Environment Variables to Override Application Property Values. . . .82
Encrypting Password Values. . . .83
Developing for AWS Marketplace. . . .85
Build the Flogo Application Docker Image. . . .85
About AWS Deployment Templates. . . .85
Calling Lambda Functions. . . .86
Creating a Connection with the AWS Connector. . . .86
Using Extensions. . . .87
Exporting and Importing an App. . . . 91
TIBCO Documentation and Support Services
How to Access TIBCO Documentation
Documentation for TIBCO products is available on the TIBCO Product Documentation website, mainly in HTML and PDF formats.
The TIBCO Product Documentation website is updated frequently and is more current than any other documentation included with the product. To access the latest documentation, visit https://
docs.tibco.com.
Documentation for TIBCO Cloud™ Integration- Flogo® (PAYG) is available on the TIBCO Cloud™ Integration- Flogo® (PAYG) Product Documentation page.
Product-Specific Documentation
The following documents for this product can be found on the TIBCO Documentation site:
● TIBCO Cloud™ Integration- Flogo® (PAYG) Installation
● TIBCO Cloud™ Integration- Flogo® (PAYG) User's Guide
● TIBCO Cloud™ Integration- Flogo® (PAYG) Release Notes
How to Contact TIBCO Support
You can contact TIBCO Support in the following ways:
● For an overview of TIBCO Support, visit http://www.tibco.com/services/support.
● For accessing the Support Knowledge Base and getting personalized content about products you are interested in, visit the TIBCO Support portal at https://support.tibco.com.
● For creating a Support case, you must have a valid maintenance or support contract with TIBCO.
You also need a user name and password to log in to https://support.tibco.com. If you do not have a user name, you can request one by clicking Register on the website.
How to Join TIBCO Community
TIBCO Community is the official channel for TIBCO customers, partners, and employee subject matter experts to share and access their collective experience. TIBCO Community offers access to Q&A forums, product wikis, and best practices. It also offers access to extensions, adapters, solution accelerators, and tools that extend and enable customers to gain full value from TIBCO products. In addition, users can submit and vote on feature requests from within the TIBCO Ideas Portal. For a free registration, go to https://community.tibco.com.
Overview
To use TIBCO Cloud Integration- Flogo (PAYG):
1. Create an app.
2. Create a flow in your app.
3. Add one or more activities to the flow and configure them.
4. Optionally, add a trigger to your flow. You can add one or more triggers to a flow as and when you need them.
5. .
Concepts
The following describes some concepts that are used in the TIBCO Cloud Integration- Flogo (PAYG) environment.
Apps
Flogo apps are developed as event-driven apps using triggers and actions and contain the logic to process incoming events. A Flogo app consists of one or more triggers and one or more actions such as flows.
Trigger
Triggers receive events from external sources such as Kafka, Salesforce, GraphQL and so on. Handlers dispatch events to actions such as flow. TIBCO Cloud Integration- Flogo (PAYG) provides a set of out- of-the-box triggers as well as a range of connectors for receiving events from a variety of external systems.
Flow
The Flogo ecosystem provides a set of actions for processing events in a manner suitable to your implementation logic. The flow is one of the actions in Flogo that allows you to implement the business logic as a process. Flows are visually designed and tested using the Web UI. A Flow can consist of one or more activities that perform a specfic task. Activities are linked and can contain conditional logic for branching. Each Flow also has a default error handler. A Flogo app can have one or more flows. A flow can be triggered by one or more Triggers within the application.
Activity
Activities perform specific tasks within the flow. A flow typically contains multiple activities.
Developing TIBCO Flogo
®Apps
TIBCO Cloud Integration- Flogo (PAYG) offers a wizard driven approach to app development. You can create apps in TIBCO Cloud Integration- Flogo (PAYG) using only a browser.
Creating a TIBCO Flogo
®App
You can create a Flogo® App from the Apps page in TIBCO Cloud™ Integration- Flogo® (PAYG).
Follow these steps to create an app:
Procedure
1. Open the Apps page in TIBCO Cloud Integration- Flogo (PAYG).
2. Click Create.
The Create an app dialog is displayed.
3. Enter a name for your app in the Give your new app a name text box.
The app name must not contain any spaces. It must start with a letter or underscore and can contain letters, digits, periods, dashes, and underscores.
4. Refer to the "Getting Started" section for details on endpoint visibility.
5. Click Create.
Reverting Changes to an App
After editing an existing app, as long as you have not the app, you can revert the app to the state that it was in after the latest . This will revert the changes you just made. You can use the button to undo the changes. The changes will be lost.
To revert your edits to an existing app before it, follow these steps:
Procedure
1. From the Apps page, click the the app to open its page.
2. Click . The is activated only if you have made edits to the app after the last , but have not the app with those edits.
Building the App
After you have created your app, you have the option to either export the app (without building it) or build it. Exporting an app allows you to import it elsewhere, for example in TIBCO Cloud™
Integration. When you build the app, its deployable artifact gets created and downloaded to your local machine. Each operating system has its own build target. You must select the right target for your operating system when building the app. You can use the built artifact to run the app in TIBCO Cloud Integration- Flogo (PAYG).
Be sure that you have Docker installed on your machine. Please refer to the product Readme for the supported versions of Docker.
Follow these steps to build an app:
For app binaries that were created in TIBCO Cloud Integration- Flogo (PAYG) 2.5 or older versions, if the app binary was created using an <app>.json file and contains a flow starting with a trigger and the app binary was created from the CLI using the build tool, the app gets successfully built but throws an error at runtime.
Procedure
1. Open the Apps page in TIBCO Cloud Integration- Flogo (PAYG).
2. Click the app that you want to build to open the page for that app.
3. Click Build.
4. Click the build target option that is compatible with your operating system.
The app begins to build and when done, the deployable artifact gets downloaded to your local machine. In the case of Docker, a Docker image gets created in your Docker storage area.
Any uppercase letters in your app name get converted to lowercase in the Docker image name. For instance, if your app is named MyApp, the Docker image that gets generated will be named myapp.
5. To run the app:
On Linux
1. Open a terminal.
2. Run: chmod +x <app-file-name>
3. Run: ./<app-file-name>
For Docker Image
Any uppercase letters in your app name get converted to lowercase in the Docker image name. For instance, if your app is named MyApp, the Docker image that gets generated will be named myapp. So be sure to use all lowercase letters in the app-file-name in the command below.
1. Open a terminal.
2. Run: docker run -p <<host-port-number>>:<port-on-docker> flogo/<app-file-name>
Building APIs
TIBCO Cloud Integration- Flogo (PAYG) lets you take an API-first development approach to implement APIs from a GraphQL schema or a Swagger 2.0 specification. Once you upload a GraphQL schema or Swagger file, TIBCO Cloud Integration- Flogo (PAYG) validates the file and if the validation passes, it automatically creates the Flogo flows and trigger for you.
Using a Swagger Specification
TIBCO Cloud Integration- Flogo (PAYG) gives you the option to create the Flogo app logic (flows) by importing a Swagger 2.0 specification file. You simply drag and drop a Swagger file into the TIBCO Cloud Integration- Flogo (PAYG) UI and the flows for your app automatically get created based on the definitions in the Swagger file that you uploaded.
TIBCO Cloud Integration- Flogo (PAYG) supports Swagger 2.0.
Currently, TIBCO Cloud Integration- Flogo (PAYG) supports only the JSON format.
Cyclic dependency is not supported while creating flows from Swagger specifications. For example, if you have a type Book which contains an object element of type, Author. The type Author in turn contains an element of type Book which represents the books written by the author. To retreive the Author, it creates a cyclic dependency where the Author object contains the Book object and the Book type in turn contains the Author object.
To upload your Swagger file, follow these steps:
Procedure
1. Open the app details page and click + Create if this is your first flow or if a flow already exists click the Create button.
2. Select From Swagger specifications.
3. Upload your Swagger file by either dragging and dropping it or navigating to it using the browse to upload link.
TIBCO Cloud Integration- Flogo (PAYG) validates your file extension. If your file extension is .json, you see a green check mark and the Upload button appears.
4. Click Upload.
TIBCO Cloud Integration- Flogo (PAYG) validates the contents of your file and if it passes the validation, it creates the flows based on the definitions in the file. One flow gets created for each method and path combination defined in the file. If there are errors in your file, you get warning messages saying so, but you have the option to continue with creating the flows. If you click Continue, the flows get created for supported methods only. Other issues must be fixed before you can upload the file again.
Currently, the following are not supported:
● PATCH method
● Form data content type
● Same root having a static path and a parameterised path in the file, for
example, /foo/bar and /foo/{id}. But having two static paths are supported, for example, /foo/bar and /foo/bar1
5. In each flow, do the following:
a) Open the flow by clicking on its name.
b) Click the trigger to open its configuration dialog.
c) Map the following:
● In the Map to Flow Inputs tab, map the Trigger Output to Flow Input.
● In the Map from Flow Outputs tab, map the Flow Output to Trigger Reply.
Using GraphQL Schema
GraphQL provides a powerful query language for your APIs enabling clients to get the exact data that they need. It has the ability to get data from multiple resources in a single request by aggregating the requested data to form one result set. GraphQL provides a single endpoint for accessing data in terms of types and fields.
TIBCO Cloud Integration- Flogo (PAYG) provides an out-of-the-box GraphQL Trigger which turns your Flogo app into a GraphQL server implementation. Each Flogo flow in the app acts like a GraphQL field resolver. So the output of the flow, must match the return type of the field in the schema.
TIBCO Cloud Integration- Flogo (PAYG) allows you to create GraphQL triggers by dragging and dropping your GraphQL schema file or by navigating to the file. A flow gets automatically created for every query and mutation type in your schema. You must then open the flow and define what kind of data you want the flow to return. This saves you the time and effort to programmatically define data structures on the server.
This section assumes that you are familiar with GraphQL. To learn about GraphQL, refer to the GraphQL documentation.
GraphQL server implementation in TIBCO Cloud Integration- Flogo (PAYG)
To obtain samples of GraphQL schemas and application JSON files, go to https://github.com/project- flogo/graphql.
To use GraphQL in TIBCO Cloud Integration- Flogo (PAYG), you must create a GraphQL trigger and add it to your flow. Use one of the methods below to create a GraphQL trigger.
You can use only one schema per app. If you add another GraphQL Trigger to the app, you must use the same original schema.
The implementation of GraphQL server in TIBCO Cloud Integration- Flogo (PAYG) currently does not return the specified field ordering in a query when a request is received. It does not affect the
correctness of the response returned, but affects the readability and is non-compliant to current specification.
For details on the GraphQL Trigger refer to the "GraphQL Trigger" section in the TIBCO Flogo® Activities and Triggers Guide.
Creating the trigger during new flow creation
When you create a new flow, you have the option to select From GraphQL Schema which will generate the GraphQL trigger and attach it to the flow. To generate the GraphQL Trigger during flow creation, follow these steps:
1. Create a file with your schema and name it with a .gql or .graphql extension.
2. In TIBCO Cloud Integration- Flogo (PAYG), Open the app details page and click +Create.
3. Select From GraphQL Schema in the Create flows and triggers dialog.
4. Upload your <schema>.gql or <schema>.graphql file by either dragging and dropping it or
5. Click Upload. TIBCO Cloud Integration- Flogo (PAYG) validates the contents of your schema and if it passes the validation, it creates the flows based on the definitions in your schema file. One flow is created for each query or mutation field in your schema.
Manually adding the trigger to an existing flow
If you have an existing flow, you can manually add a GraphQL trigger to the flow. To do so, follow these steps:
1. Click the icon to the left of your flow.
2. Click GraphQL Trigger in the the Add a Trigger dialog.
3. Enter your GraphQL schema in the Enter a GraphQL Schema for the trigger box. The GraphQL Operation and Resolver For drop down menus automatically get populated based on the definitions in your schema.
4. Select a GraphQL operation from the drop down menu.
5. Select a resolver from the Resolver for drop down menu.
6. Click Continue. You will now see a dialog with two options, CopySchema and Just add the trigger.
Click CopySchema.
Once the trigger is created from the wizard, the trigger configuration is fixed and the Operation Field and Resolver For cannot be changed.
Limitations on constructs in a GraphQL schema
TIBCO Cloud Integration- Flogo (PAYG) currently does not supports the following GraphQL constructs:
● Custom scalar types
● Custom directives
● Subscription type
● Cyclic dependency in schema. For example, if you have a type Book which contains an object element of type, Author. The type Author in turn contains an element of type Book which represents the books written by the author. To retreive the Author, it creates a cyclic dependency where the Author object contains the Book object and the Book type in turn contains the Author object.
Flogo Runtime
TIBCO Cloud Integration- Flogo (PAYG) supports runtime configuration and statistics.
Environment Variables
This section lists the environment variables that are associated with the TIBCO Cloud Integration- Flogo (PAYG) runtime environment.
Environment Variable
Name Default Values Description
FLOGO_HTTP_SERVICE_
PORT N/A Used to set the port number to enable runtime
HTTP service which provides APIs for healthcheck and statistics
FLOGO_LOG_LEVEL INFO Used to set a log level for the Flogo app.
Supported values are:
● INFO
● DEBUG
● WARN
● ERROR
FLOGO_LOG_FORMAT TEXT Used to switch logging format between text and JSON. For example, to use the JSON format, set FLOGO_LOG_FORMAT=JSON ./
<app-name>
Healthcheck API
TIBCO Cloud Integration- Flogo (PAYG) runtime allows you to enable healthcheck for a Flogo app that is running.
To enable healthcheck for your running app, do the following:
1. Set FLOGO_HTTP_SERVICE_PORT to enable runtime HTTP Service as follows:
FLOGO_HTTP_SERVICE_PORT=<port> ./<app_name>
2. Run the following command:
curl http://localhost:<port>/ping
Currently, healthcheck endpoint returns HTTP status 200 only when all triggers in the application are successfully started. Otherwise it returns HTTP status 500.
Runtime Statistics
You can obtain the runtime statistics in TIBCO Cloud Integration- Flogo (PAYG) pertaining to the Go language. You can also enable app metrics monitoring using Prometheus.
Go Language Runtime Statistics and Profiling
TIBCO Cloud Integration- Flogo (PAYG) allows you to gather runtime system statistics for a Flogo App that is running.
Your management port must be set for the , in order to call the API to gather Go language runtime statistics. To set a different management port for your Flogo App, run
FLOGO_HTTP_SERVICE_PORT=<port>./<app-name>/You can use curl to call this API.
To obtain the system statistics on your running app, do the following:
1. From the folder in which your app binary resides, enable the HTTP service using the following command:
FLOGO_HTTP_SERVICE_PORT=<port> ./<app_name>
2. Run the following command:
curl http://localhost:<port>/debug/vars
The command returns the following statistics:
System Metric
Name Description
cmdline Command-line arguments passed to the application binary cpus Number of logical CPUs usable by the current process goroutines The number of Go routines that currently exist
memstats Memory statistics for the current process. Refer to https://golang.org/pkg/
runtime/#MemStats for more details.
processid System process ID
version Go language version used to build the application
Profiling your application runtime
You can collect and visualize runtime profiling data for Flogo Apps using the pprof tool as explained in https://golang.org/pkg/runtime/pprof/.
Endpoint Description
/debug/pprof List all profiles /debug/pprof/
profile Profile current CPU usage. By default, it is profiled for every 30 seconds. To change the profiling interval, set seconds query parameter to a desired value. For example,
go tool pprof http://localhost:<port>/debug/pprof/profile?
seconds=15
/debug/pprof/
heap A sampling of memory allocations of live objects. For example,
go tool pprof http://localhost:<port>/debug/pprof/heap
Endpoint Description /debug/pprof/
goroutine Stack traces of all current Go routines. For example,
go tool pprof http://localhost:<port>/debug/pprof/goroutine
/debug/pprof/
trace A trace of execution of the current program. For example,
go tool pprof http://localhost:<port>/debug/pprof/trace
Application Metrics
For REST APIs, the following methods can be used to enable and disable application metrics at runtime.
Method Description Status Code
POST /app/metrics Enable instrumentation metrics
collection 200 - If successfully enabled
409 - If the metrics collection is already enabled
DELETE /app/metrics Disable metrics collection 200 - If successfully disabled 404 - If metrics collection is not enabled
GET /app/metrics/flows Retrieve metrics for all flows 200 - Successfully returned metrics data
404 - If the metrics collection is not enabled
500 - If there is an issue when returning metrics data GET /app/metrics/flow/
<flowname> Retrieve metrics for a given
flow 200 - Successfully returned
metrics data
400 - If the flow name is incorrect
404 - If the metrics collection is not enabled
500 - If there is an issue returning metrics data GET /app/metrics/flow/
<flowname>/activities Retrieve metrics for all
activities in a given flow 200 - Successfully returned metrics data
400 - If the flow name is incorrect
404 - If the metrics collection is not enabled
Enabling Application Metrics
Set the FLOGO_HTTP_SERVICE_PORT environment variable to point to the port number of the HTTP service that provides APIs for collecting the application metrics. This will enable the runtime HTTP service.
To do so run the following:
Procedure
1. Run the following:
FLOGO_HTTP_SERVICE_PORT=<port> ./<application-binary>
2. Run the curl command for the appropriate REST method. Refer to Application Statistics for details on each method. Some examples are:
curl -X POST http://localhost:7777/app/metrics curl -X GET http://localhost:7777/app/metrics/flows curl -X DELETE http://localhost:7777/app/metrics
Enabling statistics collection using environment variables
To enable metrics collection through environment variable, do the following. FLOGO_APP_METRICS must be sepcified:
Procedure
1. Run the following:
FLOGO_HTTP_SERVICE_PORT=<port> FLOGO_APP_METRICS=true ./<appname>
2. Run the curl command for the appropriate REST method. Refer to Application Statistics for details on each method. Some examples are:
curl -X GET http://localhost:7777/app/metrics/flows curl -X DELETE http://localhost:7777/app/metrics/flows
Examples that shows how to retrieve specific metrics for an app
The following is an example of how you would run the above steps for a fictitious app named REST_Echo.
FLOGO_HTTP_SERVICE_PORT=7777 FLOGO_APP_METRICS=true ./REST_Echo-darwin-amd64
curl -X GET http://localhost:7777/app/metrics/flows
{"app_name":"REST_Echo","app_version":"1.0.0","flows":
[{"started":127639,"completed":126784,"failed":0,"avg_exec_time":0,"min_exec_t ime":0,"max_exec_time":4,"flow_name":"PostBooks"}]}
curl -X GET http://localhost:7777/app/metrics/flow/PostBooks/activities {"app_name":"REST_Echo","app_version":"1.0.0","tasks":
[{"started":127389,"completed":126908,"failed":0,"avg_exec_time":0,"min_exec_t ime":0,"max_exec_time":4,"flow_name":"PostBooks","task_name":"Return"}]}
Fields returned in the response from the API call
The following table describes the fields that can be returned in the response you receive when you make an API call:
Flow
Name Description
app_name Name of the application app_version Version of the application flow_name Name of the flow
started Total number of times a given flow is started completed Total number of times a given flow is completed failed Total number of times a given flow has failed
avg_exec_time Average execution time of a given flow for successfully completed executions min_exec_time Minimum execution time for a given flow
max_exec_time Maximum execution time for a given flow Activity
Name Description
app_name Name of the application
app_version Version of the application
flow_name Name of the flow
activity_name Name of the activity
started Total number of times a given activity is started completed Total number of times a given activity is completed failed Total number of times a given activity has failed
avg_exec_time Average execution time of a given activity for successfully completed executions
min_exec_time Minimum execution time for a given activity max_exec_time Maximum execution time for a given activity
Prometheus
TIBCO Cloud Integration- Flogo (PAYG) supports integration with Prometheus for app metrics monitoring. Prometheus is a monitoring tool which helps in analyzing the app metrics for flows and activities.
Flogo apps expose the following flow and activity metrics to Prometheus. These metrics are measured in milliseconds:
Labels Description
flogo_flow_metrics: Used for flow-level queries
ApplicationName Name of application ApplicationVersion Version of application
FlowName Name of flow
Started Total number of times flow is started Completed Total number of times flow is completed Failed Total number of times flow is failed flogo_activity_metrics: Used for activity-level queries
ApplicationName Name of application ApplicationVersion Version of application
FlowName Name of flow
ActivityName Name of Activity
Started Total number of times activity is started in given flow Completed Total number of times activity is completed in given flow Failed Total number of times activity is failed in given flow
For a list of some often-used flow-level queries, refer to the section, Often-Used Queries.
Using Prometheus to Analyze Flogo App Metrics
To enable Prometheus monitoring of Flogo apps, run the following:
FLOGO_HTTP_SERVICE_PORT=7779 FLOGO_APP_METRICS_PROMETHEUS=true ./<app-binary>
Setting FLOGO_APP_METRICS_PROMETHEUS variable to true enables Prometheus monitoring of Flogo apps. The variable, FLOGO_HTTP_SERVICE_PORT, is used to set the port number on which the Prometheus endpoint is available.
Use the following endpoint URL in Prometheus server configuration: http://
<APP_HOST_IP>:<FLOGO_HTTP_SERVICE_PORT>/metrics
for example, http:// 192.0.2.0:7779/metrics
Often-Used Queries
Prometheus uses the PromQL query language. This section lists some of the most commonly and often- used queries at the flow-level.
Flow-level Queries
To Get this Metric Use this Query Total number of flows that got
successfully executed per application
count(flogo_flow_metrics{Failed="0"}) by (ApplicationName)
Total number of flows that failed per
application count(flogo_flow_metrics{Failed!="0"}) by (ApplicationName)
Total number of flows that executed successfully across all apps
(when you are collecting metrics for multiple apps)
count(flogo_flow_metrics{Failed="0"})
Total number of flows that failed across all apps
(when you are collecting metrics for multiple apps)
count(flogo_flow_metrics{Failed!="0"}
Total time taken by flows which got
executed successfully sum(flogo_flow_metrics{Failed="0"}) by (ApplicationName, FlowName)
Total time taken by flows which
failed sum(flogo_flow_metrics{Failed!="0"}) by
(ApplicationName, FlowName)
Minimum time taken by the flows that got executed successfully (what was the minimum time taken by a flow from amongst the flows that executed successfully)
min(flogo_flow_metrics{Failed="0"}) by (ApplicationName, FlowName)
Minimum time taken by flows which
failed min(flogo_flow_metrics{Failed!="0"}) by
(ApplicationName, FlowName)
Maximum time taken by flows
which executed successfully max(flogo_flow_metrics{Failed="0"}) by (ApplicationName, FlowName)
Maximum time taken by flows
which failed max(flogo_flow_metrics{Failed!="0"}) by (ApplicationName, FlowName)
Average time taken by flows which
executed successfully avg(flogo_flow_metrics{Failed="0"}) by (ApplicationName, FlowName)
Activity-level Queries
To Get this Metric Use this Query Total number of activities that got
successfully executed per flow and application
count(flogo_activity_metrics{Failed="0"}) by (ApplicationName,FlowName)
Total number of activities that failed
per flow and application count(flogo_activity_metrics{Failed!="0"}) by (ApplicationName,FlowName)
Total number of activities that executed successfully across all apps (when you are collecting metrics for multiple apps)
count(flogo_activity_metrics{Failed="0"})
Total number of activities that failed across all apps
(when you are collecting metrics for multiple apps)
count(flogo_activity_metrics{Failed!="0"})
Total time taken by activities which got executed successfully per app and flow
sum(flogo_activity_metrics{Failed="0"}) by (ApplicationName, FlowName)
Total time taken by activities which
failed per app and flow sum(flogo_activity_metrics{Failed!="0"}) by (ApplicationName, FlowName)
Minimum time taken by the activity that got executed successfully within a given flow and app
min(flogo_activity_metrics{Failed="0"}) by (ApplicationName, FlowName,ActivityName)
Minimum time taken by a failed
activity within a given flow and app min(flogo_activity_metrics{Failed!="0"}) by (ApplicationName, FlowName,ActivityName)
Maximum time taken by an activity which executed successfully within a given flow and app
max(flogo_activity_metrics{Failed="0"}) by (ApplicationName, FlowName,ActivityName)
Maximum time taken by an activity which failed within a given flow and app
max(flogo_activity_metrics{Failed!="0"}) by (ApplicationName, FlowName,ActivityName)
Average time taken by an activity which executed successfully within a given flow and app
avg(flogo_activity_metrics{Failed="0"}) by (ApplicationName, FlowName,ActivityName)
Average time taken by an activity which failed within a given flow and app
avg(flogo_activity_metrics{Failed!="0"}) by (ApplicationName, FlowName,ActivityName)
Using Connectors
The TIBCO Cloud Integration- Flogo (PAYG) offers the ability to use connectors that have enterprise support and also connectors that are custom developed extensions.
This section is applicable only if you have uploaded custom extensions for connectors. The Extensions tab displays your uploaded extensions.
To use the TIBCO Flogo connectors, follow these steps:
1. Create one or more connections.
2. If you do not already have an app, create an app.
3. Create a flow.
4. Add the activities pertaining to the connector you use as needed.
5. Build the app.
Creating Connections
You must create connections before using the connectors in a flow. TIBCO Cloud Integration- Flogo (PAYG) uses the configuration provided in these connections to connect to the respective app, data sources, systems, or SaaS.
Make sure that the pop-up blocker in your browser is configured to always allow pop-ups from an app site. On MacOS, clicking the link to the site will result in the connection details page hanging, so make sure to select the radio button for "Always allow pop-ups from <site>."
Prerequisites
You must have valid accounts for the SaaS apps to which you want to connect.
To create a connection, click the Connections tab on the TIBCO Cloud Integration- Flogo (PAYG) page.
If this is the first connection that you are creating, the Connections page displays the connector tiles from which you can create connections. Follow these steps to create a connection using a connector tile:
1. Click the connector tile for which you want to create a connection.
2. Follow the instructions when prompted. .
If you have existing connections and want to add a new connection, do the following from the Connections page:
1. Click Add Connection.
2. Click the connector tile for which you want to create a connection.
3. Follow the instructions when prompted.
Editing or Deleting Existing Connections
You can edit the name and other settings of your connection or delete the connection.
To edit or delete an existing connection, follow these steps:
Procedure
3. Click Edit to edit the connection details or click Delete to delete the connection.
Flows
Each flow represents specific business logic in an app. An app can have one or more flows. A flow contains one or more activities. The flow is activated by a trigger.
You can select a trigger at the time of flow creation (by selecting the Start with a trigger option) or create a flow without a trigger (by selecting Configure flow inputs and outputs) to begin with and add one or more triggers to it any time after the flow has been created.
After you have created the flow, you can test it without having to activate the trigger. See the Flow Tester section for details on using the flow tester.
Creating a Flow
Every app has at least one flow. Use the +Create link on the app page to create the first flow in an app.
If a flow already exists in an app, click the Create button to create additional flows.
Prerequisites
Before creating a flow for connectors, make sure that you have created the necessary connections.
A flow can have multiple triggers. When executing a flow with multiple triggers, you cannot disable a trigger, specify a particular trigger to execute, or specify the order in which the triggers execute. All triggers get initialized in the order that they appear in the flow.
The output of a trigger provides the input to the flow. Hence, it must be mapped to the flow input. In the absence of a trigger, when creating a flow, there must be a well defined contract within the flow which specifies the input to the flow and the output expected after the flow completes execution. You define this contract in the Flow Inputs & Outputs dialog. The Flow Inputs & Ouputs contract works as a bridge between the flow and the trigger, hence every trigger has to be configured to map its output to the Input parameters defined in Flow Inputs & Ouputs.
If any trigger needs to send a response back to a server, its output must be mapped to the output of the Return activity.
Follow these steps to create a flow in an app:
Procedure
1. Click an app name on the Apps page in TIBCO Cloud Integration- Flogo (PAYG) 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.
5. Click New Flow and then click Create.
You will be prompted to select one of the following options:
● Start with a trigger - If you know the trigger with which you want to activate the flow, select this option. You have the option to attach one or more triggers at any later time after the flow has been created. Refer to the appropriate section for the type of trigger that you want to create.
● Configure flow inputs and outputs - Select this option if you know the algorithm for the flow, but do not yet know the circumstances that will cause the flow to execute. Flow inputs and outputs create a contract between the trigger and the flow. When you create a trigger, you must map the output of the trigger to the input to the flow. This contract serves as a bridge between the trigger and the flow.
A flow gets created.The number displayed in the yellow arrow preceding the flow is the number of triggers that are attached to the flow.
Starting with a Trigger
When creating a new flow, if you know the circumstances under which you want the flow to activate, select Start with a trigger and 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.
Creating a Flow with 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 Add a trigger dialog while creating the flow or you can start by using a Swagger-compliant JSON file to create the flow.
You can create a REST flow by entering a JSON schema or dragging and dropping a Swagger-compliant JSON file. See Using a Swagger 2.0 Compliant File 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 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.
5. Select New flow and click Create.
6. Select Start with a trigger.
The Add a trigger dialog opens with all the available triggers showing.
7. Click Receive HTTP Message, the REST trigger.
The Add a trigger dialog opens.
8. 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).
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. 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 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 it at a later time.
The flow page opens with the Input Settings tab of the Flow Inputs & Outputs accordian tab open.
13. Collapse the Flow Inputs & Outputs tab to see the buttons for adding activity in the flow.
14. 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.
15. 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 one at a time.
c) Close the dialog by clicking on the x at its top right corner.
16. Add activites to the flow by hovering your mouse cursor next to the Flow Inputs & Outputs tab and clicking the plus sign.
Creating a Flow with the GraphQL Trigger
You create GraphQL flows by uploading a GraphQL schema file with an extension, .gql or .graphql. TIBCO Cloud Integration- Flogo (PAYG) creates the appropriate flows based on your schema. When the flow gets created, a GraphQL trigger automatically gets generated and attched 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 the TIBCO Flogo® Activities and Triggers Guide for details on the GraphQL trigger.
Creating a Flow with Other Triggers
This section applies to triggers that are not REST or GraphQL triggers.
To create a flow with such a trigger, follow these steps:
Procedure
1. Click an app name in the Apps page in TIBCO Cloud Integration- Flogo (PAYG) to open its page.
2. Click the +Create if this is the first flow in the app or the Create button if a flow already exists in the app.The Create flows and triggers dialog opens.
3. Select New flow.
4. 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.
5. Optionally, enter a brief description of what the flow does in the Description text box and click Create.
6. Select Start with a trigger.
The Add a trigger dialog opens with all the available triggers showing.
7. Click the trigger that you want to add. For non-Timer triggers you will be required to select a connection that you want to use with the trigger.
The flow 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 trigger properties for the trigger. See the respective trigger section in the TIBCO Flogo® Activities and Triggers Guide for details.
10. Add activities to the flow by clicking the + icon next to the Flow Inputs & Outputs tab.
Creating a Flow without a Trigger
When creating a flow in the Flogo App, you can create it without a trigger. This method of creating a flow is useful when the logic for the flow is available but you do not know just yet what action should activate the flow. You can start by creating a flow with the logic and attach one or more triggers to the flow at a later time. To create such a flow select Configure flow inputs and outputs.
The flow details page opens displaying the Input Settings tab of the Flow Inputs & Outputs tab. You create your flow contract in the Flow Inputs & Outputs tab. Follow these steps to create a flow without a trigger:
Procedure
1. Enter a JSON schema containing the input fields to the flow in the Input Settings tab.
2. Enter the JSON schema containing the flow output fields in the Output Settings tab.
3. Click the left facing arrow on top of the blue label when done to retract the Flow Inputs & Outputs page.
4. On creation, the flow contains a Return activity by default. Click and drag the Return activity to the right to make room to add other activities.
5. 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 one or more activities have errors in their configuration, the Errors panel on the lower right of the page shows the number of errors in the flow. Click the Errors panel to see the errors.
Fix the errors before proceeding.
6. 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.
7. 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.
8. 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).
Adding Triggers to a Flow
If you had created a flow without a trigger, you can add one or more triggers to it at any time.
A flow that was created without a trigger has its input and output parameters defined in the Flow Inputs & Outputs dialog 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.
This contract is mandatory, since the flow and the trigger were developed independent of each other and must now interact with each other.
Follow these steps to create a trigger for a blank flow:
Procedure
1. Click the the Add a new trigger icon ( ).
The Add a trigger dialog opens with available triggers displayed.
2. Click a trigger you want to add.
3. Click the trigger icon to configure the trigger. Be sure to map the output of the trigger to the fields in the Input tab of the Flow Inputs & Outputs dialog.
4. Optionally, add additional triggers by clicking the icon and following the steps above.
Creating an Error Handler Flow
You can create a flow specifically to handle errors that you might run into during flow execution. The Error Handler flow works exactly like any other flow. Flow branching is supported in the Error Handler flow as in any other flows.
Refer to Configuring the Error Handler topic for more details on the Error Handler flow.
Synchronizing Schema Between Trigger and Flow
If you make any changes to the schema that you entered when creating the trigger, you must propagate the changes to the flow input and flow output.
To synchronize the schema between the trigger and the flow, do the following:
Procedure
1. Click the trigger to open its configuration details.
2. Click the Sync flow input/output configuration button ( ) on the top right corner.
The trigger output schema is copied to flow inputs and trigger reply schema is copied to flow
Using Subflows
TIBCO Cloud Integration- Flogo (PAYG) provides the ability to call any flow from another flow in the same app. The flow being called becomes the subflow of the caller flow. This helps in separating the common app logic by extracting the reusable components in the app and creating standalone flows for them within the app. Any flow in the app can become a subflow for another flow within the same app.
Also, there are no restrictions on how many subflows a flow can have or how many times the same subflow can be called or iterated in another flow. Hence, subflows are useful when you want to iterate a piece of application logic more than once or have the same piece of logic repeat in multiple locations within the app.
Here are a few points to keep in mind when creating and using subflows:
● The subflow and its calling flow must both reside within the same app. You cannot call a flow from another app as a subflow in your app.
● Subflows must be blank flows (flows without triggers). Flows that were created by starting with a trigger are not supported as subflows. This is because flows created with triggers do not have flow inputs and outputs configured (no Flow Inputs&Outputs tab which acts as the bridge between the subflow and its calling flow). The trigger input and output act as the flow input and output for flows created with a trigger. Hence, there is no bridge to connect the subflow to the Start a SubFlow activity in the calling flow.
● Since you can call any flow from any other flow within the app, you must be careful not to create cyclical dependency where a flow calls a subflow and the subflow in turn calls its calling flow. This will result in an infinite calling cycle and you will receive an error "Cyclic dependency detected in the subflow".
● Important!! You can delete any flow in an app even though the flow might be in use as a subflow within another flow. You will not receive any error messages at the time of deletion, but when you run the app, its exectution fails with an error.
● You can configure the iteration details in the Iterator tab of the Start a SubFlow activity. The Start a SubFlow activity iterates multiple times, resulting in the subflow being called multiple times.
Creating Subflows
You create a subflow exactly like you would create any other blank flow. Flows that were created starting with a trigger are not supported as subflows and will not be available to use as subflows.
To create a subflow, do the following:
Procedure
1. Identify the piece of logic in your app that you want to reuse elsewhere in the app or iterate multiple times.
2. Create a flow without a trigger for that logic. See the Creating a flow without a trigger section for details on how to create such a flow.
3. To use this flow as a subflow within another flow, you must add a Start a SubFlow activity at the location in the calling flow from where you want to call the subflow. For example, if you want to call a subflow after the third activity in your calling flow, insert a Start a SubFlow activity as the fourth activity in the calling flow. To do so, follow these steps:
1. Open the calling flow.
2. On the flow details page, click the ( ) button in the location within the flow from where you want to call the subflow. The Add Activity dialog opens.
3. Click the the Default tab, and select the Start a SubFlow activity.
4. Configure the StartaSubFlow activity to point to the subflow you want to call by selecting the subflow from the Select flow dropdown list in the Configuration tab.
The schemas that you had configured in the Input Settings and Output Settings of the Flow Inputs&Outputs tab in the selected subflow appear in the Input and Output tabs of the StartaSubFlow activity.
You can now configure the input and output for the subflow in the StartaSubFlow activity. If you add additional input and/or output parameters in the Flow Inputs & Outputs tab of your subflow, they become available to configure from the Input and/or Output tabs of the
StartaSubFlow activity. The output from the StartaSubFlow activity is available for use as input in all activities that are appear after it.
At app runtime, the Start a SubFlow activity in the calling flow calls the selected subflow.
5. If you want your subflow to iterate multiple times, be sure to configure the iteration details in the Iterator tab of the StartaSubFlow activity. Refer to the Using the Iterator section for details on how to configure the Iterator tab.
6. Build the app. See Building the App section for details on how to build the app.
Creating a Flow Execution Branch
Activities in a flow can have one or more branches. If you specify a condition for a branch, the branch executes only when the condition is met. You also have the option to create an error branch from an activity. The purpose of the error branch is to catch any errors that might occur during the execution of the activity. Branching is also supported for Error Handler flows, which serve the purpose of catching all errors at the flow level.
You cannot create a branch from a trigger or a Return activity.
A Return activity ends the flow execution. So, regardless of whether the flow execution encounters a Return activity in a branch or at the end of the flow itself, as soon as the flow execution encounters a Return activity anywhere, it exits the flow.
Procedure
1. From the Apps page, click the app name then click the flow name to open the page for the flow.
2. Hover your mouse cursor over the activity to expose the icons for adding a branch and deleting the activity in the bottom right of the tile.
3. Click the Add Branch icon ( ).
A branch gets created and the Add Activity dialog opens.
4. Add activities to the branch flow as you would do to any other flow by clicking on the button.
5. If you want the flow execution to terminate after this branch executes successfully, be sure to configure the Return activity at the end of the branch. If you do not want the flow exectution to terminate, be sure to delete the Return activity from the end of the branch.
6. Hover your mouse cursor to the end of the branch until you see a button with three dots placed
7. Click the button to expose the following options:
8. Click the branch settings button ( ).
The Branch Mapping Settings dialog opens.
9. Select a branch condition: Success, Success with condition, or Error.
See the section, Types of Branch Conditions, for details on the three conditions.
10. Click Save.
11. Add condition to a branch as need be. See Setting Branch Conditions for details.
Types of Branch Conditions
TIBCO Cloud Integration- Flogo (PAYG) supports three types of branch conditions.
You must select one of the following conditions during branch creation:
● Success
A success branch gets executed whenever an activity executes successfully. If there is an error in the activity execution, this branch does not execute. The branch has no conditions set in it.
● Success with condition
Select this condition type, if you want a branch to execute only when a particular condition is met. If you select this condition and do not provide the condition, the branch never gets executed.
● Error
A branch with this condition executes if there are errors in the execution of the activity. An activity can have only one Error branch. The Error branch flow differs from the error handler flow in that the error branch is designed to catch exceptions at the activity level from which it originates, whereas the error handler flow is designed to catch exceptions that occur in any activity within the flow. So, if you handle the errors by creating an error branch at the activity level, the flow execution control never transfers to the error handler flow.
Setting Branch Conditions
You can set conditions on a branch such that only if the condition is met the branch will execute.
To set conditions on a branch, follow these steps:
Procedure
1. Hover your mouse cursor to the end of the branch until you see a button with three dots placed horizontally.
2. Click the button to expose the following options:
3. Click ( ).
The Branch Mapping Settings dialog opens.
4. Select a branch condition: Success, Success with condition, or Error.
See the section, Types of Branch Conditions, for details on the three conditions.
5. Click Save.
6. If you selected Success with condition, the mapper opens for you to set the condition. Click condition.
The mapper is exposed to the right of the dialog. The functions that you can use to form the condition are shown under Functions.
7. Enter an expression with the condition or click a field from the output of a preceding activity to use it. The output from preceding activities appears under the left Upstream Output in a tree format.
The condition must resolve to a boolean type.
The following image shows how the branches appear based on the branch condition:
Deleting a Branch
You can delete a branch at any time after creating it.
To delete a branch follow these steps:
Procedure
1. Hover your mouse cursor to the end of the branch until you see a button with three dots placed horizontally.
2. Click the button to expose the following options:
3. Click ( ).