Datatable and Spectrum Dataflow integration
Last updated
Last updated
This tutorial describes how to integrate a DatatableDatatableDatatable with a Spectrum Dataflow. It is a simple HelloWorld application that performs a roundtrip from Buzzy to Spectrum and back. It takes as input a name string (iName) and returns Hello and the name string (oResponse).
Something to take note of, is the JSON Body. The first two elements are the InputStageName and InputDataType which are always “Input” and “Row”.
Another important note, is to make sure that the dataflow webservice option is set to allow POST with a JSON body:
Start the Spectrum Enterprise Designer
Create a new Dataflow that is a service
Add an input stage
In the input stage add the input fields:
iName as a string
rowID as a string
Add a Transformer stage. In the Transformer stage Construct a field as Hello ${iName}
. Save the field as oResponse.
Add an output stage. Output the field oResponse.
Save the Dataflow as HelloBuzzy. Be sure the enable execution and set web service options for POST
Create a new Request
Enter the URL for the REST service. For example: http://m4800.local:8080/rest/HelloBuzzy/results.json
Change method to POST
Change authorization to Basic and add Spectrum username/password
Enter the JSON body:
Select Send
. This should produce output like this:
The following shows the example in Postman:
Buzzy allows you to create simple forms or complex reporting applications, with workflows and location intelligence. These apps and forms are known as Buzzes and are built using a comprehensive set of components. One of these components is the Application content known as a Datatable that are mini-apps inside Buzzy - use these to build forms, manage data and add interactivity.
To create the HelloBuzzy application:
Log into Buzzy server
Create new Buzz using Blank Template
Change Title to HelloBuzzy
Publish Draft
Add Content Application
Select Submit and change Submit Form Display to Modal form
Select Fields
Add Text Field iName
Add Text Field oResponse
Select Advanced and then Rules
Add Rule for Element [Row]
Select Condition submitted (created)
Select Action and Send JSON
Enter API URI
Select Type POST
Enter User and Password
Enter JSON Body:
18. Select Add Rule
So far, we have created the Buzzy app to enter a name and dispatch a request to Spectrum to generate a response. We will now complete the HelloBuzzy Dataflow to respond to Buzzy. The response content is in JSON format and contains the Datatable database row identifier and field data. The row contains all the information required to update the correct Buzz and Datatable.
The Aggregator stage is used in the data flow to combine the row and field information into the correct data structure.
HelloBuzzy exported Data Flow:
Spectrum provides a REST interface to web services. User-defined web services, which are those created in Enterprise Designer as Dataflows, support GET and POST methods. To integrate Buzzy with Spectrum dataflows use the REST interface with the POST method and JSON body. More information can be found in the .
The Spectrum Enterprise Designer is a visual tool for creating dataflows. More information can be found in the . In this tutorial we will create a simple dataflow that accepts data from a web service call, processes the data, and returns a response. Since this dataflow is intended to be exposed as a service on the Spectrum server, it is a service dataflow.
Note: An optional Transformer can be added to the flow to enable debugging. This transform uses Groovy Script to output to the Spectrum log file. See for an example.
To validate the web service HelloBuzzy, use a test application. For this example, we will use Postman. It can be downloaded from .
A custom transform is then used to send the update back to the Buzzy server. provides sample Groovy Script code. Note that server and user information will need to be changed for your specific installation.