TIBCO ModelOps Integration with TIBCO Spotfire

Contents

Overview

This page explains how TIBCO ModelOps Scoring flows can be used as data functions in TIBCO Spotfire. Data Functions provide a mechanism in Spotfire to delegate computation to an external agent. TIBCO ModelOps provides extensions (that can be added to a Spotfire installation) to allow Spotfire users to score data using TIBCO ModelOps scoring flows through the data functions framework. Once these extensions are installed, users can author TIBCO ModelOps data functions in Spotfire Analyst and execute TIBCO ModelOps data functions through TIBCO Cloud™ Spotfire® Analyst and TIBCO Silver® Fabric Enabler for Spotfire® Web Player.

Requirements

TIBCO ModelOps data functions are supported with:

  • TIBCO Spotfire 11.4.0 LTS or higher
  • TIBCO ModelOps 1.2.0 or higher

Authoring TIBCO ModelOps Data Function

To use a TIBCO ModelOps scoring flow from TIBCO Spotfire, a TIBCO ModelOps data function must be registered or authored first. Authoring data functions is only supported in Spotfire Analyst.

  1. To register a data function, select the Register data functions… item from the Tools menu in Spotfire Analyst.
  2. The Register Data Functions dialog box opens.
  3. Add name for the data function.
  4. Select TIBCO ModelOps data function as the type.
  5. Optionally, provide a description of the data function.
  6. Select the Allow caching option to reuse result values when computed for the same subset of input values as before.
  7. Specify the TIBCO ModelOps server containing the scoring flow to be used in the data function.
  8. If you have not previously connected to this server in the current Spotfire session, click Connect. You are prompted for credentials to connect to the server.
  9. Upon successfully connecting to a TIBCO ModelOps server, the projects available to the user (whose credentials were used to connect) are be listed. Selecting a project populates the scoring flows in the following field.
  10. Select the scoring flow to be used for the data function.
  11. Select the target environment in which the scoring flow must be run when the data function (using the scoring flow) is executed.
  12. After selecting the server, project, scoring flow, and target environment, click Run to create a data function (and configure the input and output parameters).

TIBCO ModelOps data functions are created with one input parameter (named Input) of type Table and one output parameter (named Output) of type Table. These parameters have to be configured before a data function can be executed. The input parameter maps to the input step of the scoring flow and the output parameter maps to the output step of the scoring flow.

Related Tasks

TIBCO ModelOps Data Function Execution

The execution of TIBCO ModelOps data functions embedded in a Spotfire Analysis Document (DXP) is supported on Spotfire Analyst and Spotfire Web Player. As with other types of data functions in Spotfire, after a TIBCO ModelOps data function has been created, the input and output parameters have to be configured (using the Edit Parameters dialog) before the data function can be used. See Configuring Data Function Parameters for details.

TIBCO ModelOps data functions have one input parameter (named Input) of the type Table, which is mandatory. In the Edit Parameters dialog box, use the Input tab to specify the data to be sent to the TIBCO ModelOps scoring flow as input (see Figure-2). To specify the columns to be used for constructing the input Table, select Columns in the Input Handler list and then click Select Column….

TIBCO ModelOps data functions have one output parameter (named Output) of the type Table. In the Edit Parameters dialog, use the Output tab to specify the table into which output data from the TIBCO ModelOps scoring flow must be received. This can be done by selecting Data table in the Output Handler list and then specifying a table into which data must be received. The specified table could either be a new one or an existing one.

As with other data functions, TIBCO ModelOps data functions have to be trusted by users who belong to the Script Authors group before they can be run on Spotfire Web Player. See Script and Data Function Trust for more details.

TIBCO ModelOps-specific Data Function Execution Details

TIBCO ModelOps data function definition contains a reference to a TIBCO ModelOps scoring flow. When a TIBCO ModelOps data function has to be run, the TIBCO ModelOps data function executor checks if there is a TIBCO ModelOps REST scoring pipeline associated with the data function for the currently open Spotfire Analysis Document session. If one is not available, then:

  • a scoring pipeline using the scoring flow specified by the data function is created into a new project
  • the newly created scoring pipeline is deployed as a REST scoring pipeline
  • the newly created project and any artifacts therein are deleted
  • the deployed scoring pipeline information is cached and associated with the data function for the lifetime of the Spotfire Analysis Document

After a REST scoring pipeline is available (either through creation or through the cache), the input data configured into the Input parameter of the data function is sent for scoring into the REST pipeline. After data is scored and received from the pipeline, it is written back into the Output parameter of the data function.

After the Spotfire Analysis Document lifetime ends (e.g., the user session expires, or the user closes the document), scoring pipelines associated with the data functions are shut down.

NOTE: For a given TIBCO ModelOps data function, a scoring pipeline is deployed for every unique user session. This implies that the scoring pipeline is not shared across users trying to score the same data function. It also implies that if the same user is attempting to run a TIBCO ModelOps data function from different user sessions (say from Spotfire Analyst and Spotfire Web Player), the scoring pipeline for the data function execution is not shared.

Spotfire-ModelOps Type Mapping

While sending and receiving data to and from a TIBCO ModelOps scoring pipeline, the mapping between Spotfire data types and supported field types in TIBCO ModelOps Scoring Pipelines is as follows:

Spotfire Data Type Open API Type Open API Format Comments
Boolean boolean
Integer integer int32
LongInteger integer int64
Real number double
SingleReal number float
String (UTF-8 encoding) string
Date string date
DateTime string date-time
N/A array Not supported
N/A object Not supported
Binary N/A Not supported
Currency N/A Not supported
Time N/A Not supported
TimeSpan N/A Not supported

The names and types of the columns configured into the Input parameter (of type Table) are expected to match the schema (names and types) of fields expected in the Input block of the scoring flow used to create the data function.

The names and types of the columns of the Output parameter (of type Table) is set based on the data received from the scoring pipeline (which matches the schema of the Output block of the scoring flow).

Related general information on data function execution:

Miscellaneous TIBCO ModelOps Data Function Details

TIBCO ModelOps data functions that are registered (and embedded) into the Spotfire Analysis document (DXP) can be viewed in the Data Function Properties dialog (accessible through the Data menu in Spotfire). Using this dialog, ModelOps data functions can be edited, (re-)configured, saved to the Spotfire Library, and imported from the Spotfire Library.

Installing ModelOps Extensions

You can add packages to a deployment area by using TIBCO Spotfire Server. To install TIBCO ModelOps extensions to a TIBCO Spotfire installation, follow the instructions in Adding software packages to a deployment area.

The distribution file for TIBCO ModelOps extensions packages for Spotfire can be downloaded here. For general details on support diagnostics and logging see here. TIBCO ModelOps extensions create a log in the same location as Spotfire Analyst.