TIBCO Spotfire Automation Services Adapter Samples

About The Samples

This sample demonstrates the use of the TIBCO StreamBase® Output Adapter for TIBCO Spotfire® Automation Services. The Spotfire Automation Services output adapter sends a Job XML payload via a SOAP 1.1 request to a specified Spotfire automation services URL. The samples require that you have a running Spotfire automation service that is accessible from StreamBase. The samples also require that you have a working Job XML file to be sent to the server.

The LaunchAndStatus sample allows you to launch a job and save the inputted information for later requests of job status.

The LaunchAndStatusLoop sample will launch a job and with the output tuple JobId will request the job status each second until the job is complete. The output of each sample can be passed on to downstream components for further processing.

Importing This Sample into StreamBase Studio

In StreamBase Studio, import this sample with the following steps:

  • From the top-level menu, select File>Import Samples and Community Content.

  • Enter to spot narrow the list of options.

  • Select TIBCO Spotfire Automation Services, StreamBase output adapter from the Other TIBCO Product Connectivity category.

  • Click Import Now.

StreamBase Studio creates a single project containing the sample files.

Running The Samples in StreamBase Studio

  1. In the Project Explorer view, open the sample you just loaded.

    If you see red marks on a project folder, wait a moment for the project to load its features.

    If the red marks do not resolve themselves after a minute, select the project, right-click, and select Maven>Update Project from the context menu.

  2. Open the src/main/eventflow/packageName folder.

  3. Open the LaunchAndStatus.sbapp or LaunchAndStatusLoop.sbapp example.

  4. Select the Parameters tab in the EventFlow Editor and change the SpotfireURL to the base URL of your Spotfire automation services. Update the ClientId and ClientSecret parameters to the values for your Spotfire connection.

  5. Select the SpotfireJob component in the EventFlow Editor and copy and paste your Job XML into the Job XML field of the Adapter Properties. The samples come with some example Job XML which should be replaced with your Job XML. The example XML shows how you can use the ReplacementFields of an incoming tuple to dynamically change the XML for each request to the automation service, notice the $[ParameterFieldX] fields. The parameter fields can be any name so long as they match a sub field name of the ReplacementFields incoming tuple.

  6. Click the Run button. This opens the SB Test/Debug perspective and starts the module.

  7. For the example, in the Manual Input view, click Send Data to send the default null tuple. You may also fill in values for each sub field of the ReplacementFields field and click Send Data to see how fields are replaced in the Job XML.

  8. In the Output Streams view, observe tuples emitted on the JobStatus output streams. For the LaunchAndStatusLoop.sbapp you will notice an initial status tuple and then a tuple each second with the job status until the job has completed on the server. For the LaunchAndStatus.sbapp you can manually input a tuple into the StatusInput input stream to check for the current jobs status.

  9. Press F9 or click the Terminate EventFlow Fragment button.

Sample Location

When you load the sample into StreamBase Studio, Studio copies the sample project's files to your Studio workspace, which is normally part of your home directory, with full access rights.

Important

Load this sample in StreamBase Studio, and thereafter use the Studio workspace copy of the sample to run and test it, even when running from the command prompt.

Using the workspace copy of the sample avoids permission problems. The default workspace location for this sample is:

studio-workspace/sample_adapter_embedded_spotfire_automation_services

See Default Installation Directories for the default location of studio-workspace on your system.