Spotfire Automation Services Output Adapter

Introduction

The TIBCO StreamBase® Output Adapter for TIBCO Spotfire® Automation Services is used to post job execution, launch, and status requests to a TIBCO Spotfire® Automation Services server. The adapter will post a SOAP 1.1 request to the automation service for each tuple that is received.

The adapter has multiple samples, described in TIBCO Spotfire® Automation Services Adapter Samples.

Adapter Properties

This section describes the properties you can set for this adapter, using the various tabs of the Properties view in StreamBase Studio.

General Tab

Name: Use this field to specify or change the component's name, which must be unique in the application. The name must contain only alphabetic characters, numbers, and underscores, and no hyphens or other special characters. The first character must be alphabetic or an underscore.

Adapter: A read-only field that shows the formal name of the adapter.

Class: A field that shows the fully qualified class name that implements the functionality of this adapter. Use this class name when loading the adapter in StreamSQL programs with the APPLY JAVA statement. You can right-click this field and select Copy from the context menu to place the full class name in the system clipboard.

Start with application: If this field is set to Yes or to a module parameter that evaluates to true, an instance of this adapter starts as part of the containing StreamBase Server. If this field is set to No or to a module parameter that evaluates to false, the adapter is loaded with the server, but does not start until you send an sbadmin resume command, or until you start the component with StreamBase Manager. With this option set to No or false, the adapter does not start even if the application as a whole is suspended and later resumed. The recommended setting is selected by default.

Enable Error Output Port: Select this check box to add an Error Port to this component. In the EventFlow canvas, the Error Port shows as a red output port, always the last port for the component. See Using Error Ports and Error Streams to learn about Error Ports.

Description: Optionally enter text to briefly describe the component's purpose and function. In the EventFlow canvas, you can see the description by pressing Ctrl while the component's tooltip is displayed.

Adapter Properties Tab

Property Description
Log Level Controls the level of verbosity the adapter uses to send notifications to the console. This setting can be higher than the containing application's log level. If set lower, the system log level is used. Available values, in increasing order of verbosity, are: OFF, ERROR, WARN, INFO, DEBUG, TRACE, and ALL.

Connection Properties Tab

Property Description
Spotfire URL (string) The base URL of the Spotfire automation service. This URL should be the full URL to the automation services. An example would be: http://localhost:81/spotfireautomation/
Connection Timeout (int) The time out value in milliseconds to wait until the adapter stops waiting for a response from the Spotfire automation service. Set this value to 0 to disable the time out.
Authentication (radio) Controls if authentication is used when communicating with the Spotfire automation service.
Username (string) The user name to send when authentication is required.
Password (string) The password to send when authentication is required.
Use Proxy (checkbox) Controls if a proxy will be used to connect.
Proxy Host (string) The host to use when connecting via a proxy.
Proxy Port (int) The port to use when connecting via a proxy.

Spotfire Properties Tab

Property Description
Service Type (drop-down list) Controls which service request will be sent to the Spotfire automation service. The service types are: Execute Job, Launch Job, and Job Status
Job Id (string) The Job Id to request status for from the automation service. This option is available when the service type is Job Status.
Job Source (radio) This option specifies how the Job XML data will be loaded into the adapter. If File is selected the Job File Name field will be enabled to select which file is sent. If Job XML is enabled you can paste the Job XML data directly into the Job XML parameter field.
Job File Name (string) The full path to the file which contains the Job XML data to send to the Spotfire automation service. This option is enabled when Job Source is set to File.
Job XML (string) The full Job XML data to send to the Spotfire automation service. This option is enabled when Job Source is set to Job XML.

Concurrency Tab

Use the Concurrency tab to specify parallel regions for this instance of this component, or multiplicity options, or both. The Concurrency tab settings are described in Concurrency Options, and dispatch styles are described in Dispatch Styles.

Caution

