Defining An On Event Request/Reply Flow

Use a TIBCO Cloud™ Integration - Connect Request/Reply flow to use data from any TIBCO Cloud™ Integration - Connect Connection with another application, if that application can call a REST API.

Performance

Each app containing one or more Request/Reply flows is bound to a single TIBCO Cloud™ Integration - Connect agent which limits the number of requests that can be processed. In addition, you should be aware of the following restrictions when using Request/Reply:

Exceeding these limits could trigger governance thresholds causing automatic controls in TIBCO Cloud™ Integration - Connect to restrict your IP address. If you find that your IP address has been restricted, contact Support to request that the restriction be lifted. See section 9 of the TIBCO Cloud Service Terms.

Tips

Request/Reply Example

For example, assume you have a custom application and you want that application to add new leads to a Dynamics CRM account. With a Request/Reply flow, you can:

  1. Design the schema for your input fields in the Wait For Request Block, such as the Name, Address, and Phone fields for the lead.
  2. Define the schema for the fields you want returned in the Build Reply Block. In this example it might just be a Boolean value that says whether the lead was successfully created in Dynamics CRM.
  3. Add the Endpoint URL generated in the Wait for Request block to the part of your source code or application that sends the leads. The code for your custom application also requires a web request body that provides values for the fields you designed in the Wait for Request block. See Request/Reply Flow Example. For more information on how to format the request body, see the JSON.org site.
  4. Write code in your custom application that parses the body of the web reply and retrieves any return values. See Request/Reply Flow Example. For more information on how the reply body is formatted, see the JSON.org site.
  5. Write code in your custom application that sends a lead again if no web reply is received from TIBCO Cloud™ Integration - Connect.

As illustrated below, the request pings the TIBCO Cloud™ Integration - Connect cloud endpoint, which is a unique URL for each flow. The flow runs and TIBCO Cloud™ Integration - Connect sends a reply to your agent with the data returned by the flow.

Event Solution Request/Reply process

Tip: Using the TIBCO Cloud™ Integration - Connect API you can generate an OAS 2.0 document for a Request/Reply flow. This can be helpful when configuring the outbound message in the application sending messages to TIBCO Cloud™ Integration - Connect. See Generate An OAS Document For Request/Reply Flows.

To use a Request/Reply flow within an On event app, you need to:

Using Build Reply And Send Reply Blocks

For Request/Reply flows the Build Reply Block and Send Reply Block display in the Connections panel on the flow canvas. While these Blocks are optional, they may provide useful information.

Note: For an example of a Request/Reply flow using two Build Reply blocks to create a hierarchical reply, see Request/Reply Flow Example.

Creating Flows

When you open a flow the Connections panel and workspace display. The Connections panel contains all of the blocks required to easily create flows used to integrate your source data into one or more target datastores. To build your flow, move the blocks into the workspace.

Each time you save your flow a separate revision of the flow is stored. Before saving, enter a comment in the Comment field at the bottom of the workspace to associate a comment with the new revision. You can go back to a prior revision from the Revisions dialog. See Flow Revisions for additional information.

Selecting Connections

Each Connection in a flow can be used for both Source and Target operations based on what the Connector and the associated datastore support. For example, if you have a Salesforce Connection and you use a Query block for that Connection in the flow, the Query is a Source operation, therefore, Salesforce is the Source for that block. If you use a Create block for the Salesforce Connection in the flow, Create is a Target operation, and Salesforce is the Target for that block.

Connections are sorted based on the order in which they were added to the flow. The color of the blocks associated with a Connection is determined by the order of the Connections. Control blocks are always light purple, the first Connection Blocks are always orange, and Blocks for the second Connection are yellow, and so on up to eleven Connections.

TIBCO Cloud™ Integration - Connect supports multiple target datastores in Integration flows. You can integrate data from one source into multiple targets. For example, while integrating your Microsoft Dynamics GP data into Salesforce, you can also send data from the same run to a CSV Text file for reporting purposes. Add Connections to a flow to connect to one or more target datastores.

The first step is to select or create Connections in the Connections panel on the left side of the flow. From the Connections panel, you can either:

As soon as a valid Connection is selected, all of the blocks supported by the Connection display in the Connection panel.

Starting A Flow

After you select your Connections, you can begin to create a flow. A flow is a visual representation of the instructions needed to integrate your data. For Message flows, the flow must start with a Wait For Request Block.

  1. From the Connections panel, select the Wait For Request block associated with the Connection you want to use as a data source and drag it to the workspace.
    Note: As you drag and drop blocks, the top border always changes color. If the color of the block is transparent, you have not attached it correctly to the previous block and the flow does not run.

    When you first drag blocks over, they often display an error in the corner. This is expected because the block is missing important configuration information, such as the entity you want to use.

  2. Select the Wait For Request block.
  3. Select the Request link in the Properties panel to open the Wait For Request Block Properties.
  4. Enter your input fields as described in Wait For Request Block.
  5. When you are done configuring request schema, save your flow.
    Note: After saving the flow the first time, TIBCO Cloud™ Integration - Connect generates a unique Endpoint URL which displays on the Block Properties — General tab of the Wait For Request block. This may take a few minutes.

    You must copy and paste the Endpoint URL into the code in the application sending the request to TIBCO Cloud™ Integration - Connect.

    You can also use the Endpoint URL to generate an OAS document. See Generate An OAS Document For Request/Reply Flows.

    Endpoint URL

  6. Continue adding blocks to your flow. Unlike a regular flow, the For Each Result block is not required or available.

    As you build your flow, keep in mind that you only define the processing for one record at a time. If a request message contains multiple records, your flow runs once for each record.

Adding More Blocks

  1. Once you have added the Wait for Request block, you can drag and drop the blocks you need from the Connections panel.
  2. As you add blocks to your flow, use the links in the Properties panel to access and configure the Block Properties dialog for each block. The information available on the Properties dialog depends on the specific block.
    Note: Fields and entities available in one block can access the values returned in preceding blocks.
  3. Select Apply to save the flow in its current state. You must save the flow before debugging. See Debugging Flows.
  4. Continue to add blocks as needed. See Working With Blocks.

Additional Steps

Configure your source datastore or application code to call the Endpoint URL shown on the General tab of the Wait For Request block.

Note: String values sent in a Request to a TIBCO Cloud™ Integration - Connect Request Reply flow must be in quotes, such as, “ABC” not ABC.

Set Security Rules

From the Security dialog under Environment & Tools > Security Settings, specify the security rules for the On event apps in this Organization.

Note: When an On event app runs, TIBCO Cloud™ Integration - Connect sends a response to Messages or Requests for data from any one of three static IP addresses. Configure your Proxy Server, Firewall, or other network security devices to allow responses from these IP addresses to access your network. Static IP Addresses include: 
  • 54.204.16.213
  • 54.83.47.195
  • 23.23.251.57