The SOCKET opens a websocket between the application and an API that can both send and receive calls continuously.
Restrictions:
A SOCKET should only be used when interactive communication is needed between the server and client. For fewer calls or pollable options, try GET and POST datasources.
The root tag that the broker will look in data returned. This can be a nested field
body
string
null
The outer wrapper of the posting document tags. Used as an XML tag when defining a document manually, or attribute when creating the body automatically via a FORM
autoexecute
bool
true
If the widget will fire when the template is first opened or on url change
autoquery
int(s,m,h)
null
If set the broker fires on a timer set by the autoquery
tti
int(s,m,h)
5s
The time the Datasources status will stay as anything but idle.
Attributes (Data Specific)
Name
Type
Default
Description
Req
data
List of item where item is a Map<String, String> or another List of item
If the response is encoded as valid json or xml it is deserialized and addressable using DOTNOTATION
queueType
string
replace
replace, lifo, fifo, append, prepend. Defines the data aggregation strategy for data returned from initial and subsequent calls. replace (default) replaces all data after each subsequent call. lifo (last in first out), fifo (first in first out), append and prepend are all used in conjunction with the maxrecords attribute
maxrecords
int
10000
The maximum size data can grow to. This works in concert with type
root
string
The root tag that defines the repeatable items in data. This can be a nested field. If not specified, the list is segmented by the first repeatable element found in the data set
ttl
int(s,m,h)
0s
Time to Live caches data in the local persistent HIVE database for the period specified. This saves requerying data that changes infrequently
rowcount
int
0
The number of records in data
Methods (Data Specific)
Name
Type
Description
clear()
Clears data. Invoked in any EVENT string using <id>.clear()
add(jsonOrXml, index)
string, int
Deserializes the jsonOrXml string and adds it to the end of data or at position index if specified. Invoked in any EVENT string using <id>.add(jsonOrXml, index)
remove(index)
int
Removes the last item from data or from position index if specified. Invoked in any EVENT string using <id>.remove(index)
reverse()
Reverses data. Invoked in any EVENT string using <id>.reverse()
The string of events the broker will execute on each and every message received
onsuccess
string
null
The string of events the broker will execute when the socket is closed and the close code is 1000.
onfail
string
null
The string of events the broker will execute when the socket is closed and the close code is not 1000.
onconnected
string
null
The string of events the broker will execute when the connection is successfully opened
ondisconnected
string
null
The string of events the broker will execute when the connection is successfully closed
onerror
string
null
The string of events the broker will execute when a connection error is detected
Headers
Web sockets do not allow for HTTP <HEADERS>. <HEADERS> tags are ignored. If data needs to be passed to the endpoint when the SOCKET connection is first established, use standard uri parameters in the url attribute.
Example #1
This example demonstrates how to omit all headers.