Concurrency settings are not suitable for every application, and using these settings requires a thorough analysis of your application. For details, see Execution Order and Concurrency, which includes important guidelines for using the concurrency options.

Description of This Adapter's Ports

The Spotfire Automation Services adapter's ports are used as follows:

  • Control (input): Tuples enqueued on this port cause the adapter to send a request to the Spotfire automation service. The schema for this port has the following field:

    • (Optional) ReplacementFields, tuple, a tuple which contains zero to many sub fields which will be matched to parameters in the Job XML.

    • (Optional) SpotfireURL, string, the base Spotfire URL to send requests to. If null, the URL is taken from the adapter's Spotfire URL property.

    • (Optional) JobId, string, the Job Id to request status for from the automation service. If null, the JobId is taken from the adapter's JobId property. This parameter is only used when the Service Type is set to Job Status.

    • (Optional) JobXML, string, the complete Job XML data to send to the Spotfire automation service. If null, the JobXML is loaded depending on the Job Source property. This parameter is only used when the Service Type is set to Launch Job or Execute Job

    • (Optional) JobFileName, string, the complete path to the file to load the job XML data to send to the Spotfire automation service. If null, the JobXML is loaded depending on the Job Source property. This parameter is only used when the Service Type is set to Launch Job or Execute Job

    • (Optional) ConnectionTimeout, int, The timeout value to use for this connection.

  • Data (output): Tuples are emitted on this port when a service request is completed. The schema for this port has the following fields:

    • Status, string, The status received back from the Spotfire automation service.

    • Message, string, The message received back from the Spotfire automation service.

    • JobId, string, The Job Id associated with the request.

    • InputTuple, tuple, A copy of the tuple inputted on the control port.

  • Status (output): The adapter emits tuples from this port when significant events occur, such as when an attempt to read a Spotfire automation service page fails. The schema for this port has the following fields:

    • type, string: returns one of the following values to convey the type of event:

      • Read

      • UserInput

    • Action, string: returns an action associated with the event Type:

      • Failed

      • Rejected

    • Object, string: returns an event type-specific value, such as the Spotfire URL for which a read failed or the control input tuple that was rejected.

    • Message, string: Returns a human-readable description of the event.

Using Replacement Fields

The Spotfire Automation Services adapter allows you to add parameterized fields into your Job XML which will be replaced during runtime with values of the incoming tuple.

To use replacement fields you need to edit your Job XML and add in any parameters you need in the format $[ParamName]. You must also then edit your input schema and add sub fields to the ReplacementFields field with the same name as your ParamName. You may add as many fields to ReplacementFields as needed, each parameter found in the Job XML will be matched to a sub field in the ReplacementFields and that value will be used to replace the parameter.

Typechecking and Error Handling

The Spotfire Automation Services adapter uses typecheck messages to help you configure the adapter within your StreamBase application. In particular, the adapter generates typecheck messages for the following reasons:

  • The input schema does not contain a field named ReplacementFields of type tuple on the input schema.

  • The Spotfire URL is empty no SpotfireURL value is provided on the input schema.

  • The service type is set as Job Status and the Job Id is empty no JobId field is provided on the input schema.

  • The service type is set as Execute Job or Launch Job and the Job Source is set to File and the Job File is empty or invalid and no JobFile field is provided on the input schema.

  • The service type is set as Execute Job or Launch Job and the Job Source is set to Job XML and the Job XML is empty and no JobXML field is provided on the input schema.

The adapter generates warning messages during runtime under various conditions, including:

  • A control tuple is received with a null value in its SpotfireURL field and a value for the adapter's Spotfire URL property has not been specified.

  • A control tuple is received with a null value in its JobXML field and the JobFileName field and a value for the adapter's Job XML property and Job File Name has not been specified. This message means no Job XML can be loaded from any source.

  • A control tuple is received with no field named 'ReplacementFields'.

  • A control tuple is received and the adapter is unable to connect to the SpotfireURL or process the job.

Related Topics