0% found this document useful (0 votes)
11 views157 pages

TIB BW 6.9.1 Rest Reference

The TIBCO ActiveMatrix BusinessWorks REST Reference document provides comprehensive guidelines on using REST APIs, including definitions of key concepts such as resources, operations, endpoints, and Swagger specifications. It covers parameter support, conversion between Swagger and XML, and detailed instructions for creating and managing REST services and references. Additionally, the document includes tutorials, security policies, and exception handling to assist users in effectively implementing RESTful services in TIBCO BusinessWorks.

Uploaded by

osakas
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views157 pages

TIB BW 6.9.1 Rest Reference

The TIBCO ActiveMatrix BusinessWorks REST Reference document provides comprehensive guidelines on using REST APIs, including definitions of key concepts such as resources, operations, endpoints, and Swagger specifications. It covers parameter support, conversion between Swagger and XML, and detailed instructions for creating and managing REST services and references. Additionally, the document includes tutorials, security policies, and exception handling to assist users in effectively implementing RESTful services in TIBCO BusinessWorks.

Uploaded by

osakas
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 157

TIBCO ActiveMatrix

BusinessWorks™
REST Reference
Version 6.9.1
May 2023

Copyright © 2023. Cloud Software Group, Inc. All Rights Reserved.


2 | Contents

Contents
Contents 2

What is REST? 6
What is a Resource? 6
What is an Operation? 7
What is an Endpoint? 7

What is Swagger? 8
The Swagger UI 8
Viewing Multiple REST Services in Swagger UI 8

Parameter Support 9
Conversion between Swagger and XML in TIBCO Business Studio for
BusinessWorks 9
Working with Path and Query Parameters 19
Adding or Editing Path Parameters 21
Adding or Editing Query Parameters 22
Working with Arrays 23
Working with Form Parameters 26
Creating Form Parameters 27
Working with Header Parameters 28

About REST Services and References 30

Supported Message Formats 31

Restrictions 32
Restrictions on JSON 32
Restrictions on XML Schema 33

TIBCO ActiveMatrix BusinessWorks™ REST Reference


3 | Contents

Using Swagger 1.2 Files 34

Using Swagger 3.0 Files 35

REST Schema Utilities 37


Creating a New XML Schema File 37
Creating an XML Schema from a JSON Payload 37
Generating an XML Schema from a Swagger File 38

Importing an API Model into your Workspace 40

REST Service 43
REST Service Binding 43
Accept Header Responses 54
Creating a REST Service 56
Using Swagger to Create a REST Service 56
Using the Wizard to Create a REST Service 57
Rest Service Wizard 61
Using JSON Payload or an Existing XSD File 63
REST Service Tutorial 63
Installing PostgreSQL 64
Creating a New Process 65
Building a REST Service 68
Testing the REST Service 74

REST Reference 84
REST Reference Binding 84
Dynamic Invocation of a REST Service 93
Invoke Activity for Rest Reference 93
Creating a REST Reference 100
Using Swagger to Create a REST Reference 100
Using the Wizard to Create a REST Reference 101
REST Reference Wizard 104

TIBCO ActiveMatrix BusinessWorks™ REST Reference


4 | Contents

Changing the Request and Response Schemas 105


Synchronizing the Imported REST API Models in TIBCO Business Studio for
BusinessWorks 106
Using the Debug Engine 106
Creating the Reference 108
To make your reference application portable 109
REST Reference Tutorial 110
Creating a New Application 110
Importing the JSON File into your Project 111
Creating the REST Reference 111
Testing the REST Reference 113

Creating Multiple Response based REST Service/Reference 115

Refactoring a REST Service or Reference 120


Updating Configuration 121
Adding an Operation 121
Adding an Operation After the REST Reference is Created 122
Adding or Deleting Parameters 123

OSGI Commands to List REST URLs 124

Exception Handling 125


Creating Faults 125
Using the Catch and Activities 127
Adding Details to Error Code Descriptions 128
Using Swagger-Provided Faults 130
Standard HTTP Status Codes 131

Eclipse Views for REST 133


API Explorer 133
Settings 137

TIBCO ActiveMatrix BusinessWorks™ REST Reference


5 | Contents

The REST and JSON Palette in TIBCO Business Studio™ for


BusinessWorks™ 140

Security 141
Overview of Policies 141
Managing Policy Resources 142
Creating a Folder for Policies 142
Creating an Authentication Resource 143
Associating a Policy 143
Removing a Policy 144
HTTP Security 145
Enforcing Basic Authentication 145
Enforcing Basic Credential Mapping 149

TIBCO Documentation and Support Services 154

Legal and Third-Party Notices 156

TIBCO ActiveMatrix BusinessWorks™ REST Reference


6 | What is REST?

What is REST?
Representational State Transfer (REST) is a platform-and-language-independent
architectural style used in building services for distributed systems and networked
applications. REST ignores the details of component implementation and protocol syntax.
It uses HTTP to make calls between the applications.
REST is primarily used to expose resources across networks allowing applications to share
data. REST APIs are used for machine-to-machine communications. REST calls are sent
over the HTTP protocol, hence REST requests are in the form of URLs that point to the
resource(s) on the server. Required parameters are attached to the end of the URL. For
example, in the resource URL http://<some-name>.com/person/1234, person is the
resource and 1234 is the parameter that is passed to the URL of the resource. You can use
any REST client to make REST calls.
The key features of REST architectural style are:
l Client-server architecture: Provides a separation of implementation details between
clients and servers.
l Stateless communication: During a client-server communication, the server does
not store any session information, making the client-server communication stateless.
Every request is complete in itself and must include all the information required to
complete the request.
l Cacheability: Provides an option to the client to cache response data and reuse it
later for equivalent requests; thus partially eliminating some client-server
interactions. This results in improved scalability and performance.

What is a Resource?
REST APIs operate on resources that are defined within a REST interface file such as a
Swagger specification. A resource is a representation of a thing (a noun) on which the REST
APIs (verbs) operate. Some examples of a resource are a user, a book, or a pet. The REST
operations, POST, GET, PUT, PATCH, and DELETE operate on a resource. Individual
instances of a resource are identified by a unique identifier within the resource such as an
ID or name.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


7 | What is REST?

A resource can be thought of as an entity which is expressed by a well-formed URI. In many


ways it is similar to an instance of a class in the Java language. A resource has a type, one
or more parameters, and some standard operations that allow you to manipulate or
retrieve it from a remote location if you know its endpoint URL. The operations allowed on
a resource are POST, GET, PUT, PATCH, and DELETE that correspond to the CRUD
operations. A resource can exist independently or it can be a part of a homogeneous
collection. All the information that is relevant to a resource is contained within the
resource itself.
A resource is represented by an XML object in TIBCO Business Studio™ for BusinessWorks™
and a JSON object in a Swagger file.

What is an Operation?
Operations define the action that can be performed on the resource. REST supports POST,
GET, PUT, PATCH, and DELETE operations that correspond to the CRUD operations.
In TIBCO Business Studio for BusinessWorks, a process implements an operation on a
resource and acts to receive, manipulate, and return resources. You pass information to an
operation by attaching path or query parameters to the URL of the resource. In addition
you can use header parameters to pass or receive information in the HTTP envelope
containing the message body.

What is an Endpoint?
The REST API is exposed through an endpoint. It is the access point of a resource which a
REST service exposes and a REST reference invokes. An endpoint uses the REST operations
to provide access to the resource. An endpoint has a name and is represented by a path
within the resource. It resides at a location specified by the URL of the resource.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


8 | What is Swagger?

What is Swagger?
Swagger is a specification which is used to define a REST interface that has operations and
parameters. Documents used by the REST API to send requests and receive responses are
often written according to the Swagger specification.
For more information about Swagger, see http://swagger.io/.
TIBCO Business Studio for BusinessWorks supports the import of Swagger-compliant files
that were created outside of TIBCO Business Studio for BusinessWorks as well as lets you
generate a Swagger-compliant JSON file when you create a service from an XSD within
TIBCO Business Studio for BusinessWorks.

The Swagger UI
Using the Swagger UI, you can visualize and test RESTful services defined by the Swagger
specification. It specifies the format (URL, method, and representation) to describe the
REST web services.

Viewing Multiple REST Services in Swagger UI


If there are multiple REST services using different HTTP Connectors, you can select a single
HTTP Connector to receive responses for all the REST services. From the Swagger UI, select
the connector from the options in the drop-down list for Select HTTP Connector.
At runtime, the Swagger UI lists all the REST services that are using the selected HTTP
Connector.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


9 | Parameter Support

Parameter Support
REST operations support path, query, form, and header parameters. You can pass path and
query parameters to an operation by appending them to the request URL. Header
parameters are used to pass and receive information in the HTTP envelope containing the
message body.
Path parameters can be applied only at the root level. They apply to all operations and
cannot be defined per operation.
Query parameters can be applied both at the root level when they apply to all operations
or they can be defined per operation too.
Header parameters are defined per operation and per direction. Request headers are
separate from response headers.
Form parameters are applicable to POST, PUT, and PATCH operations only. They must be
defined at the operation level only and cannot be defined at the binding level.

Conversion between Swagger and XML in


TIBCO Business Studio for BusinessWorks
When you create a service using a Swagger file, TIBCO Business Studio for BusinessWorks
converts the Swagger definitions into XML schema elements. Use the schema elements to
configure your REST operations.
You have the option to create a REST service or reference using a Swagger file or you can
create them from scratch in TIBCO Business Studio for BusinessWorks by creating your XML
schema using the Schema Editor in TIBCO Business Studio for BusinessWorks.
When you create a REST service or reference from a Swagger file, a corresponding .xsd file
is automatically generated in the Schemas folder of your project.
When you create a REST service or reference from scratch using their respective wizard,
then a corresponding Swagger file is generated in the Service Descriptors folder of your
project.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


10 | Parameter Support

A Swagger file is a contract that must be followed. Only the originator of the Swagger file
can modify it in TIBCO Business Studio for BusinessWorks. If the Swagger file originated in
TIBCO Business Studio for BusinessWorks, then you can modify it in TIBCO Business Studio
for BusinessWorks.
TIBCO Business Studio for BusinessWorks maintains a link between the Swagger file and
its generated .xsd file. Multiple XSD files may be linked to one Swagger file.

Warning: Do not edit a TIBCO Business Studio for BusinessWorks-generated


.xsd file because its contents are replaced the next time the file is generated.

Not all artifacts in JSON have a direct equivalent in XML. For example, TIBCO Business
Studio for BusinessWorks handles Swagger to XML conversion of arrays differently than it
handles single elements.
This section explains how TIBCO Business Studio for BusinessWorks models the conversion
of elements from Swagger to XML and vice versa.

Basic type elements


The following table shows the conversion of elements of basic types between XML and
Swagger in TIBCO Business Studio for BusinessWorks:

XSD type Corresponding type in Swagger

long integer

short, int, integer integer

double number

float number

string string

base64Binary string

decimal number

TIBCO ActiveMatrix BusinessWorks™ REST Reference


11 | Parameter Support

XSD type Corresponding type in Swagger

boolean boolean

byte string

date string

dateTime string

binary string

Objects
The following table shows how an object in JSON is converted into an XML schema
element in TIBCO Business Studio for BusinessWorks. In this example, Product is an object
that has three attributes called 'product_id', 'description' and 'dispaly_name' all of which
are of type string.
Since the object has multiple attributes, it is a complex type element in XSD. The
minOccurs="0" indicates that specifying a value for the attribute is optional.

Note: If $ref and type: object are present in the Swagger file, type: object is
ignored, and only $ref is considered.

This object in JSON... ...is converted to the following in XSD

"Product": { <xs:element name="Product"


"type": type="tns:Product"/>
"object", <xs:complexType name="Product">
<xs:sequence>
"properties": { <xs:element minOccurs="0"
name="product_id"
"product_id": {
type="xs:string"/>
"type": "string", <xs:element minOccurs="0"
}, name="description"

TIBCO ActiveMatrix BusinessWorks™ REST Reference


12 | Parameter Support

This object in JSON... ...is converted to the following in XSD

"description": { type="xs:string"/>
<xs:element minOccurs="0"
"type": "string", name="display_name"
},
type="xs:string"/>
"display_name": { </xs:sequence>
</xs:complexType>
"type": "string",
}
}
}

Arrays
An array is a collection of identically typed elements. The type can be primitive or complex.
For the most part, when TIBCO Business Studio for BusinessWorks converts from JSON to
XSD, you can see a one-to-one correspondence for the objects in Swagger and elements in
the corresponding XSD file. The only exception lies in the handling of arrays.

Note: The word "Array" is a key word in TIBCO Business Studio for
BusinessWorks. Do not use the "array" suffix in an XSD element name.

Swagger array representation in TIBCO Business Studio for


BusinessWorks
When TIBCO Business Studio for BusinessWorks encounters an array in the Swagger file,
while generating a schema for it, it models the array by generating two separate but
related elements in the .xsd file for each array:
l a wrapper element (with an "Array" suffix) that acts as a definition for a container
that holds the array elements. In addition to other attributes, this wrapper element
contains the type of the element that the array contains. The wrapper element is a
TIBCO Business Studio for BusinessWorks-generated artifact solely to comply with
the XML requirement of having a container for a collection. It does not exist in the
.json file. The array element is created with a boundary of 0..* (0 indicates that it is

TIBCO ActiveMatrix BusinessWorks™ REST Reference


13 | Parameter Support

optional and * indicates that the array is unbounded).


l a definition of the element itself.

Note: Do not edit a TIBCO Business Studio for BusinessWorks-generated .xsd


file because its contents are replaced the next time the file is generated.

The example below shows the definition of an array called Products in Swagger and its
corresponding XSD.

Array in JSON... represented in XSD

"Products": { <xs:element name="Products"


"type": type="tns:Products"/>
"array", <xs:complexType name="Products">
"items": <xs:sequence>
{ <xs:element maxOccurs="unbounded"
"$ref": minOccurs="0"
"Product" name="Products"
} type="tns:Product"/>
} </xs:sequence>
</xs:complexType>

In the example above, Products is an array in JSON (denoted by "type": "array") that
contains multiple Product objects (denoted by "items":{ "$ref": Product). The object,
Product, itself is defined in another location in the Swagger file.

The following shows how the Products array defined above is used as a path parameter:

The following block in ...gets converted to the following block in XSD


JSON schema...

"schema": { <xs:element name="ProductArray"


type="tns:ProductArray"/>
"type": "array", <xs:complexType name="ProductArray">
<xs:sequence>
"items": { <xs:element maxOccurs="unbounded"

TIBCO ActiveMatrix BusinessWorks™ REST Reference


14 | Parameter Support

The following block in ...gets converted to the following block in XSD


JSON schema...

minOccurs="0" name="Product" type="tns:Product"/>


"$ref": </xs:sequence>
"Product" </xs:complexType>
}
}

The example above appear as follows in the Schemas folder of TIBCO Business Studio for
BusinessWorks:

Anonymous Arrays
Since XML is a strongly typed language. All elements - arrays and single elements alike, are
named and have a type in XML. In JSON however, arrays can be either structured or
anonymous. A structured array is type-based where a type defines the basic construct and
its elements. An anonymous array is an unnamed construct containing a group of
homogenous objects. Neither the construct nor the elements contained in it have a type.
Anonymous arrays simply contain blocks of data that repeat. JSON uses the concept of
anonymous arrays extensively, but the concept does not exist in XML. In JSON, a parameter
may be of type string, but if you add "type" : "array" to the definition, it becomes a
collection of strings.
The following example shows JSON payload and its equivalent in XSD in TIBCO Business
Studio for BusinessWorks. The wizard prompts you to enter a file name when generating
XSD from a JSON payload. The file name entered was "ClassicNovels" in this example.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


15 | Parameter Support

Anonymous array in ...gets converted to the following in XSD


JSON...

[ <complexType name="ClassicNovelsElementType">
{ <sequence>
"id": 1, <element maxOccurs="1" minOccurs="0"
"name": "Great name="id" type="integer"/>
Expectations", <element maxOccurs="1" minOccurs="0"
"author": name="name" type="string"/>
"Charles Dickens", <element maxOccurs="1" minOccurs="0"
"isbn": "13: name="author"
978-0141439563", type="string"/>
"genre": <element maxOccurs="1" minOccurs="0"
"Classic" name="isbn" type="string"/>
}, <element maxOccurs="1" minOccurs="0"
name="genre"
{ type="string"/>
"id": 2, </sequence>
"name": "Jane </complexType>
Austen", <element name="ClassicNovelsElement"
"author": type="tns:ClassicNovelsElementType"/>
"Emma", <complexType
"isbn": "13: name="ClassicNovelsElementArrayType">
978-1493663644", <sequence>
"genre": <element maxOccurs="unbounded"
"Romance" minOccurs="0"
}, ref="tns:ClassicNovelsElement"/>
{ </sequence>
"id": 3, </complexType>
"name": "Jude <element name="ClassicNovelsElementArray"
the Obscure",
"author": type="tns:ClassicNovelsElementArrayType"/>
"Thomas Hardy",
"isbn": "13:
978-0140435382",
"genre":
"Tragedy"
}
]

The example appears as follows in the Schemas folder in Project Explorer:

TIBCO ActiveMatrix BusinessWorks™ REST Reference


16 | Parameter Support

Forms
TIBCO Business Studio for BusinessWorks supports the use of form parameters as the
media type in REST requests for POST, PUT, and PATCH operations. This is the only media
type that can be used to transmit binary data and files. Form parameters must be defined
at the operation level only and cannot be defined at the binding level.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


17 | Parameter Support

An operation in a REST API has one of the following encoding:


l Tag/Value (application/x-www-form-urlencoded) - used when you use form data
which is of a primitive data type. You cannot send or receive binary data or files
using this encoding.
l Multipart (application/form-data) - is superset of urlencoded encoding. Besides
primitive data types, multipart encoding also supports binary and file data types.
When the data type of a form parameter is either binary or text, two elements get
created in TIBCO Business Studio for BusinessWorks:
o name - used to store the name of the file
o content - used to store the actual data within the file

The following illustrates how form parameters are represented in JSON and XSD:

Data types JSON XSD

primitive
{ <xs:element
data types "/person" : { name="personPostForm">
"post" : { <xs:complexType>
"description" : <xs:sequence>
"", <xs:element
"operationId" : maxOccurs="1" minOccurs="1"
"post-person",
"consumes" : [ name="name" type="xs:string"/>
"application/x-www-form- </xs:sequence>
urlencoded" ], </xs:complexType>
"produces" : [ </xs:element>
"application/json" ],
"parameters" : [ {
"name" : "name",
"in" :
"formData",
"description" :
"",
"type" :
"string",
"required" :
true

} ]

TIBCO ActiveMatrix BusinessWorks™ REST Reference


18 | Parameter Support

Data types JSON XSD

binary or
{ <xs:element
file type "/person" : { name="personPostForm">
"post" : { <xs:complexType>
"description" : <xs:sequence>
"", <xs:element
"operationId" : maxOccurs="1" minOccurs="0"
"post-person", name="photo">
"consumes" : [ <xs:complexType>
"multipart/form-data" ], <xs:sequence>
"produces" : [ <xs:element
"application/json" ], maxOccurs="1" minOccurs="0"
"parameters" : [ { name="filename"
"name" :
"photo", type="xs:string"/>
"in" : <xs:element
"formData", maxOccurs="1" minOccurs="0"
"description" : name="content"
"",
"type" : "file", type="xs:base64Binary"/>
"format" : </xs:sequence>
"binary", </xs:complexType>
"required" : </xs:element>
false </xs:sequence>
</xs:complexType>
} ] </xs:element>

The examples appear as follows in TIBCO Business Studio for BusinessWorks :


Primitive type:

TIBCO ActiveMatrix BusinessWorks™ REST Reference


19 | Parameter Support

Binary or File type:

Working with Path and Query Parameters


REST APIs support path and query parameters. You can apply path parameters only at the
root level and not at individual operation level. You can apply query parameters at root as
well as individual operation level.
Define parameters in the resource service path by enclosing each parameter in { } brackets.
For example, to define the path parameter isbn for a book resource, specify the resource
path as follows:

TIBCO ActiveMatrix BusinessWorks™ REST Reference


20 | Parameter Support

/book/{isbn}

In this example, the client would invoke this service using the URL
http:/<host>:<port>/book/<isbn>.

Note: Path parameters that are not immediately enclosed in forward slashes are
supported. For example, the parameter authorName('{isbn}') in the resource
service path /book/authorName('{isbn}')/ is not directly contained by forward
slashes, but still passes successfully.

Insert a question mark (?) after a parameter to add query parameters to a resource. In the
following example, isbn is defined as a query parameter, instead of the path parameter, in
the resource service path:
/book?{isbn}

Insert (&) to use it as a delimiter when defining multiple query parameters. In the following
example, the query parameters isbn and authorName are defined in the resource service
path:
/book?{isbn}&{authorName}

All the parameters defined in the resource service path are made available to the user as
Input for every operation. See the following image for the /book/{isbn} example to see
the Input for the GET operation.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


21 | Parameter Support

Important: Path parameter names and query parameter names must be unique
in a resource service path. For example, the following path and query
parameters is not supported:
/books/{isbn}?{isbn}

If the Request Format for a REST Binding is Form, the parameter name must be
different from all element names in the referenced schema. For example if a
Books schema contains the element isbn, isbn cannot be used as query or path
parameter name.

Important: Do not use the word "fields" as the name of a query parameter. The
word "fields" is a reserved keyword for internal use. For example, to extract the
author, isbn, and price fields from an instance of a book object with name
Emma:
use: /books/Emma?author,isbn,price
not: /books/Emma?fields=author,isbn,price

Adding or Editing Path Parameters


To create a path parameter, do the following:

Procedure
1. Click Components under the Module Descriptors to open the Component
Configurations page.
2. Expand the Component<application_name> node.
3. Double-click the process name (with the green chevron next to it) to open its
properties.
4. Click the Bindings tab.
5. Append the path parameter to the Resource Service Path. For example, to define
the path parameter isbn for a book resource, specify the resource path as /book/
{isbn}.

6. Click the green check mark button at the end of the text box to save your edits.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


22 | Parameter Support

The newly created path parameter appears in the Path Parameters table. You can
edit the name of the parameter by clicking on it. You can change its type by clicking
it, and then selecting a new type from its drop-down menu.

Caution: Be aware that these buttons are disabled if you are viewing
operations for an API that was created outside TIBCO Business Studio for
BusinessWorks and imported into TIBCO Business Studio for
BusinessWorks.

Adding or Editing Query Parameters


To create a query parameter, do the following:

Procedure
1. Click Components under the Module Descriptors to open the Component
Configurations page.
2. Expand the Component<application_name> node.
3. Double-click the process name (with the green chevron next to it) to open its
properties in the Properties view.
4. Click the Bindings tab.
5. Click an operation name in the Operations section.
6. Click the Request tab in the Operation Details section.

7. Click the green icon ( ) to add a query parameter. To edit the parameter name
click on the newly created parameter's default name and type in a new name. Be
aware that these buttons are disabled if you are viewing operations in an API that
was created outside TIBCO Business Studio for BusinessWorks and imported into
TIBCO Business Studio for BusinessWorks.
8. You can also edit the existing query parameter to make it required or optional by
clicking in the cell that corresponds to the parameter in the Required column. The
value toggles from Yes to No or vice versa.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


23 | Parameter Support

Working with Arrays


Swagger provides an interface description that could return JSON objects. An operation
may return a single object, or if the "type":"array" attribute is added to the configuration
then it returns an array of that object type. TIBCO Business Studio for BusinessWorks
supports sending and receiving arrays in REST requests and responses.
In TIBCO Business Studio for BusinessWorks, you can create a REST API by starting with a
Swagger-compliant JSON file or you can create the API from scratch using the wizards in
TIBCO Business Studio for BusinessWorks. If you use JSON as your starting point, TIBCO
Business Studio for BusinessWorks generates an XSD file when the API gets created. When
generating the XSD for an array, TIBCO Business Studio for BusinessWorks creates a
wrapper element with an "Array" suffix and another single element containing the
definition for the element type contained in the array.
For more information about how TIBCO Business Studio for BusinessWorks handles arrays,
see the "Arrays" section in the topic Conversion Between JSON and XML in TIBCO Business
Studio for BusinessWorks .

Note: Do not edit the .xsd file that is generated by TIBCO Business Studio for
BusinessWorks.

Note: The word "Array" is a key word in TIBCO Business Studio for
BusinessWorks. Do not use the "array" suffix in an XSD element name.

Configuring an array in REST binding in TIBCO Business Studio for


BusinessWorks
For projects that were created with a Swagger file that was imported from an external
source into TIBCO Business Studio for BusinessWorks, you can only view and use the
elements. You cannot modify them.

Note: A JSON file is like a contract that must not be broken. Since it is an
imported file, its contents cannot be modified and must be followed exactly.

An array appears as follows:

TIBCO ActiveMatrix BusinessWorks™ REST Reference


24 | Parameter Support

To configure a REST request to get an array, do the following:

1. In Project Explorer, under Module Descriptors, double-click Components to open


its property page.
2. Click on the resource to open its properties view.
3. Click the Bindings tab to open it.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


25 | Parameter Support

4. In the Operations Details box, click the Response tab.


5. Select the JSON check box in the Format options.
6. Select Anonymous Array from the JSON Response Style drop-down menu.
7. Select the array element type in the Resource Schema drop-down menu.
8. Save your project.
9. Verify that the array is available for use in the Input tab for your postOut activity.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


26 | Parameter Support

Working with Form Parameters


TIBCO Business Studio for BusinessWorks supports the use of form parameters as the
media type in REST requests for POST, PUT, and PATCH operations. This is the only media
type that can be used to transmit files.
For more information about how form parameters are represented in JSON and XSD, see
the Conversion Between JSON and XML in TIBCO Business Studio for BusinessWorks.
Form parameters are applicable to POST, PUT, and PATCH operations only. You must
define them at the operation level only and not at the binding level.
An operation can have one of the following encoding. Both encodings have Tag/Value:
l Tag/Value (application/x-www-form-urlencoded) - Select this encoding for an
operation, if you want to use form parameters of primitive data type of String,
Integer, or Boolean in your operation. You cannot use this encoding to transmit files.
l Multipart (application/form-data) - Select this encoding for an operation, if you
want to use form parameters of type String, Integer, Boolean, File/Binary, or File/Text

TIBCO ActiveMatrix BusinessWorks™ REST Reference


27 | Parameter Support

in your operation. You can send or receive both text and binary files.
When you transmit a file using a form parameter, two elements are created in TIBCO
Business Studio for BusinessWorks:
o name - used to store the name of the file
o content - used to store the actual data within the file

Creating Form Parameters


To create a form parameter, do the following:

Procedure
1. Click Components under the Module Descriptors of your project to open the
Component Configurations page.
2. Expand the Component<application_name> node.
3. Double-click the process name (with the green chevron next to it) to open its
properties in the Properties view.
4. Click the Bindings tab.
5. Click the post operation under Operations in the left tree.
6. Click the Request tab.
7. Select an encoding for the operation from the Request drop-down menu.
Select either Form Data - Tag/Value (application/x-www-form-urlencoded) or
Form Data - Multipart (application/form-data). The Form Parameters table is
displayed.

8. Click the blue icon ( ) on the right side of the Form Parameters table to create a
new form parameter.
9. Click the name and edit it. To change the type, click the type in the Type column and
select a type from the drop-down list. Similarly, you can specify if this parameter is
required or not by clicking in the Required column.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


28 | Parameter Support

Working with Header Parameters


Header parameters are used for user-defined custom HTTP headers for a request, for
example, the APIKey could be a HTTP Header parameter. Unlike query and path
parameters, header parameters do not appear in the URL of the request, but if they exist in
your API specification, they are passed into the request but are not visible to you.

Note: Header parameters can be defined per operation which means that each
operation in the API can have its own header parameters.

If you created your REST API from an imported Swagger file, the parameters are not
editable in TIBCO Business Studio for BusinessWorks. You cannot modify existing
parameters or create new ones. You can only view the parameters. Any custom header
parameters you create are visible in the Data Source tab of TIBCO Business Studio for
BusinessWorks as follows:

TIBCO ActiveMatrix BusinessWorks™ REST Reference


29 | Parameter Support

You can view or add header parameters in TIBCO Business Studio for BusinessWorks if the
Swagger file for your project was auto-generated in TIBCO Business Studio for
BusinessWorks by implementing a REST service from XSD.
To add a custom header parameter, follow these steps:

Procedure
1. Click Components under the Module Descriptors to open the Component
Configurations page.
2. Double-click the process name (with the green chevron next to it) to open its
properties in the Properties view.
3. Click the Bindings tab.
4. Click an operation name in the Operations section.
5. Click the Request tab in the Operation Details section.

6. Click the red icon ( ) to add a header parameter. To edit the parameter name
click on the newly created parameter's default name and type in a new name. Be
aware that these buttons are disabled if you are viewing operations for an API that
was created outside TIBCO Business Studio for BusinessWorks and imported into
TIBCO Business Studio for BusinessWorks.

Note: Do not use a space in the HTTP header name. If you do, the
following error is displayed: Bad message- 400 - Illegal character.

You can also edit an existing header parameter to make it required or optional by
clicking in the cell that corresponds to the parameter in the Required column. The
value toggles from Yes to No or vice versa.
7. Use the Response tab to add a header parameter to the operation response.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


30 | About REST Services and References

About REST Services and References


A REST service or a reference is created from a process within a project. The content of the
process resides in an XSD file in the Schemas folder of the project.
The Schemas folder and the Service Descriptors folder in a project are tightly coupled. If
you want to create a service using a Swagger file, you must first import that Swagger file
into the Service Descriptors folder of your project. While creating the project, TIBCO
Business Studio for BusinessWorks automatically generates a schema (.xsd) for the
definitions in your Swagger file in the Schemas folder of your project.

Service Descriptors folder


The Service Descriptors folder in a project stores the interface description files, such as
the .json Swagger file specific to the activator process. These files describe the service and
the list of operations and parameters that the service supports. The Service Descriptors
folder provides a good way to view the structure of the API. You can use these files to
create a service or create a reference to invoke the service.

Schemas folder
The Schemas folder is used to store the XSD definitions that were either generated by
TIBCO Business Studio for BusinessWorks or imported into TIBCO Business Studio for
BusinessWorks from an external source.

Approaches to Creating a Service or Reference


Use one of the following approaches to create a REST service or reference:
l Using a Swagger file
l Using the respective wizard in TIBCO Business Studio for BusinessWorks

TIBCO ActiveMatrix BusinessWorks™ REST Reference


31 | Supported Message Formats

Supported Message Formats


ActiveMatrix BusinessWorks supports the following message formats: JSON, XML, and Text.
It also supports Binary as a response message format for Swagger 3.0 based REST services.
Each operation (POST, GET, PUT, PATCH, and DELETE) can have JSON, XML, or Text request
or reply settings, independent of the other operations.
If all of the operations have the same setting, then you can change the request or response
types at the binding level to change all operations at once. If one or more operations has a
different value than the remaining operations, then you cannot make a change at the
binding level. You must change the settings for each one independently. This gives you full
control over the format of each operation.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


32 | Restrictions

Restrictions
There are certain rules to follow when working with JSON and XML Schema.

Restrictions on JSON
JSON files used to create REST services and references have some restrictions.
l Arrays must have homogeneous content.
l Arrays cannot directly contain arrays ( [ [ ... ], [ ... ] ] )
l Null type properties throw the XSD schema conversion error in TIBCO Business
Studio for BusinessWorks. To create a REST Service or REST Binding edit the input
JSON file and change the data type from null to string.
l If a Swagger 3.0 JSON file contains multiple servers URL, then on creating the REST
service or a reference from it, the first URL is picked up to configure the shared
resource's host and port. You can re-configure the host and port based on the server
URL you want to invoke. Change the configurations accordingly in the shared
resource.
l If an operation in Swagger 2.0 JSON file has parameters or responses with embedded
anonymous schema, by default a validation error occurs. In TIBCO Business Studio
for BusinessWorks to turn off the validation error navigate to Preferences >
BusinessWorks > Validation > Swagger with Anonymous schema and select the
Warning or Ignore option.
l If a Swagger JSON file has optional array property with minItems keyword, then it is
treated as a required array property because it gets converted to an array element
which has minOccurs attribute value set as per the minItems value.

Not currently supported


l Binary content in JSON as a special case.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


33 | Restrictions

l The Swagger 3.0 JSON file containing Open API 3.0 specific features which are not in
parity with Swagger 2.0 JSON file.

Restrictions on XML Schema


This topic lists the restrictions on XML Schema.

General Restrictions
l No wildcards or attribute wildcards. For example, any element and any attribute is
not supported.
l Complex types might not contain both an attribute and a child element with the
same local name.
l Complex types might not contain mixed content.
l Attributes that are not part of the default (empty) namespace, cannot be used for
Complex Elements.
l The 'choice' and 'sequence' compositors might not have maxOccurs > 1 (same as the
restriction on 'all' in the schema specification).
l Substitution groups are not supported.
l Element of simple type with an attribute is not supported.
l The elementFormDefault can only be qualified for schemas used by REST binding
and JSON activities.
l Schemas should not contain cyclic dependencies within same schema, or on the
other schemas.
l Schemas should not have a type that has two child members with the same local
name, but different namespaces.
l For float and double values, XML schema always shows exponential values of type
1.0E0

TIBCO ActiveMatrix BusinessWorks™ REST Reference


34 | Using Swagger 1.2 Files

Using Swagger 1.2 Files


You can use Swagger 1.2 API declaration files.
To consume the interfaces created using Swagger 1.2 in the current version, import the
projects, and click the REST module under the Processes folder in the Project Explorer and
select Refactor > Expose REST Resource to extract the hidden resource files. These
Swagger 1.2 files appear in the Service Descriptors folder and can be used in the same
manner as the Swagger 2.0 files.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


35 | Using Swagger 3.0 Files

Using Swagger 3.0 Files


You can now import Swagger 3.0 JSON files containing callbacks. For more information
about callbacks, see Callbacks at Swagger.io documentation.
When you import a Swagger 3.0 based .json file having callbacks keyword in TIBCO
Business Studio for BusinessWorks, the JSON file has the following structure:

The definition of each callback starts with the event name. For each event, there exists a
callback URL.
If you drag a callback URL from the tree view to the process editor, you get options
whether to create a REST service or a REST reference.
The callback URL contains methods of the callback message. The method has the message
format and the expected responses that are similar to regular request and response
definitions.

Run time expressions


In the following example, the expression {$request.path.eventType} represents run time
expression.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


36 | Using Swagger 3.0 Files

Note: When you create a REST service binding from a runtime-expression based
URL, it does not populate the Resource Service Path with an abstract path but
rather with a concrete path. By default, the Resource Service Path value is set
to /callback.

If you want to change the Resource Service Path, then after creation of REST service from
an external Swagger file, select the Generate Implementation Specification check box on
the General tab for that REST service binding.
The service to be created from the DnD of run time expression based URL should be
created on an independent process so that the generated swagger file has the details of
only that binding specification. To override the same on reference binding use the
dynamicConfigurations URL field in Invoke activity. For more information, see Dynamic
Invocation of a REST Service.

Note: For the REST service binding , which are created using drag and drop of
callback URL node from the tree view, select the Generate Implementation
Specification check box. This creates a new Swagger specification and binds it
to the service binding so that while exporting the application EAR, the
Manifest.json accomodates the details about the service.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


37 | REST Schema Utilities

REST Schema Utilities


TIBCO Business Studio for BusinessWorks provides utilities to convert objects from JSON to
XSD elements.

Creating a New XML Schema File


Using TIBCO Business Studio for BusinessWorks you can create a new XML schema file in
your project.

Before you begin


The project must exist in the Project Explorer.

Procedure
1. Right-click the Schemas folder in your project in the Project Explorer.
2. Select New > XML Schema File.
3. Enter a file name and click Finish.
The file opens in the XML Schema Editor.
4. Right-click anywhere in this editor and click Add Element to add a new element.

Creating an XML Schema from a JSON Payload


TIBCO Business Studio for BusinessWorks provides a utility to generate an XML schema
from a JSON payload.
To generate an XML schema from a JSON payload, do the following:

Procedure
1. Right-click on the Schemas folder in your project and select New > XML Schema

TIBCO ActiveMatrix BusinessWorks™ REST Reference


38 | REST Schema Utilities

File from JSON Payload.

2. Enter a name for the schema file and paste the JSON payload into the JSON Sample
text box and click Next.
You can see a message saying that the JSON payload parsed successfully.
3. Click Finish.
A .xsd file with the name that you provided gets created under the Schemas folder.
You can view its contents by opening it in the XML Schema Editor (right-click the
schema file and select Open With > XML Schema Editor).
4. Save the project.

Generating an XML Schema from a Swagger


File
You can generate an XML schema from a Swagger 1.0, 2.0, and 3.0 file using the menu
options without creating a service.

Note: This option is enabled only when the JSON file is any of the Swagger 1.0
file, Swagger 2.0 file, Swagger 3.0 file, and has Swagger Definition.
For Swagger files that do not contain Swagger definition, the Generate XSD
Schema menu option is disabled.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


39 | REST Schema Utilities

Before you begin


A Swagger 2.0 or a Swagger 3.0 file should exist in the Service Descriptors folder of the
project. If not, then import the Swagger file into the Service Descriptors folder before you
follow the steps to create its XML schema.

Procedure
1. Right-click the JSON file in the Service Descriptors folder in your project and select
Refactor > Generate XSD Schema.
A .xsd file gets created in the Schemas folder of your project.
2. Save the project.
l To figure out which XML schema is related to the Swagger file, right-click the
Swagger file and select Refactor -> Open XSD Schema.
l If you have multiple Swagger files all of which contain a definition for the same
object, the definition for the object in all the Swagger files must be identical.
l If you have multiple Swagger files with one file (a master file) containing a super set
of definitions contained in the other files, generate an XSD file from the master
Swagger file that contains the super set, and create links to the other files in the
master Swagger file. If you create a link to the super set file in one of the subset files
and then create an XSD from the subset file, then the XSD contains only those
elements that are common to both files. It does not contain elements for definitions
that exist only in the super set file.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


40 | Importing an API Model into your Workspace

Importing an API Model into your


Workspace
The APIs that are discovered from local and remote servers are displayed in the API
Explorer tab of the TIBCO Cloud™ Integration. You can use these APIs in your project by
importing them into the Service Descriptors folder of the project. The .json file for the
API gets copied into the application module.
To import the APIs from the API Explorer into your project follow these steps.

Procedure
1. Right-click on one or more API names in the API Explorer and select Import.
The Import API dialog opens.

Every API you selected in the API Explorer is listed in this dialog. If an API has
multiple versions, all versions are listed. By default, all APIs listed here are selected.
You can deselect APIs that you do not want to import by clearing its check box.
2. Select the appropriate action and click Next.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


41 | Importing an API Model into your Workspace

Option Description

Import to project Select the radio button to import the API into an existing
project and browse to the project using the Browse
button.

Create a new project and To create a new project and import the API into that
import API to the new project select the radio button.
project

API list to import Select the API or the appropriate version of the API when
there are multiple versions of the API available.

The Change Swagger name dialog box opens.

Change the swagger file name if required. Click Next.


The New BusinessWorks Application Module dialog box opens.
3. Create a new application module with appropriate details and click Finish.
You should see the API(s) under the Service Descriptors folder of the project. You
can create sub-folders under the Service Descriptors folder and drag-and-drop APIs
into them if you prefer to organize the APIs into a meaningful folder structure.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


42 | Importing an API Model into your Workspace

As an alternative to the above procedure, you can also drag and drop the API from
the API Explorer into the project's Service Descriptors folder.

Note: APIs that were created using a Swagger file must be implemented
exactly as defined by the Swagger file. TIBCO Business Studio for
BusinessWorks allows you to only view the parameters and operations that
are defined in the Swagger file. You cannot create any new parameters or
operations for such applications.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


43 | REST Service

REST Service
The REST service is a server process. When running, it can be invoked by a REST reference.

REST Service Binding


REST Binding provides external connectivity for REST over HTTP. You can specify custom
HTTP headers and parameters using REST binding. It supports POST, GET, PUT, PATCH,
and DELETE HTTP methods. It also supports JSON, XML, and plain text message types.

Binding
This section has the following fields.

Field Description

Resource The name of the resource.

Resource Specify the path to the Service Resource.


Service Path
Define parameters in the resource service path by enclosing each parameter in
{ } brackets. For example, to define the path parameter isbn for a book
resource, specify the resource path as follows:
/book/{isbn}

In this example, the client would invoke this service using the URL
http:/<host>:<port>/book/<isbn>.

Note: Path parameters that are not immediately enclosed in forward


slashes are supported. For example, the parameter authorName('{isbn}')
in the resource service path /book/authorName('{isbn}')/ is not directly
contained by forward slashes, but still passes successfully.

If an application contains multiple REST bindings, make sure that the location
of the path parameters is unique for each REST binding.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


44 | REST Service

Field Description

An example is that of one REST binding using the /book/{isbn} path and
another REST binding is using the /book/{authorid} path. Since {isbn} and
{authorid} are defined at the same location in the URI, one of these services
do not function as expected.

In addition to path parameters, the path in a REST binding can also contain
query parameters. For example,

/resource/path/{pathparam}? query={queryparam} or /resource/path/


{pathparam}?{ queryparam}

HTTP The name of the HTTP Connector.


Connector
Name Tip: To display details about the HTTP Connector resource, click on the
HTTP Connector Name field.

By default, a new HTTP Connector shared resource is created when you


create a new REST Service binding. Change the field value type to Module
Property to specify a module property that has been defined as an HTTP
Connector shared resource.

Response The type of response message format. The supported response message
Client formats are:
Format
l JSON
l XML

Enforce BW Select the checkbox to set the response preference to BW Service Response.
Service
By default, the checkbox is not selected, and the response preference is set to
Response
the Accept Header response.

For more information about the REST Service responses based on the Accept
Header settings, see the Accept Header Responses topic.

Start Job on Select the checkbox to start the job when there is a wrong or erroneous input.
Input
Exception

TIBCO ActiveMatrix BusinessWorks™ REST Reference


45 | REST Service

Field Description

Apply Policy Select the checkbox to apply a policy to the sub-paths of a REST service.
to Subpaths When this checkbox is selected for a parent Resource Service Path configured
with policy, the policy is applied to the child paths at runtime. If in case we do
not wish to apply the policy to all the sub-paths but for selective paths, then
do not select this checkbox and add the policy for the required service paths.

Operations
This section shows the following details.

Field Description

Name The name of the HTTP method used, for example, POST, GET, PUT, PATCH,
and DELETE.

Nickname The specified name of the service, for example, getBooks.

Operation Details
This section has the following tabs.

Summary tab
Field Description

Summary The summary of the REST resource.

HTTP Displays the HTTP Method specified in the Operations section. These are the
Method available HTTP methods:
l POST
l GET
l PUT
l DELETE
l PATCH

TIBCO ActiveMatrix BusinessWorks™ REST Reference


46 | REST Service

Field Description

Notes Additional information about REST resource.

Request tab
Field Description

Use Null for Select the check box to set NULL values instead of empty values in JSON.
Empty Values That is, use NULL values instead of square brackets ([]).

By default, the check box is clear.

Ignore Select this check box to ignore additional fields that are generated due to
Additional changes in the external payload when processing the schema.
JSON Fields
By default, the check box is clear.

Format Supported formats for REST service request are:


l JSON
l XML
l Text

JSON Select one of the following options:


Definition
l Single Element: Returns an element of corresponding data type or a
Style
single schema element when a schema is selected.
l Anonymous Array: Returns a JSON array without the parent element,
where the root element has exactly one child of the type Array.
l JSON with Root: Includes the root element in the input JSON string.

Request Data type of the Payload. It can be one of the following:


l XSD Element
l String
l Integer
l Boolean

TIBCO ActiveMatrix BusinessWorks™ REST Reference


47 | REST Service

Field Description

l Form Data - Tag/Value (application/x-www-form-urlencoded)


l Form Data - Multipart (application/form-data)

Query and You can perform the following operations:


Header
l Add Query Parameter
Parameters
l Add Header Parameter
l Remove Parameter
l Scroll Up
l Scroll Down

This pane has the following columns:


l Parameter Name

Name of the parameter. Users can edit the parameter name by clicking
on the parameter added.
l Type

Data type of the parameter. It can be:


o String
o Integer
o Long
o Float
o Double
o Boolean
o Byte
o Binary
o Date
o Date Time
o Password

TIBCO ActiveMatrix BusinessWorks™ REST Reference


48 | REST Service

Field Description

l Repeating

This field can be toggled to Yes and No.


l Required

This field can be toggled to Yes and No.


l Description

You can edit this field to provide additional details by clicking on the
parameter added. For newly created services, this field's details reflect
in the Swagger file generated within ActiveMatrix BusinessWorks. For
existing Swagger files with this field, you must create a new service
using the Swagger file.

Response tab
Field Description

Use HTTP Selecting this check box includes the response headers element. Response
Headers headers are not commonly used, so select this check box only when you
need to include response headers.

When you select this check box, you can add custom HTTP fault headers
defined in the Response Status tab.

Use Custom You can specify a custom status line (status code and reason phrase) to the
Status Line outgoing message. The codes used must be defined in the configuration
under the Response Status tab.

Response The operation returns a status code as response, when this check box is
with Status selected. Message body is not required. For example, using a POST operation
Code Only returns a 201 status code which means Created and responds with the
resource URL.

Use Empty Select the check box to set empty values instead of NULL values in JSON.
Values for That is, use square brackets ([]) instead of NULL.
Null
By default, the check box is clear.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


49 | REST Service

Field Description

Format Supported formats for REST service request are:


l JSON
l XML
l Text
l Binary - This check box is visible only for Swagger 3.0 REST services.

Note: When you select the Binary check box all other check boxes are
disabled and the JSON Definition Style option is not visible. Instead, the
Media Types field is displayed.

JSON Select one of the following options:


Definition
l Single Element: Returns an element of corresponding data type or a
Style
single schema element when a schema is selected.
l Anonymous Array: Returns a JSON array without the parent element,
where the root element has exactly one child of the type Array.
l JSON with Root: Includes the root element in the input JSON string.

Media Types This field is enabled only when the Binary check box is selected.

Select one of the following options :


• application/octet-stream
• application/pdf
• image/png
• image/jpeg

To dynamically set a binary media type other than the available options , do
the following:
• Ensure that you have Media Type as application/octet-stream.
• Select the Use HTTP Headers check box and then pass Media Type
value in the Content-Type response header. This media type is not
updated in the Swagger file but is set at run time.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


50 | REST Service

Field Description

Resource Displays the schema selected. This option is not available when the Use
Schema Custom Status Line and Response with Status Code Only check boxes are
selected. The following options are available:
l binary: This option is available only when you select the Binary check
box.
l base64: This option is available only when you select the Binary check
box.
l String
l Integer
l Boolean
l XSD element: Selecting this option to either select the XSD schema
element available under the Schemas folder of your project or a create
new XML schema resource. Click Create New Schema to a create new
XML schema resource using the Simplified Schema Editor wizard.

Note: Ensure that the schema resource you select does not contain
cyclic dependencies on other schemas , or a type that has two child
members with the same local name, but different namespaces.

Header This field is enabled only when Use HTTP Headers check box is selected.
Parameters
You can perform following operations:
l Add Header Parameter
l Remove Parameter
l Scroll Up
l Scroll Down

This pane has the following columns:


l Parameter Name

Name of the parameter. Users can edit the parameter name by clicking
on the parameter added.
l Type

TIBCO ActiveMatrix BusinessWorks™ REST Reference


51 | REST Service

Field Description

Data type of the parameter. It can be:


o String
o Integer
o Long
o Float
o Double
o Boolean
o Byte
o Binary
o Date
o Date Time
o Password
l Repeating

This field can be toggled to Yes and No.


l Required

This field can be toggled to Yes and No.


l Description

You can edit this field to provide additional details by clicking on the
parameter added. For newly created services, this field's details reflect
in the Swagger file generated within ActiveMatrix BusinessWorks. For
existing Swagger files with this field, you must create a new service
using the Swagger file.

Response Status tab


Column Description
Name

Code These are unique numbers. Click on the error code to customize it.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


52 | REST Service

Column Description
Name

Note: Use custom status code 200 only when the response is not defined,
that is, when the Response with status code only check box is selected in
the Response tab.

Restriction: If you select the Response Format as Binary, do not add any
status code.

Type Data type of the error code. Following types are supported:
l XSD Element...

Select this option to either select the XSD schema element available under
the Schemas folder of your project or create a new XML schema resource.
l String
l Integer
l Boolean

The default type is String.

Reason Description of the error code. Click on the value to customize the description.
Phrase

Path Parameters
This section shows the following details.

Parameter Type Description


Name

Parameter The parameter You can edit this field to provide additional details by
name of the type. It can be any clicking on the parameter added. For newly created
operation one of the services, this field's details reflect in the Swagger file
used following: generated within ActiveMatrix BusinessWorks. For
existing Swagger files with this field, you must create a
l String

TIBCO ActiveMatrix BusinessWorks™ REST Reference


53 | REST Service

Parameter Type Description


Name

l Integer new service using the Swagger file.


l Boolean
l Long
l Float
l Double
l Byte
l Binary
l Date
l DateTime
l Password

Advanced Configuration
This section has the following field:

Field Literal Description


Value/
Module
Property

Blocking Yes This field sets the number of threads to be created for a REST
Queue Size service. It gives you control over the number of threads that are
created for the REST service. By default, it is set to a large integer
value.

Policies
To associate a new or existing policy with the REST binding, click Policies node under the

RestService tree, then click Add Policy to create a new policy. To edit an existing
policy details, click the policy name and edit any of the following fields.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


54 | REST Service

Field Description

Policy Name The name of the policy.

Policy Type The type of policy associated with the binding. The REST binding can support
the Basic Authentication policy. For more information, see "Enforcing Basic
Authentication".

Description A description of the policy.

Accept Header Responses


REST Service Binding allows users to set preferences for responses. Responses can be set
to either BW Service Response to honor the TIBCO ActiveMatrix BusinessWorks™ service
responses or Accept Header, which accepts headers set by the client or browser.
The following table shows the REST service responses based on the Accept Header
settings.

Accept Header BW Support till Support Support Version


(Client) Service version from from ActiveMatri
Respon TIBCO version version x
se ActiveMatrix ActiveMatrix ActiveMatri BusinessW
BusinessWo BusinessWo x orks 6.4.0
rks™ 6.3.1 rks™6.3.2 to BusinessW (Enforce
vesion 6.3.5 orks 6.4.0 BW Service
(Default Response)
behaviour)

application or JSON JSON JSON JSON JSON JSON

application or XML JSON XML Error: 406 Error: 406 Error: 406

*/* JSON JSON JSON JSON JSON

application or JSON JSON Error: 406 Error: 406 Error: 406


XML;q=0.9

TIBCO ActiveMatrix BusinessWorks™ REST Reference


55 | REST Service

Accept Header BW Support till Support Support Version


(Client) Service version from from ActiveMatri
Respon TIBCO version version x
se ActiveMatrix ActiveMatrix ActiveMatri BusinessW
BusinessWo BusinessWo x orks 6.4.0
rks™ 6.3.1 rks™6.3.2 to BusinessW (Enforce
vesion 6.3.5 orks 6.4.0 BW Service
(Default Response)
behaviour)

application or JSON JSON XML XML JSON


XML;q=0.9,*/*

application or XML,*/* JSON JSON XML XML JSON

application or JSON JSON NA text/plain JSON


json,text/plain,*/*

application or JSON JSON NA text/plain JSON


json,text/plain

application/json XML text/plain Error:406 Error:406 Error:406

application/xml XML XML XML XML XML

*/* XML XML XML text/plain XML

application/xml;q=0.9 XML text/plain XML XML XML

application/xml;q=0. XML XML XML XML XML


9,*/ *

application/xml,*/* XML XML XML XML XML

application/json,text/ XML XML XML text/plain XML


plain,*/*

application/json,text/ XML text/plain Error:406 Error:406 Error:406


plain

TIBCO ActiveMatrix BusinessWorks™ REST Reference


56 | REST Service

Creating a REST Service


A service is created from a process. You expose the process and describe the content that
is sent and received by the process in an XSD. The XSD defines the data that you send and
receive. The process is the actual implementation of what you do with the data.
The key abstraction of information in REST is a resource. REST ignores the details of
component implementation and protocol details. ActiveMatrix BusinessWorks supports the
following HTTP methods: GET, PUT, DELETE, PATCH, and POST. Both XML and JSON are
supported as data serialization formats along with support for definition of custom status
codes, path (URL) parameters, key-value parameters, query parameters, form parameters,
and custom HTTP headers.
You can create a REST service in TIBCO Business Studio for BusinessWorks in one of the
following ways:
l Using a Swagger file
l Without a Swagger file by creating a process and adding a REST resource to it using
the REST Service Wizard

Using Swagger to Create a REST Service


You can drag a path from the Swagger file on to the left boundary of the Process Editor to
create a REST service or drag it to the center and select Create Service from the resulting
menu.
When you create a REST service, make sure to edit the Default Host field in the HTTP
Connection Resource to reflect the actual host name. By default, the Default Host field is
set to localhost using the BW.HOST.NAME module property. When you use Swagger to create
a REST service, the fields in the Bindings tab of the service properties display as read-only.
Swagger is like a contract that must be followed exactly, so the service you create with the
Swagger file cannot be modified.
You can use the Refactor option to delete both REST service and reference Bindings WSDL
operations using a top down or a bottom up approach.
To create a REST service from a Swagger file:

Procedure
1. Create an empty project. For more information, see "Developing a Basic Process" in

TIBCO ActiveMatrix BusinessWorks™ REST Reference


57 | REST Service

TIBCO ActiveMatrix BusinessWorks™ Concepts.


2. Import the Swagger JSON file into the Service Descriptors folder of your project by
dragging it from the File Explorer view.
3. Expand the .json node that you just created under the Service Descriptors folder to
view the available paths.
4. Drag a path from the Service Descriptors folder to the left side of the process editor
to create a service or to the right side of the process editor to create a reference.
TIBCO Business Studio for BusinessWorks automatically generates a corresponding
XSD schema for the Swagger file in the Schemas folder.

Note:
For Swagger 3.0 files with callbacks, to create a REST service for the
callback, drag a callback URL from the tree view in the Project Explorer
pane to the process editor.

Using the Wizard to Create a REST Service


A REST service provider exposes the resources in a process definition that can be invoked
by clients using one of the following operations: POST, GET, PUT, PATCH, DELETE,
OPTIONS, HEAD, and custom.

Before you begin


If a schema definition does not exist, create (or import) a schema definition in the process
to which you want to add the REST service. To import an existing XSD file, drag and drop
the .xsd file from the File Explorer to the Schemas folder of your project.

Important: To generate Swagger 3.0 compliant services, in TIBCO Business


Studio for BusinessWorks select Window > Preferences > BusinessWorks >
Bindings > REST. Select the Swagger Version as 3.0 from the drop-down list.
By default, the Swagger Version is 1.2.

To create a new schema file in TIBCO Business Studio for BusinessWorks:

1. In Project Explorer, right-click the Schemas folder.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


58 | REST Service

2. Select New > XML Schema File.


3. In the Schema Editor, right-click in the respective box to add a directive, element,
type, attribute, or group.

Note: When you create a REST service, make sure to edit the Default Host field
in the HTTP Connector Resource to reflect the actual host name. By default,
the Default Host field is set to localhost.

Procedure
1. In the Project Explorer view, select the process to which you want to add the REST
service. There are multiple ways to invoke the wizard to create a REST service.
l From the main menu, select File > New > BusinessWorks Resources >
BusinessWorks REST Resource.
l Right-click the menu, select New > BusinessWorks REST Resource.
l Click on Create REST Service in the process editor area. (Note that REST
services can only be created in stateless ActiveMatrix BusinessWorks™
processes.)

2. In the REST Service Wizard window, configure the REST service implementation by
specifying the values for Resource Service Path, Type of Resource, Operations, and
Implementation Data.

REST Service Wizard

TIBCO ActiveMatrix BusinessWorks™ REST Reference


59 | REST Service

REST Service Wizard fields


Field Description

Resource Name The name for the new REST service

Summary Summary about the new REST service

Resource Service Specifies the URI that is used to access the REST service
Path

Resource Select a resource schema for the REST service, if needed


Definition

Operations By default, the POST operation is selected. Select or deselect the


operations as needed.

Note: You can add custom operations by clicking on the Add


Custom Operation button.

Implementation Choose between structured and opaque implementation data


Data

3. Optionally, click Next to configure the selected operations individually to specify the
nickname for the operation (the default nickname is of the format

TIBCO ActiveMatrix BusinessWorks™ REST Reference


60 | REST Service

<operation><resource_name>), summary, and the request and response elements and


their data types.
4. Click Finish.
The wizard adds the REST service and the selected operations, and also creates a
process definition with the multiple operations. It generates a .json file in the
Service Descriptors folder of your project when it creates the service.

Note: The REST service always implements the constructor operator.

5. Add activities to the process and configure them appropriately. For example, update
the POST process to add a Log activity to log the requests and connect the postOut
activity to Log activity.

6. Configure the input and output properties for the activities. For example, select
postOut activity and select Properties > Input. Expand the data tree in the Data
Source tab and map the post element from the left to the post Response element on
the right to echo the element. Similarly, for Log activity, map the post element on
the left to the ActivityInput message element on the right.
7. You can optionally add an operation to the service using the Create REST Operation
wizard. To open this wizard, click on the down arrow and click Create REST
Operation to open the wizard.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


61 | REST Service

8. Save your changes.

Result
The REST service is built and can be tested using the built-in tester Swagger UI.
For more information about the Swagger UI, see "Testing the REST Service" in TIBCO
ActiveMatrix BusinessWorks™ Getting Started.

Rest Service Wizard


Rest Service Wizard is used to create a new REST resource or add REST services to an
existing resource in TIBCO Business Studio for BusinessWorks.

The Rest Service Wizard has the following fields:

Field Description

Resource Name The name of the REST resource.

Summary The summary or description of the REST resource.

Resource Service The relative path for this REST service resource.
Path
If an application contains multiple REST bindings, ensure that the
location of the path parameters is unique for each REST binding.

For example, one REST binding is using the paths /book/{isbn} and
another REST binding is using the path /book/{authorid}. Since {isbn}
and {authorid} are defined at the same location in the URI , one of
these services do not function correctly.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


62 | REST Service

Field Description

In addition to path parameters, the path in a REST binding can also


contain query parameters. For example,

/resource/path/{pathparam}? query={queryparam} or
/resource/path/{pathparam}?{ queryparam}

Resource The XSD schema element to be used for creating the REST resource.
Definition
You can also use this to create the input and output of each operation
defined. You can override this on the next screen if required, for each
operation.

Operations These are the HTTP methods implemented by this REST service.

Currently POST, GET, PUT, PATCH, DELETE, OPTIONS, HEAD, and custom
methods are supported for users to implement.

Note: You can add custom operations by clicking on the Add Custom
Operation button.

Implementation The implementation data field can be Structured or Opaque.


Data
l Structured: The XSD element structure is preserved for the input
and output of every operation. You need not manually parse the
payload to generate the actual element to be used in the process.
l Opaque: Use this mode to apply the pass through mechanism. You
get a messageBody element in the input or output of every
operation and then you must use either parse activities for JSON
or XML to get a structured output for the payload.

Note: To add additional services to a process, click Create A Rest Service


on the top left of the process canvas.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


63 | REST Service

Note: Re-creating a component containing a REST binding after deleting the


component is not supported. To add the REST binding, in the process editor,
right click on the service without a binding. Go to Components >
[componentware] > Create REST Binding. A binding is created for the service.
The binding has to be re-configured as the previous configurations are lost.

Using JSON Payload or an Existing XSD File


To use an existing JSON Payload or XSD file to create a service, import them into TIBCO
Business Studio for BusinessWorks .
To use an existing XSD file, drag and drop the XSD file from the File Explorer into the
Schemas folder of your project. Then use the REST Service Wizard to create a service by
following the instructions in Using the Wizard to Create a REST Service section.
To use a JSON payload, create an XSD schema with the JSON payload. For more
information, see Creating XML Schema From a JSON Payload . Then use the REST Service
Wizard to create a service by following the instructions in Using the Wizard to Create a
REST Service section.

REST Service Tutorial


The REST Bookstore sample lets you explore the REST tooling in TIBCO Business Studio for
BusinessWorks. You can import this sample into TIBCO Business Studio for BusinessWorks
through File Explorer and examine the project.
The processes in the sample implement different aspects of a bookstore, such as adding a
book, deleting a book, and retrieving a list of books or a single book by its ISBN.
For more information about the sample, see "Using REST to Manage Books for a
Bookstore" in ActiveMatrix BusinessWorks Samples.
This tutorial walks you through the steps to build an additional REST service for the sample
and test it in the debugger. You can use the Swagger UI to invoke the operations for the
REST resource.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


64 | REST Service

Prerequisites
Have the following installed or created on your computer:
l PostgreSQL
l Required database and tables
l Most recent version of Google Chrome web browser

For more information, see Installing PostgreSQL.

Installing PostgreSQL
This topic explains how to install the PostgreSQL database and create the database and
tables required for the Bookstore tutorial.

Procedure
1. Download and install PostgreSQL from http://www.postgresql.org/download/
Note the superuser password that you create as part of the installation process.

Note: If installing on Windows, do not install or run as Administrator.

2. Open a terminal window and navigate to the root folder of the PostgreSQL
installation. Open pg-env.bat and verify the path settings. Save the file if you make
changes.
3. Start the server. Navigate to the bin folder of the install directory and type: pg-ctrl
start
Enter the password you created for the superuser.
4. Open another terminal window and navigate to the BW_
HOME\samples\binding\rest\BookStore\scripts folder. Open readme.txt. On Unix
systems, use the first command in the readme to start the script from the psql
window. On Windows, copy the second command to start the script from the
command line.
5. Navigate to the PostgreSQL bin folder and paste the command line into the terminal
window. Modify the command as needed. For Windows, use forward slashes in the
command.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


65 | REST Service

Run the command to create the database, the database tables, and to populate the
database.
6. Open the PostgreSQL pgAdmin UI utility to see the database and tables.

Creating a New Process


These steps show how to create a new process.

Procedure
1. Open TIBCO Business Studio for BusinessWorks.

2. Open the Design perspective by clicking in the upper right.


3. Click the File Explorer tab. If the tab is not visible, click Window > Show View >
Other > FileSystem > File Explorer and click OK.
4. Click File > Switch Workspace and select or open a clean new workspace.
5. In the samples directory, select binding > rest > Bookstore and double-click
tibco.bw.sample.binding.rest.BookStore.zip.
This opens the project in the Project Explorer.
6. In the Project Explorer, expand the tibco.bw.sample.binding.rest.BookStore
project.
7. You can also import the sample using the File > Import > General > Existing Studio
Projects into Workspace > Select Archive File > Browse option.
8. The project is displayed in the Project Explorer panel on the left.

9. Expand the folders in the project to see all the project processes and resources. For
more information on folder structure, see TIBCO ActiveMatrix BusinessWorks™
Application Development.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


66 | REST Service

10. Expand Processes and then expand tibco.bw.sample.binding.rest.bookstore.db.


See BooksDB.bwp.

Note: The .bwp extension indicates that it is an ActiveMatrix


BusinessWorks process.

11. Double-click BooksDB.bwp.


The process comprises:
l Green chevron on the left indicates the service details.
l addBooks, getAllBooks, and so on indicate the operations implemented by this

TIBCO ActiveMatrix BusinessWorks™ REST Reference


67 | REST Service

process.
l Each operation is implemented separately.

12. Double-click an operation to display the process for example, BooksPersist >
addBooks.
a. In the addBooks operation, you can see a JDBC activity.
b. The activity is repeated using a ForEach group.
c. addBooksOut represents the Reponse to the web service request.
13. To add a new process package named tibco.bw.sample.rest, right-click on Processes
in the Project Explorer view, and select New > BusinessWorks Package.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


68 | REST Service

14. In the BusinessWorks Package screen, specify tibco.bw.sample.rest in the Name field.

15. Click Finish and verify that the new package tibco.bw.sample.rest has been added
in the Project Explorer view.

Building a REST Service


This section details how to build a REST service.

Before you begin


The tibco.bw.sample.binding.rest.BookStore sample is loaded in the Project Explorer.

Procedure
1. To define a REST Resource named MyBooks, select

TIBCO ActiveMatrix BusinessWorks™ REST Reference


69 | REST Service

tibco.bw.sample.binding.rest.BookStore > New > BusinessWorks REST Resource.


The REST Service Wizard window is displayed.

2. Specify the following values in the REST Service Wizard window.


a. Resource Name: MyBooks
b. Summary: Summary about the new REST service. (default)
c. Resource Service Path: Auto-filled
d. Resource Definition: Select Browse > Schemas > Books.xsd > Books in the
Select Schema Element Declaration window.
e. Operations: Select POST and GET check boxes.
f. Implementation Data: Accept the default value of Structured.
3. Click Finish.
This creates a new process MyBooks.bwp process is opened in the Process Editor.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


70 | REST Service

4. Open the tibco.bw.sample.binding.rest.bookstore.db package in the Project


Explorer and select the BooksDB.bwp process. Drag it to the Process Editor and
drop it on the implemented POST operation.
A menu is displayed with two options: Create Invoke Activity and Create Reference
and Wire Process.

5. Select Create References and Wire Process.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


71 | REST Service

The references are added to the process. The purple chevron indicates the service
and its operations that can be referenced by the process.

6. To update the POST process to invoke the appropriate external service operation:
a. Click the addBooks operation.
b. Select and drag the operation to the left of the postOut activity and drop it. An
Invoke process activity is created.

7. Click the newly added activity. Select the icon and connect addBooks to
postOut

8. Click the getAllBooks operation and select, drag, and drop the operation to the left

TIBCO ActiveMatrix BusinessWorks™ REST Reference


72 | REST Service

of the getOut activity in the OUT process.


9. Connect getAllBooks to getOut.

10. Save your changes.


11. Click the addBooks activity and select Properties > Input.
12. Expand the data tree in the Data Source pane to locate the Book element.

13. Drag the Book element from the left to the Book* element on the right.
14. In the pop-up window, select Make a Copy of each " Book" and click Finish.
The Input tab looks like this:

TIBCO ActiveMatrix BusinessWorks™ REST Reference


73 | REST Service

15. Save your changes.


16. Click the postOut activity and open the Properties > Input tab. Expand the post
activity and drag the Book* element from left to right.
17. In the pop-up window, select the For each option and click Next. Click Finish on the
Auto-Map window. The Properties > Input tab looks similar to this:

18. Click getAllBooks and select Properties > Input.


19. In the XPath Expression pane, add a dummy value to the input element, such as,
"Get All Books". The input must be in quotes.

20. Click the getOut activity in the Process Editor, and select the Properties > Input

TIBCO ActiveMatrix BusinessWorks™ REST Reference


74 | REST Service

tab. Expand the getAllBooks activity and choose Book* to map the Book* element
from left to right. In the pop-up window, choose Make a Copy of each " Book" and
click Finish. The tab looks similar to this:

Result
Your project is complete without any errors.

Testing the REST Service


You can now test the REST service using the built-in tester and the Swagger UI.

Procedure

Note: The Swagger framework used to test the REST service is accessed
using the port specified by the bw.rest.docApi.port property in the
<TIBCO_HOME>\bw\<version>\domains\<domain
name>\appnodes\<appspace name>\<appnode name>\config.ini file. By
default, this property is set to port 7777. If you have multiple REST
applications running on separate AppNodes on a single machine or server,
you must configure these port numbers to be unique for each AppNode.
To do so, edit the bw.rest.docApi.port property in the config.ini file
for each AppNode.
If there are multiple REST applications running within a single AppNode,
there is no need to configure this port.

1. In the Project Explorer, expand the


tibco.bw.sample.binding.rest.BookStore.application process and expand the
Package Unit > Properties folder.
2. In the Properties window, open the tibco.bw.sample.binding.rest.BookStore
process and set the default ApplicationProfile to match the operating system you
are running on. The bracketed profile in the column head is the one that is selected:

TIBCO ActiveMatrix BusinessWorks™ REST Reference


75 | REST Service

3. Provide valid values for the application properties including a valid user name,
password, and database URL to connect to your PostgreSQL database if different
from the default setting.
4. Verify your JDBC connection.
a. Expand the Resources folder in the Project Explorer for the
tibco.bw.sample.binding.rest.BookStore process.
b. Double-click JDBCConnectionResource.jdbsResource.
c. In the JDBC Driver section of the window, click Test Connection to verify the
connection. If you change the JDBC driver folder from the default, click Click
Here to Set Preferences and set the JDBC driver folder to the folder where
you downloaded PostgreSQL JDBC Driver.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


76 | REST Service

5. Click File > Save.


6. In the Project Explorer, expand the Processes directory if it is not expanded and
double-click MyBooks.bwp.
7. Click Run > Debug Configurations.
8. In the left-hand tree of the Debug Configuration wizard, expand BusinessWorks
Application and select BWApplication.
9. Click the Applications tab and then click the Deselect All button if you have multiple
applications. Select the check box next to
tibco.bw.sample.binding.rest.BookStore.application.
10. Click Debug. This runs the sample in Debug mode.
The Console view is opened and shows engine messages similar to: Started BW
Application [tibco.bw.sample.binding.rest.BookStore.application:1.0].
11. In the Console view, press Enter to display the prompt: <>@BWEclipseAppNode>
Enter the OSGi command lrestdoc. This lists the Swagger UI URL as the discovery
URL: [Application Name]: tibco.bw.sample.binding.rest.BookStore.application
[Discovery Url]:
http://localhost:7777/tibco.bw.sample.binding.rest.BookStore.application
12. Launch the Google Chrome browser.
13. Open http://localhost:7777/tibco.bw.sample.binding.rest.BookStore.application
14. Click Books or Events to see the operations. Click MyBooks to see the REST service

TIBCO ActiveMatrix BusinessWorks™ REST Reference


77 | REST Service

operations you just added. For more information, see the section Testing the Post
and GET Operations.

15. Expand the Books and Events headers, and test out the operations as listed below.

Result
Click Books or Events in the Swagger UI to view the following operations for Books and
Events:
Books
l Post books
l GET books
l GET book by ISBN
l PUT book by ISBN

TIBCO ActiveMatrix BusinessWorks™ REST Reference


78 | REST Service

l DELETE book by ISBN

Events
l POST Events
l GET Events
l GET Event by EventID
l PUT Event by EventID
l DELETE Event by EventID

GET books returns an output similar to the following:

{
"Book": [
{
"isbn": "0061122416",
"name": "The Alchemist",
"description": "Every few decades a book is published that changes
the lives of its readers forever. The Alchemist is such a book",
"authorName": "Paul Coelho",
"releaseDate": "2006-04-25",
"vintage": true,
"signed": true,
"price": 11.9
},
{
"isbn": "0071450149",
"name": "The Power to Predict",
"description": "How Real Time Businesses Anticipate Customer
Needs, Create Opportunities, and Beat the Competition",
"authorName": "Vivek Ranadive",
"releaseDate": "2006-01-26",
"vintage": false,
"signed": true,
"price": 15.999
}
]
}

GET books by ISBN returns an output similar to the following for ISBN 0061122416:

{
"isbn": "0061122416",

TIBCO ActiveMatrix BusinessWorks™ REST Reference


79 | REST Service

"name": "The Alchemist",


"description": "Every few decades a book is published that changes
the lives of its readers forever. The Alchemist is such a book",
"authorName": "Paul Coelho",
"releaseDate": "2006-04-25",
"vintage": true,
"signed": true,
"price": 11.9
}

The books.log file is generated with the following information:

POST Books------->{"Book":[{"isbn":"1451648537","name":"Steve
Jobs","description":"Biography of Apple Co-Founder Steve
Jobs","authorName":"Walter Isaacson","releaseDate":"2012-10-
24","vintage":false,"signed":false,"price":21},
{"isbn":"0385537859","name":"Inferno","description":"Robert Langdon
returns in Dan Brown's latest fast paced action
thirller","authorName":"Dan Brown","releaseDate":"2013-05-
14","vintage":false,"signed":true,"price":14.09},
{"isbn":"0399103421","name":"The Godfather","description":"The Godfather
is an epic story of a New York's top mafia family, loyalty, and how men
of honor live in their own world, and die by their own
laws.","authorName":"Mario Puzo","releaseDate":"1969-03-
10","vintage":true,"signed":true,"price":5
0}]}**************************************************************

GET Books------->{"Book":[{"isbn":"1451648537","name":"Steve
Jobs","description":"Biography of Apple Co-Founder Steve
Jobs","authorName":"Walter Isaacson","releaseDate":"2012-10-
24+05:30","vintage":false,"signed":false,"price":21},
{"isbn":"0385537859","name":"Inferno","description":"Robert Langdon
returns in Dan Brown's latest fast paced action
thirller","authorName":"Dan Brown","releaseDate":"2013-05-
14+05:30","vintage":false,"signed":true,"price":14.09},
{"isbn":"0399103421","name":"The Godfather","description":"The Godfather
is an epic story of a New York's top mafia family, loyalty, and how men
of honor live in their own world, and die by their own
laws.","authorName":"Mario Puzo","releaseDate":"1969-03-
10+05:30","vintage":true,"signed":true,"price":5
0}]}**************************************************************

GET Book By ISBN------->{"isbn":"1451648537","name":"Steve


Jobs","description":"Biography of Apple Co-Founder Steve
Jobs","authorName":"Walter Isaacson","releaseDate":"2012-10-

TIBCO ActiveMatrix BusinessWorks™ REST Reference


80 | REST Service

24+05:30","vintage":false,"signed":false,"price":2
1}**************************************************************

DELETE Book By ISBN-------->"Deleted book with ISBN -


145164853
7"**************************************************************

GET Events By ISBN---->


{}**************************************************************

Testing the POST and GET Operations


An available RESTful service displays the GET operation in the Swagger UI. The POST
operation is tested using the JSON service. It is important to test these operations by doing
some simple tasks. This section explains how to test the POST and GET operations you just
added.

Procedure
1. Click books.
It expands and displays the POST and GET operations.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


81 | REST Service

2. Click the POST icon to display its details.


3. Click the Try it out! button.
4. Provide values to the Books parameter and then click Execute button. You can use
the JSON payload in the <BW_HOME>\samples\binding\rest\BookStore\samplejson
folder.
5. Now click the GET icon to display its details.
6. Click the Try it out! button.
7. Click the Execute button.
The response displays a list of books returned by the REST service from the database.

8. After you have finished, go back to TIBCO Business Studio™ for BusinessWorks™ and
click in the Console view to stop the process.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


82 | REST Service

Troubleshooting
Your may encounter some errors while executing or running the process. The following are
some of the possible errors you may encounter and their resolutions.

Error Encountered Resolution

Unable to insert rows into Use the sample JSON payload from the sample json folder to
the database using the post the data.
dbsetup.sql script in the
scripts folder.

The REST Swagger UI page is Verify that the application has started and that you are
not visible. accessing the correct URL. Use the lrestdoc command in the
Console view to get the Swagger UI URL.

Problem markers are visible Clean the project by invoking Project > Clean or by switching
in the project. to a clean new workspace.

Getting the File was not Ensure that the books.json and book_put.json files are
found exception. present at the location described in the Input_File and Input_
File_1 module properties.

The PostgreSQL server does Make sure you are not running as Administrator.
not start.

The database and database Open the readme.txt file for the sample, located in the BW_
tables are not created. HOME\samples\binding\rest\BookStore\scripts folder. Run
the dbsetup.sql script from a command line, not the psql
window.

Getting an unregistered Select all the check boxes in the Role Privileges tab in the
user error message while pgAdmin UI and run the process again. See the image below.
running the process.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


83 | REST Service

TIBCO ActiveMatrix BusinessWorks™ REST Reference


84 | REST Reference

REST Reference
A REST reference is a client process that is used to invoke an external REST service. The
service must be running and accessible from the system where the reference resides at the
time of its invocation.

REST Reference Binding


REST Binding provides external connectivity for REST over HTTP. You can specify custom
HTTP headers and parameters using REST binding. It supports POST, GET, PUT, PATCH,
and DELETE HTTP methods. It also supports JSON, XML, and plain text message types.

Binding
This section has the following fields.

Field Description

Implementation The Swagger specification in the project that defines the REST endpoint.
Resource This field is visible only when the reference is defined by a Swagger
specification, otherwise this field is replaced by the Resource Service
or
Path, which is the path to the resource.
Resource Service
Path

Resource Service Resource path of the REST resource to invoke.


Path
Note: Path parameters that are not immediately enclosed in forward
slashes are supported. For example, the parameter authorName('
{isbn}') in the resource service path /book/authorName('{isbn}')/
is not directly contained by forward slashes, but passes successfully.

You can override the resource service path dynamically by using the URL
element under dynamicConfigurations element on the Input tab of the

TIBCO ActiveMatrix BusinessWorks™ REST Reference


85 | REST Reference

Field Description

Invoke activity.

For more information, see Dynamic Invocation of a REST Service.

HTTP Client The name of the HTTP Client.

Tip: Click on the HTTP Client Name field to display details about the
HTTP Client shared resource.

You can override host and port values dynamically by using the URL
element under dynamicConfigurations element on the Input tab of the
Invoke activity.

For more information, see Dynamic Invocation of a REST Service.

Request Client The type of request message format.


Format
The two available reply message format options are: JSON or XML.
Applies to all operations unless overridden at the operation level.

Response Client The type of reply message format.


Format
The two available reply message format options are: JSON or XML.
Applies to all operations unless overridden at the operation level.

Path Parameters If Path parameters are defined in the REST service that the REST
Reference is calling, they appear in the Path Parameters table. However,
you cannot modify the Path parameters since the REST Reference must
adhere to the parameters defined by the service.

Note:
To enforce authentication on the REST Reference Binding, use the
authorization header or associate the binding with a Basic Credential Mapping
policy. For more information, see "Enforcing Basic Credential Mapping"

Summary tab
This tab shows the following details.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


86 | REST Reference

Field Description

Summary A brief description of the operation.

HTTP A unique identifier for the operation that identifies the operation in the entire
Method API. By default, it is set to <HTTP-Method>-<resource_name>.

Notes A field that can be used to describe the operation. Any text that is entered in
the Notes field appears in the Swagger file.

Request tab
This tab shows the following details.

Field Description

Use Empty Select the check box to set empty values instead of NULL values in JSON. i.e
Values for Null use [] brackets instead of NULL.

By default, the check box is clear.

Format Supported formats for REST service request are:


l JSON
l XML
l Text

Request Entity This field has two values:


Processing
l BUFFERED: the request entity is buffered in memory to determine the
content length that is sent as a Content-Length header in the request.
l CHUNKED: the entity is sent as chunked encoded (no Content- Length
is specified, entity is streamed). The Transfer-Encoding header is set to
Chunked.

The default value is Chunked.

JSON Specifies whether the request item is a Single Element or an Anonymous


Definition Array.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


87 | REST Reference

Field Description

Style

Request Data type of the Payload. It can be one of the following:


l XSD Element
l String
l Integer
l Boolean
l Form Data - Tag/Value (application/x-www-form-urlencoded)
l Form Data - Multipart (application/form-data)

Query and The user can perform following operations:


Header
l Add Query Parameter
Parameters
l Add Header Parameter
l Remove Parameter
l Scroll Up
l Scroll Down

This pane has the following columns:


l Parameter Name

Name of the parameter. Users can edit the parameter name by clicking
on the parameter added.

Note: Do not use a space in the HTTP header name. If you do, the
following error is displayed: Bad message- 400 - Illegal
character.

l Type

Data type of the parameter. It can be:


o String
o Integer

TIBCO ActiveMatrix BusinessWorks™ REST Reference


88 | REST Reference

Field Description

o Long
o Float
o Double
o Boolean
o Byte
o Binary
o Date
o Date Time
o Password
l Repeating

This field can be toggled to Yes and No.


l Required

This field can be toggled to Yes and No.


l Description

Description of the parameter. The description provided in a Swagger


file reflects in this field.

Response tab
This tab shows the following details.

Field Description

Use HTTP Select this check box only if you require a service to send back a custom
Headers header, or value or if you need to see the response headers.

This check box is selected by default if custom headers are used.

When you select this check box, you can add custom HTTP fault headers
defined in the Response Status tab.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


89 | REST Reference

Field Description

Use Null for Select the check box to set NULL values instead of empty values in JSON. i.e
Empty values use NULL values instead of [] brackets.

By default, the check box is clear.

Ignore Select this check box to ignore additional fields that are generated due to
Additional changes in the external payload when processing the schema.
JSON Fields
By default, the check box is clear.

Format Response format requested by the client, can be JSON, XML, Text, or Binary.
The service must support the formats that the client requests for this
operation.

JSON Specifies whether the request item is a Single Element or an Anonymous


Definition Array.
Style

Media Types This field is enabled only when the Binary check box is selected.

Select one of the following options :


• application/octet-stream
• application/pdf
• image/png
• image/jpeg

Resource The following options are available:


Schema
l binary: This option is available only when you select the Binary check
box.
l base64: This option is available only when you select the Binary check
box.
l String
l Integer
l Boolean

TIBCO ActiveMatrix BusinessWorks™ REST Reference


90 | REST Reference

Field Description

l XSD element: Selecting this option to either select the XSD schema
element available under the Schemas folder of your project or a create
new XML schema resource. Click Create New Schema to a create new
XML schema resource using the Simplified Schema Editor wizard.

Note: Make sure the schema resource you select does not contain
cyclic dependencies on other schemas , or a type that has two child
members with the same local name, but different namespaces.

Header This field is enabled only when you select the Use HTTP Headers check box.
Parameters
The user can perform following operations:
l Add Header Parameter
l Remove Parameter
l Scroll Up
l Scroll Down

This pane has the following columns:


l Parameter Name

Name of the parameter. Users can edit the parameter name by clicking
on the parameter added.

Note: Do not use a space in the HTTP header name. If you do, the
following error is displayed:Bad message- 400 - Illegal
character.

l Type

Data type of the parameter. It can be:


o String
o Integer
o Long
o Float
o Double

TIBCO ActiveMatrix BusinessWorks™ REST Reference


91 | REST Reference

Field Description

o Boolean
o Byte
o Binary
o Date
o Date Time
o Password
l Repeating

This field can be toggled to Yes and No.


l Required

This field can be toggled to Yes and No.


l Description

Description of the parameter. The description provided in a Swagger


file reflects in this field.

Response Status tab


This tab shows the following details.

Field Description

Code These are unique numbers. Click on the error code to customize it.

Note: Use custom status code 200 only when the response is not defined, that
is, when the Response with status code only check box is selected in the
Response tab.

Type Data type of the error code. Following types are supported:
l XSD Element

Select this option to either select the XSD schema element available under
the Schemas folder of your project or create a new XML schema resource.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


92 | REST Reference

Field Description

l String
l Integer
l Boolean

The default type is String.

Reason Description of the error code. Click on the value to customize the description.
Phrase

Policies
To associate a new or existing policy with the REST Binding, click Policies node under the
Rest Reference tree, then click Add Policy to create a new policy. To edit an existing
policy details, click the policy name and edit any of the following fields.

Field Description

Policy Name The name of the policy.

Policy Type The type of policy associated with the binding. The REST reference binding
supports the Basic Credential Mapping policy.

For more information, see "Enforcing Basic Credential Mapping" in


ActiveMatrix BusinessWorks Application Development.

Description A description of the policy.

Enabling JSON Payload Logging


To enable raw JSON payload logging for both Inbound and Outbound of the Invoke
activity for REST binding in debug logging, add the following logger in the logback.xml file:

<logger name="org.apache.http">
<level value="DEBUG"/>
</logger>

TIBCO ActiveMatrix BusinessWorks™ REST Reference


93 | REST Reference

Dynamic Invocation of a REST Service


Use the dynamicConfigurations element that is added on the Input tab of Invoke activity,
which is used for invoking a REST service with REST reference binding.
The dynamicConfigurations element consists of the following information :
l URL: The whole endpoint URL, which the user wants to override from reference
binding. The Host, Port on the HTTP Client shared resource and the Resource Service
Path on REST Reference Binding is overridden.

This field is displayed on the Invoke activity for REST reference binding that is created
using a Swagger file as well as by using the REST Reference Wizard.
The Request and Response schemas must be in-sync with the REST service that is to be
invoked. You can also override the path or query parameters by passing the same in the
endpoint URL, for example :
http://localhost:9678/resource/pathParamValue?query1=queryParamValue.

If the service is configured with HTTPS then the HTTP Client shared resource used on
Reference binding should be configured with corresponding Confidentiality or Default
Confidentiality fields.
For REST service which requires authentication either add the Basic Credential Mapping
policy or pass the Authorization Header.

Note: This field is displayed only for newly created Reference binding and does
not reflect for existing applications.

For deploying application on TIBCO Cloud Integration: If you want to change the dynamic
URL for applications deployed on TCI, select the Default Confidentiality check box on the
HTTP Client shared resource and then deploy the .EAR file on TCI. The TCI endpoint are
https based.

Invoke Activity for Rest Reference


Invoke activity is an asynchronous activity that calls an operation of a REST service through
REST Reference Binding.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


94 | REST Reference

General
The General tab has the following fields

Field Description

Name The name to be displayed as the label for the activity in the process.

Service Select the service for which to specify an operation.

Description
Provide a short description for the invoke activity

Advanced
The Advanced tab has the following field

Input item Literal Description


Value/Module
Property

Activity Yes The Invoke activity timeout in seconds. You can either
Timeout select a preset timeout (Default Timeout, 30, 60,or 120
(seconds) seconds) or specify a custom timeout in seconds.

Important: If the Invoke activity is configured to be


Default Timeout, then the timeout value equates to "3"
minutes by default. However this default value (3
minutes) can be modified to be a different value by
setting the AppSpace config.ini property
bw.engine.activity.async.waitTime.

Note: When the Invoke activity timeouts, the in-line


subprocess instance called by the Invoke activity can be
cancelled before the subprocess instance completes.
Hence, the business logic in the cancelled process
instance may not be executed to its entirety.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


95 | REST Reference

Conversations

You can initiate the conversation here. Click the Add New Conversation button to
initiate multiple conversations.
For more information about conversations, see the TIBCO ActiveMatrix BusinessWorks™
Application Development guide.

Input
The following is the input for the activity

Input Item Datatype Description

operationRequest simple or This input item has the primitive data type or
complex XSD element defined for the operation. If the
operation is configured with Form Parameters,
it is reflected here.

httpHeaders complex The HTTP Headers that are a part of the


REST request. The header structure is defined
by the HTTP protocol.

For more information about the fields and


content of the header, see the W3C HTTP
specification at w3.org.
l Accept: specifies the media types that
are acceptable for response messages
for the incoming request. For example,
text/*,text/html.

For more information about media


types, see the W3C HTTP specification at
w3.org

Note: To get status messages for


exceptions, set the Accept field to
*/* or text/html.

l Accept-Charset: specifies the character


sets that are acceptable for response

TIBCO ActiveMatrix BusinessWorks™ REST Reference


96 | REST Reference

Input Item Datatype Description

messages for the incoming request. For


example, iso-8859-5, unicode-1-1.

For more information about character


sets, see the W3C HTTP specification at
w3.org.
l Accept-Encoding: specifies the content-
coding values that are acceptable for
response messages. For example,
compress, gzip.
l Content-Type: the media type of the
entity body sent to the receiver.

For more information about media


types, see the W3C HTTP specification at
w3.org.
l Content-Length: indicates the size of
the entity body sent to the receiver.
l Connection: the requester can specify
options desired for this connection. For
example, the option close specifies that
the requester would like the connection
to be closed when the request is
complete.
l Cookie: A name and value pair (also
known as a cookie) containing
information that the HTTP server may
be expecting.
For more information about this field,
see the W3C HTTP specification at
w3.org.

Note: For correct parsing and


processing of cookies, input must be
in the format "key=value".

TIBCO ActiveMatrix BusinessWorks™ REST Reference


97 | REST Reference

Input Item Datatype Description

l Pragma: is used to include


implementation-specific directives that
might apply to the receiver.

For more information about this field,


see the W3C HTTP specification at
w3.org.
l Authorization: This header can be used
to provide credentials that authenticate
a user agent with a server, allowing
access to a protected resource. This
header indicates what authentication
schemes can be used to access the
resource.
l Dynamic Headers: The dynamic header
is an additional header parameter to
add runtime headers to the
REST Request.

Note: You can use only US-ASCII


characters in DynamicHeaders

The dynamic headers consist of the


following information:
• Name: the name of the header
• Value: the value of the header

You can consider the following


overriding conditions. Overrides the
value of HeaderName with the value
found in DynamicHeaders if it is a non-
repeating header. If more than one
occurrence of this header is found under
DynamicHeaders, it generates the
following exception.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


98 | REST Reference

Input Item Datatype Description

The header [ headerName ] is


defined as non-Repeating Header in
Input Headers. This header cannot
have multiple occurences in
DynamicHeaders.

If it is a repeating element, add the


respective name or value pairs under
DynamicHeaders, which is added to the
existing list maintained for this element.

For a repeating element, if the new


header name is not found under the
Headers section declared through
TIBCO Business Studio for
BusinessWorks, the following is added
into HTTP headers

• Shows only one value, if found


once in DynamicHeaders.
• Shows an array of values, if
found repeating in
DynamicHeaders.

Note: If the operation is configured


with Request Header Parameters,
they are reflected in this list at the
end.

dynamicConfigurations complex Specifies the values to override the binding


configuration values
• URL: The whole endpoint URL, which
the user wants to override from
reference binding. The Host, Port on
the HTTP Client shared resource and
the Resource Service Path on REST
Reference Binding is overridden. For
more information, see "Dynamic

TIBCO ActiveMatrix BusinessWorks™ REST Reference


99 | REST Reference

Input Item Datatype Description

Invocation of a REST Service".


• activityTimeout: The Invoke activity
timeout in seconds. At runtime, it takes
precedence over the Activity Timeout
value in the Advanced tab.

parameters complex This element contains the Path and Query


parameters configured on the operation.

Output
The following is the output of the activity

Output Item Datatype Description

OperationResponse simple or This field shows the response schema element for
complex the operation.

httpResponseHeaders complex This field contains the standard HTTP Response


Headers along with the Response Header
parameters if configured for the operation. It is only
visible when the operation is configured with HTTP
Response Header Parameter.

Fault
The Fault tab lists the possible exceptions generated by this activity. For more information
about error codes and the corrective actions to take, see the ActiveMatrix BusinessWorks
Error Codes guide.

Fault Generated When..

ActivityTimedOutException A timeout has been reached.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


100 | REST Reference

Fault Generated When..

clientFault The Rest Service responds with a message containing the 4XX
status code.

serverFault The Rest Service responds with a message containing the 5XX
status code.

Note: If the operation is configured with client or server error status codes, then
they are appended to the list.

Creating a REST Reference


The REST reference is used to consume a REST service. The REST client has a reference
which it uses to invoke a REST service. You can have multiple REST references to one REST
service. References that are created using a Swagger file, cannot be modified in TIBCO
Business Studio for BusinessWorks. You can only view the details of such a reference.
References that are created using the REST Reference Wizard can be modified in TIBCO
Business Studio for BusinessWorks because these references are not associated with a
Swagger file which they have to adhere to.
You can create a REST reference in one of the following ways:

Using Swagger to Create a REST Reference


If you have the Swagger file, you can import it into TIBCO Business Studio for
BusinessWorks and create a REST reference from it. At the time of the reference creation
the service created using that Swagger file may or may not be running or even exist. But
when the reference actually invokes the service, at the time of the invocation of the service
by the reference, the service must be running and accessible to the reference process.
References that are created using an imported Swagger file, cannot be modified in TIBCO
Business Studio for BusinessWorks. You can only view the details of such a reference.

Before you begin


The Swagger file must be imported into the Service Descriptors folder of the project. For

TIBCO ActiveMatrix BusinessWorks™ REST Reference


101 | REST Reference

Swagger files on your local machine you can import them by pointing the File Explorer to
the location of the Swagger file, then dragging and dropping the file from the File Explorer
into the Service Descriptors folder of your project. For Swagger files that reside on the
cloud, you can use the API Explorer view to get the Swagger specifications that were
created in API Modeler. Drag and drop the Swagger file into the Service Descriptors folder.
For more information, see the API Explorer.
To create a REST reference from a Swagger file:

1. Expand the .json file in the Service Descriptors folder in Project Explorer.
2. Drag and drop an endpoint in the API from the Service Descriptors folder to the
right boundary of the Process Editor.

Note:
For Swagger 3.0 files with callbacks, to create a REST reference for the callback,
drag a callback URL from the tree view in the Project Explorer pane to the
process editor.

Using the Wizard to Create a REST Reference


In TIBCO Business Studio for BusinessWorks, you can invoke a REST service without a
Swagger file. As long as you have the URL for the endpoint in a running service, you can
use the REST Reference Wizard in TIBCO Business Studio for BusinessWorks to create a
REST reference to invoke the service. A reference created using a wizard can be modified
since it does not have a Swagger contract to adhere to.
In the wizard, you can choose the operation(s) to implement in the reference and set up
the data elements used for the request and the response of each operation. You can add
additional operations to the reference after the reference has been created too.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


102 | REST Reference

Before you begin


l You must have the endpoint URL.
l You must know which operations are supported by the service.

Note: When invoking external REST services using the REST Reference Wizard,
the Request and Response of the REST method must be configured with the
corresponding XSD schema element used by the invoked service, otherwise the
service is not invoked.

To create a REST reference, follow the steps:

Obtain the URL for the service endpoint


Typically, the URL for an endpoint can be obtained from the API web page or some other
documentation where the service is described. This documentation should list the details
of the service such as operations that the service supports, the parameters used and the
data definitions for the requests and responses.

Verify the service is running


You can verify that the service is running by invoking it using a testing tool such as
Postman or SoapUI.

Create a new application and open the REST Reference Wizard


1. Create a new application if you do not already have one. For more information, see
"Creating an Application" in TIBCO ActiveMatrix BusinessWorks™ Application
Development.
2. Click the Create REST Reference icon to open the REST Reference wizard.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


103 | REST Reference

3. Enter the URL for the service in the Service URL text box.
4. Select the operations that you want to implement in your reference by selecting
respective check boxes and click Next.
5. Configure the request and response type for your operations in the Configuring the
Operation screen by selecting the request and response type from their respective
drop-down menus. Click Finish. The wizard creates a REST reference on the extreme
right of your Process Editor.
6. Open the Reference properties view by clicking on the reference name.

7. Click the HTTP Client link to open the HTTP Client Shared Resource configuration
page and verify that the Default Host has been set to the host where the service
resides.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


104 | REST Reference

8. Make sure that the port number is correct.

Note: Do not use port 7777. It is reserved for internal use.

9. You can optionally do the following in the Reference properties view:


l Add parameters for your operations
l Configure operation details, such as Request and Response for an operation by
clicking on the operation in the Operations table, then configuring the
Response and/or Request details in their respective tabs.
For more information about how to add parameters, see Parameter Support
section.
l Optionally, you can add an operation using the Create REST Operation wizard.
To open this wizard, hover your mouse next to the REST reference name until
you see the Create REST Operation icon and click the icon to open the wizard:

On the Create new REST Operations page, select the operation you want to
create and click Next. Configure the Request and Response for the operation if
need be and click Finish. You have the option to configure your request and
response for the operation at a later time too from the Reference properties
view.

You can now invoke any operation by dragging and dropping it in the process editor.

REST Reference Wizard


Rest Reference Wizard is used to create a Rest Reference in TIBCO Business Studio for
BusinessWorks which a REST client can use to invoke a running service.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


105 | REST Reference

The Rest Reference Wizard has the following fields:

Field Description

Service URL The URL to the REST Service.

Operations These are the HTTP methods implemented by the REST Reference process to
access the REST service.

Currently only POST, GET, PUT, PATCH, and DELETE methods are supported.

Note: To add additional operations to an existing REST reference process, click


Create Rest Operation . This icon appears when you hover over the
reference in the Process Editor as follows:

Changing the Request and Response Schemas


You can make changes to the schema for only those APIs that were created from ground
up by you without using a Swagger file. A Swagger file is like a contract that must not be
broken. An API created using a Swagger file must implement the Swagger contract exactly
and cannot be modified. Hence, for APIs that were created using a Swagger file, you can
only view the schemas, but cannot modify them.
If you make schema changes to the APIs that were created ground up by you in TIBCO
Business Studio for BusinessWorks, the Swagger for such APIs automatically gets updated
by TIBCO Business Studio for BusinessWorks .

TIBCO ActiveMatrix BusinessWorks™ REST Reference


106 | REST Reference

Synchronizing the Imported REST API Models in


TIBCO Business Studio for BusinessWorks
If a REST service developer has made changes to the service API after creating the service,
the changes needs to be propagated to all the places where the service is used. You can
check for updates to a Swagger file that has been imported into TIBCO Business Studio for
BusinessWorks. The icon to the left of the Swagger file in the Project Explorer in TIBCO
Business Studio for BusinessWorks displays an indication that the file has been modified in
its original location and the local copy of the file is not in synchronization with it source.
You can check for differences between the original Swagger file and its copy that was
created when importing it into TIBCO Business Studio for BusinessWorks. You can also
compare the differences between the two and update your local copy if need be. To do so,
follow these steps:

Procedure
1. Right-click the Swagger file under Service Descriptors in the Project Explorer.
2. Select Remote Interface.
The Check for Differences menu option checks for differences between the imported
copy and its original.
The Compare Differences menu option first checks for differences between the
imported copy of the Swagger file and its original. If there is a difference, the file
appears in the Synchronize tab and if you double-click it there it displays the two
files side by side with the differences highlighted.
The Update Local Copy menu item updates the copy of the file in your workspace to
match its original. It also regenerates the schema.

Note: No changes are performed for processes that have already been
created.

Using the Debug Engine


You can create a reference for a service that is running on your local machine.

Procedure

TIBCO ActiveMatrix BusinessWorks™ REST Reference


107 | REST Reference

1. Run the service using the Run BusinessWorks Application from the right-click
context menu.
2. Type lrestdoc in the Console once the service is running.

3. You can use the Try it out! button to verify that the service is running.
4. Copy the Discovery URL and paste it into a browser address bar and press Enter. The
Swagger page in the browser displays the path to the Swagger file of the running
service.

5. Copy the Swagger file URL and paste it into another browser tab address bar and
press Enter. The browser displays the contents of the Swagger file.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


108 | REST Reference

Now that you have the Swagger file for the service you can create a reference using
it. The reference can reside on a machine other than the machine where the service
is running. The Swagger file that you just obtained from the running service contains
all the information such as the hostname or the machine where the service is
running, the port number and the base path for the service. The reference you create
reaches out to the service using this information from the Swagger file.

Creating the Reference


To create a reference using the Swagger code that you retrieved from the service, you must
first create a Swagger file in the Service Descriptors folder of your process.
Create a process for the reference if you do not already have one. Create a .json file in its
Service Descriptors folder.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


109 | REST Reference

Procedure
1. Right-click the Service Descriptors folder of the process and select New > File.
2. Enter a name for the .json file and click Finish.
3. Right-click the newly created .json file in the Service Descriptors folder and select
Open With > Text Editor.
4. Paste the JSON code that you copied from the Swagger file into the Text Editor and
save the project.
5. Expand the .json file in the Service Descriptors folder to expose the paths.
6. Drag a path from the Service Descriptors folder to the right boundary of the Process
Editor to create a reference.

To make your reference application portable


The reference that you created above can only access a service that is running on a
reachable network address. You can modify the reference to use a hostname and port that
is configurable even after this application is deployed. Using a Module Property for the
hostname and port allows that property value to be provided by an administrator that is
running the application. Change the value if the service is physically moved to another host
or port.
Follow these steps to modify the reference such that it can invoke a service from a location
determined even after this application is deployed:

Procedure
1. Click on the reference name in the Process Editor to open its properties.
2. Click the Bindings tab.
3. Click the HTTP Client link in the Bindings tab.
4. In the HTTP Client section, click the Choose the field value type button next to the
Default Host field text box and select Module Property.
5. Enter host <IP address of machine on which the service is running> in the Default
Host text box and click .
It creates a module property called host and gives it the value of the service machine
hostname that you provided.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


110 | REST Reference

6. Open the module properties for the reference application by double-clicking on


<Application Name> > Package Unit > Properties
7. To see the newly created module property, expand the application module tree.
8. Click the up arrow button to promote the module property to application property.
Now the IP address is available to be accessed from outside the firewall.

REST Reference Tutorial


The REST reference tutorial shows you how to create a simple REST Invoke to an existing
REST Service defined by a Swagger specification.
You cannot convert REST reference to SOAP or vice versa.

Before you begin


The REST service which you want to invoke must be accessible from the reference process
at the time of its invocation.

Creating a New Application


1. Open TIBCO Business Studio for BusinessWorks.
2. Open the Design perspective by clicking the Design icon in the upper right corner.
3. Click File > New > Other > BusinessWorks > BusinessWorks Application Module
and click Next.
4. Enter tibco.bw.sample.binding.rest in the Project Name text box. Do not change the
remaining default settings.
5. Click Finish. This step creates a new application module with an empty process.
6. Obtain the Swagger file from the Swagger UI of the running service.
7. Copy and paste the content into a new file, and call it Books.json.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


111 | REST Reference

Importing the JSON File into your Project


1. In the Project Explorer, expand tibco.bw.sample.binding.rest application module.
2. Right-click Service Descriptors and select Import > Import... > General > File
System and click Next.
3. In the File system dialog box, click the Browse button and browse to the location of
the Books.json file.
4. Select the check box next to Books.json in the left pane and click Finish.

Creating the REST Reference


1. In the Project Explorer, completely expand the tibco.bw.sample.binding.rest folder
under Service Descriptors.
2. Select the /books under Books.json and drag and drop it to the right side of the
process in the Process Editor. The references are added to the process. The purple
chevron indicates the service and its operations.
3. In the Process Editor, right-click Add Activity > General Activities > Timer.
Optionally, you can configure the Sleep activity with IntervalInMillisec as 3000 in a
similar manner and connect the Timer with Sleep.
4. Drag the get operation under the purple chevron and drop it on the right of Timer
activity (or Sleep if configured) and connect the Timer activity with the get activity.
5. Drag the post operation under the purple chevron and drop it on the right of the get
activity, connect the get activity with the post activity.
6. Right-click the get activity select Show Properties View.
7. In the Properties view, select the Input tab and click Show Check and Repair icon
in the icon bar on the upper right corner of the Properties view.
8. Select the check box under Fix and click OK.
9. Click Show Check and Repair icon again.
10. Select the check box under Fix and click OK.
11. Select the post activity and right-click and select Show Properties View. In the
Properties View, select the Input tab and select Data Source tab.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


112 | REST Reference

12. Expand $get in the Data Source tab completely.


13. In the XPath Expression pane, expand the post-input completely.
14. Drag and drop Book* from the Data Source tab to the Book* under post-input in the
XPath Expression pane.
15. In the Drop dialog, select Make a copy of each "book" radio button and click
Finish.
16. Click Show Check and Repair icon in the icon bar on the upper right corner of the
Properties view.
17. Select the check box under Fix and click OK.
18. Click Show Check and Repair icon again. Select the check box under Fix and click
OK.
19. In the Project Explorer, select Books.json under Service Descriptors of
tibco.bw.sample.binding.rest.basic application module, and right-click Open With
> Text Editor and locate the "host" attribute. Make a note of the host name and port
number.

20. Expand the Resources folder under the tibco.bw.sample.binding.rest.basic


application module.
21. Double-click HttpClientResource.httpClientResource.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


113 | REST Reference

22. In the HTTP Client section, change the Default Host and Default Port to the values in
the Books.json file and select the Default Confidentiality check box.

23. Click File > Save All.

Testing the REST Reference


You can now test the REST service using the built-in tester and the Swagger UI. To do so
follow these steps:

1. Click Run > Debug Configuration.


2. In the left pane of the Debug Configuration wizard, expand BusinessWorks
Application and select BWApplication.
3. Click the Applications tab, then click Deselect All if you have multiple applications.
4. Select the check boxes next to tibco.bw.sample.binding.rest.basic.application and
tibco.bw.sample.binding.restapp.
5. Click Debug. This runs the sample in debug mode. The Console view is opened and
shows engine messages similar to: Started BW Application [
tibco.bw.sample.binding.rest.Basic.application:1.0]
6. In the Debug view, expand BWApplication [BusinessWorks Application] >
<launched> BWEclipseAppNode > tibco.bw.sample.binding.rest.Process and
select get.
7. In the JobData view, you can see the job data of the get activity.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


114 | REST Reference

TIBCO ActiveMatrix BusinessWorks™ REST Reference


115 | Creating Multiple Response based REST Service/Reference

Creating Multiple Response based REST


Service/Reference
A multiple response based REST Service is a service whose operations are configured to
respond with various media types. To specify these response media types, the content
keyword is used at the status code level.
In any Swagger file, to define multiple responses a similar structure is seen as below:

In the above example, GET operation when responding with 200 status code can provide a
reply with application/json, application/xml or text/plain content-type based on the Accept
header sent in the request.
In a similar way if an operation is responding with Fault status codes, then it can also be
configured with multiple media types.

In ActiveMatrix BusinessWorks, you can create multiple response based REST


Service/Reference using an OAS 3.0 swagger file.
For more information to create a top-down REST Service, see Using Swagger to Create a
REST Service

TIBCO ActiveMatrix BusinessWorks™ REST Reference


116 | Creating Multiple Response based REST Service/Reference

For more information to create REST Reference from a Swagger file, see Using Swagger to
Create a REST Reference

In ActiveMatrix BusinessWorks, the following UI changes are seen specific to multiple


response service.
1. REST Service and Reference Binding

a. In the Service Binding section, the Response tab for the operation displays only
the following check boxes :
Use HTTP Headers
Use Custom Status Line
Respone with Status Code Only (By default, this field is disabled)
Use Empty Values for Null
b. In the Reference Binding section, the Response tab for the operation displays
only the following check boxes:
Use HTTP Headers
Use Null for Empty values
Ignore Additional JSON Fields.
The descriptions for these fields can be found in the corresponding REST Service
and Reference Binding sections.
2. Response Status tab

TIBCO ActiveMatrix BusinessWorks™ REST Reference


117 | Creating Multiple Response based REST Service/Reference

For multiple response based service, the Response Status tab shows all the status
codes (including success and error codes), in the same tab.
This tab shows the following details:
a. Status Code - This field shows the HTTP status codes defined in the Swagger file
for the particular operation.
b. Media Type - This field displays the content-types defined for the particular
operation. The content-types which we already support, like JSON, XML, Text
and Binary media types would work.
c. Type - Data type of the status code, for example XSD Element, String, Integer or
Boolean.
d. Reason Phrase - Description of the status code defined in the Swagger file.
3. Reply activity on REST Service:

On the General section, select the following available options from the Reply With
field to send the reply message:
• Output Message
• Fault Message - This field does not appear when the fault status code is not
provided for the operation.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


118 | Creating Multiple Response based REST Service/Reference

Input Tab

This specifies the response to be sent to the client. The response schema depends
on the output message of the operation for this reply. If the operation is replying
with various media types, the input structure contains the item appended with
corresponding media type. For example, item-application-xml.
Similar behavior is seen when the service is replying with fault.

4. Invoking Multiple response based service:


To invoke a multiple response based service we have to provide the Accept Header

TIBCO ActiveMatrix BusinessWorks™ REST Reference


119 | Creating Multiple Response based REST Service/Reference

value in the Input tab of the Invoke activity, based on the expected response
content-type. For example, if we want the response in image/jpeg format, then we
can pass the same in the Accept Header.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


120 | Refactoring a REST Service or Reference

Refactoring a REST Service or Reference


You can change the configuration of your REST service even after it is created in TIBCO
Business Studio for BusinessWorks.
The steps to update a service configuration depends on whether the service was created
from an imported Swagger file or whether the service was created ground up in TIBCO
Business Studio for BusinessWorks.

Updating a Service Created from an Imported Swagger File


You can use a Swagger file to either create a service by implementing the contract in it or
you can use it to call a service that implements the Swagger file.
If the Swagger file you used to create your service or reference is updated by its provider,
update your implementation of that file to get the changes.
The icon to the left side of the Swagger file in the Project Explorer in the TIBCO Business
Studio for BusinessWorks displays an indication that the file has been modified in its
original location and the local copy of the file is not in synchronization with it source. You
can compare the differences between the two and update your local copy. To do so, follow
these steps:

Procedure
1. Right-click the Swagger file under Service Descriptors in the Project Explorer.
2. Select Remote Interface.
Check for Differences checks for differences between the imported copy and its
original.
Compare Differences first checks for differences between the imported copy of the
Swagger file and its original. If there is a difference, the file appears in the
Synchronize tab and if you double click it, it displays the two files side by side with
the differences highlighted.
Update Local Copy updates the copy of the file in your workspace to match the
source. It also regenerates the schema. It updates it in both the service and
reference.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


121 | Refactoring a REST Service or Reference

Note: Nothing changes for processes that have already been created.

Updating a Service Created within TIBCO Business Studio for


BusinessWorks
As you change your implementation of the service or reference, TIBCO Business Studio for
BusinessWorks automatically generates the Swagger file to match your changes.

Updating Configuration
You can edit the configuration for a REST service or a reference that was created from
scratch without a Swagger file. You cannot edit the configuration for a service or reference
that was created using a Swagger file.
View or edit the configuration for a REST service or reference by following these steps:

Procedure
1. Click the service or reference in the Process Editor.
2. In the General tab of the Properties view, click the link for the service or reference
binding.
3. In the Components properties, click the Bindings tab.
4. Click an operation under Operations in the RestService or RestReference tree to
edit the configuration of the operation.
The Summary page for that operation opens on the right. To edit the request,
response or response status for the operation, click the respective tabs.

Adding an Operation
For REST services and references that were created without a Swagger file, you can edit
their configuration to add or delete operations.
To add an operation after a REST service was created, do the following:

Procedure

TIBCO ActiveMatrix BusinessWorks™ REST Reference


122 | Refactoring a REST Service or Reference

1. Click the down arrow to the right of the service and select Create REST Operation.

2. In the REST Service Wizard, select a schema for the operation using the Browse
button for Resource Definition.
3. Select the operation check box.
4. Optionally, click Next to configure the operation. You can configure the operation
after you have added it from the Components page. For more information, see
Updating Configuration.
5. Click Finish.

Adding an Operation After the REST Reference


is Created
To add an operation after a REST reference was created, do the following:

Procedure
1. Hover your mouse next to the reference name.
2. Click the Create REST Operation icon.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


123 | Refactoring a REST Service or Reference

3. In the REST Reference Wizard, select the operation check box.


4. Optionally, click Next to configure the operation. You can configure the operation
after you have added it from the Components page. For more information, see
Updating Configuration.
5. Click Finish.

Adding or Deleting Parameters


You can add or edit a parameter for an operation in a REST service or a reference that was
created from scratch without a Swagger file. You cannot edit the configuration for a service
or reference that was created using a Swagger file.
To add or delete parameters for an operation, do the following:

Procedure
1. Click the service or reference in the Process Editor.
2. In the General tab of the Properties view, click the link for the service or reference
binding.
3. In the Components properties, click the Bindings tab.
4. Click an operation under Operations in the RestService or RestReference tree to
edit the configuration of the operation.
The Summary page for that operation opens on the right. To edit a parameter in the
request or response for the operation, click the respective tabs.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


124 | OSGI Commands to List REST URLs

OSGI Commands to List REST URLs


Use the OSGi command, lrestdoc, to list REST and Swagger URLs.

The lrestdoc command lists the following discovery URL:

<>@BWEclipseAppNode> lrestdoc
[Application Name]: tibco.bw.sample.binding.rest.BookStore.application
[Discovery Url]

The following are the commands to list endpoints.

<>@BWEclipseAppNode> lendpoints
[Application Name] : tibco.bw.sample.binding.rest.BookStore.application
[Endpoint Type] : REST
[Endpoint URL] : http://localhost:8123
[CLIENT FORMAT ] : JSON
[RESOURCE PATH ] : /book/{ISBN}
[HTTP METHODS] : GET, PUT, DELETE
[Endpoint Type] : REST
[Endpoint URL] : http://localhost:8123
[CLIENT FORMAT ] : JSON
[RESOURCE PATH ] : /books
[HTTP METHODS] : POST, GET
[Endpoint Type] : REST
[Endpoint URL] : http://localhost:8123
[CLIENT FORMAT ] : JSON
[RESOURCE PATH ] : /book/{ISBN}/events
[HTTP METHODS] : GET
[Endpoint Type] : REST
[Endpoint URL] : http://localhost:8123
[CLIENT FORMAT ] : JSON
[RESOURCE PATH ] : /event/{EventID}
[HTTP METHODS] : GET, PUT, DELETE
[Endpoint Type] : REST
[Endpoint URL] : http://localhost:8123
[CLIENT FORMAT ] : JSON
[RESOURCE PATH ] : /events
[HTTP METHODS] : POST, GET

TIBCO ActiveMatrix BusinessWorks™ REST Reference


125 | Exception Handling

Exception Handling
Errors (or faults) can occur when executing a process. Using fault handlers you can catch
faults or exceptions and create fault-handling procedures to deal with potential runtime
errors in your process definitions.
Fault handlers are the recommended way to catch faults or exceptions in a process. Two
types of fault handlers are available: Catch Specific Fault and Catch All Faults.
Fault handlers are defined at the scope level, as a result you can catch faults or exceptions
thrown by activities within a scope. To catch faults or exceptions specific to an individual
activity, you need to define a new scope for that individual activity and attach a fault
handler to the new scope.
At runtime, once a fault handler is executed, the associated scope does not complete due
to the error thrown. If a fault is not thrown in the fault handler, the process execution
continues with the first activity that follows the scope. If a fault is thrown in the fault
handler, then the engine checks for an enclosing scope that is designed to handle the fault.
If one is found, the engine executes it. Once the enclosing fault handler finishes its
execution, the engine executes the next activity following the scope. If no fault handlers are
found in the enclosing scopes, then the job terminates with a fault.

Creating Faults
Fault handlers are used to catch faults or exceptions and create fault-handling procedures
to deal with potential errors.
Fault handlers are defined at the scope level, as a result you can catch faults or exceptions
thrown by activities within a scope. There are two types of fault handlers: Catch Specific
Fault and Catch All Faults.
Fault handlers can be defined at the process level, or at a scope level within a process. The
diagram below shows two fault handlers - one defined at the process level and the other
defined at an inner scope level.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


126 | Exception Handling

Fault Handler Attached to an Inner Scope

Procedure
1. Select the activities inside the process where the exception is expected to occur and
select Create Scope > Scope from the right-click menu.
2. Move the cursor right underneath the scope's lower border to view the icons to
create fault handlers.

3. Click on one the following:


l
Create Catch to create a fault handler for a specific exception.
l
Create Catch All to create a fault handler to catch all exceptions.
A new fault handler is added under the scope.
4. Add activities and configure the fault handling procedure inside the fault handler
area. For example, add a Log activity inside the fault handler area to record

TIBCO ActiveMatrix BusinessWorks™ REST Reference


127 | Exception Handling

messages from the exception.

Using the Catch and Activities


You can place a Catch block in your process to deal with unhandled exceptions. Using the
Catch block, you can create a track that handles the exception and proceeds to the end of
the current scope; either the end of the process or the end of a group.
You can use the Catch block as an alternative to individually handling exceptions for each
activity, or you can use error transitions to handle some exceptions and the Catch block to
handle others.
The following figure illustrates the Catch block. The process waits for incoming orders sent
by way of HTTP requests. When an order arrives, each line item is checked for availability
in the ForEveryLineItem group. If an error occurs while checking the inventory, execution
transfers to the CheckInventory activity. A log file entry is written after which the transition
is taken to the end of the group. If the inventory is available, the order is processed, a
confirmation email is sent, and the response is sent back to the HTTP client. If the
inventory is not available, a response is sent back to the HTTP client stating that one or
more items are not available. If an error occurs outside of the ForEveryLineItem group,
execution transfers to the CatchAllOthers activity.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


128 | Exception Handling

Example of using the Catch block

The Catch block can specify the type of exception that should be caught. A list of
exceptions that can be raised in the current scope are available on the General tab of the
Catch block. Rethrow activity rethrows an exception but to catch it your second catch
block, Rethrow activity should be in a group. Any exceptions that are not already handled
by an error transition or Catch block can be handled by a Catch block that specifies the
Catch All option on the General tab.
Using the Rethrow activity, you can throw the exception currently being handled by a
Catch path. This is useful if you wish to perform some error processing, but then propagate
the error up to the next level.
For more information about the Catch and Rethrow activities, see the ActiveMatrix
BusinessWorks Bindings and Palettes Reference guide.

Adding Details to Error Code Descriptions


Error codes are defined in HTTP protocol. Each error code has a certain use that is
predefined in the HTTP protocol specification. TIBCO Business Studio for BusinessWorks

TIBCO ActiveMatrix BusinessWorks™ REST Reference


129 | Exception Handling

allows you to add more details to the description of an error code that might help in
debugging the error.
Error codes are defined per operation. If the same error code is defined in multiple
operations, you can define the error details that are specific to the operation within each
operation.

Note: You can edit error codes only in projects that were created ground up in
TIBCO Business Studio for BusinessWorks . In projects that were created using
an imported Swagger file, you can only view the error code details.

To add an error code to an operation or to edit the error code description, follow these
steps:

Procedure
1. In the Bindings tab of the process, expand the Operations tree in the left pane.
2. Click the operation for which you want to add an error code or modify an existing
error code description.
3. Click the Response Status tab in the right pane.

4. Click the Add Response Status button ( ) to add an error code.


The Reason Phrase that is shown by default in the default description for that error
code. You can click on it to add more details to the error description.

5. Click the code, type, or reason phrase to edit the field.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


130 | Exception Handling

Result
The newly added error code is available for you to select.

Using Swagger-Provided Faults


Fault codes that are defined in a Swagger file that is used in TIBCO Business Studio for
BusinessWorks can be viewed from the Response Status tab.
View the fault codes used in a REST service or reference follow these steps:

Procedure
1. Click the service or reference in the Process Editor.
2. In the General tab of the Properties view, click the link for the service or reference
binding.
3. In the Components properties, click the Bindings tab.
4. Click an operation under Operations in the RestService or RestReference tree to
edit the configuration of the operation.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


131 | Exception Handling

The Summary page for that operation opens on the right. To view the error codes,
click the Response Status for the operation.

Standard HTTP Status Codes


The official registry of HTTP response status codes are maintained by Internet Assigned
Numbers Authority (IANA).

The following are the most commonly used response codes:

Error Code Description

200 OK

201 Created

202 Accepted

204 No Content

301 Moved Permanently

303 See Other

304 Not Modified

TIBCO ActiveMatrix BusinessWorks™ REST Reference


132 | Exception Handling

Error Code Description

307 Temporary Redirect

400 Bad Request

401 Unauthorized

403 Forbidden

404 Not Found

406 Not Acceptable

409 Conflict

410 Gone

412 Precondition Failed

415 Unsupported Media Type

500 Internal Server Error

503 Service Unavailable

For more information, see Status Code and Reason Phrase at w3.org.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


133 | Eclipse Views for REST

Eclipse Views for REST


TIBCO Business Studio for BusinessWorks has API Explorer view that is useful when
working with REST APIs.

API Explorer
Displays a connected view of the ActiveMatrix BusinessWorks API Modeler residing in the
cloud. This view shows abstract APIs that were created in API Modeler. You can also view
the APIs residing on your local machine from the API Explorer.

When you open TIBCO Business Studio for BusinessWorks for the very first time, enter your
credentials for the registry site by opening the Settings dialog box and double-clicking on
the registry name and entering your username and password for the site in the resulting
dialog box. To open the Settings dialog, click the ( ) button on the upper right corner of
the API Explorer view and click Settings. This populates the API Explorer view with the
APIs that are available in the registry.

Adding a new registry to the API Explorer view


Use the Settings dialog in the API Explorer to add a new registry (location) from where you
want to view the APIs. To open the Settings dialog box, click the ( ) button on the upper

TIBCO ActiveMatrix BusinessWorks™ REST Reference


134 | Eclipse Views for REST

right corner of the API Explorer view, and click Settings.

By default, the Settings dialog box is configured with a Cloud registry which is set to the
URL for the API Modeler.
To create a new registry:

1. Click the New button.


2. Enter a name for the registry Name field.
3. Select whether the registry is pointing to a local folder on your machine (Local
Folder) or to a URL in the cloud (Cloud).
4. Provide the location of the registry in the URL field. If the registry points to a location
on the cloud, you need to provide the authentication details for it in the Username
and Password text boxes.
5. Click Finish.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


135 | Eclipse Views for REST

To edit an existing registry entry:

1. Click the name of the registry and click Edit.


2. Make your edits to the entry. You can change the name of the registry, delete the
registry configuration by clicking Remove, or changing the order in which the
registries show up in the API Explorer by using the Up and Down button.
3. Click Finish when you are done with your edits.

Select a specific registry entry check box to display the registry in the API Explorer view.
For more information, see Filtering the APIs in the API Explorer view.

Setting the presentation of the APIs in the API Explorer view


In this dialog box, you can specify how the discovered APIs appear in the API Explorer
view:
l API Presentation - specifies how the APIs appear in the API Explorer view
Flat - displays the APIs as a flat list with each API's version number displayed next to
its name in parenthesis. If there are multiple versions of the same API, each version is
shown as a separate API, hence multiple APIs with the same name but different
version numbers.
Hierarchical - displays every API as a hierarchy of API name label with version
number folder under it and the actual API under the version folder. If there are
multiple versions for an API, each version is listed in its own separate folder under
the API name label.
Latest Version - displays only the latest version of the API, even though there might
be multiple versions available.
l Group by API registry - groups the APIs according to the registry from which they
were discovered. You also have the option to display the URL of the APIs next to the
registry name by selecting the Show API Registry URL check box.
l Group apps by sandbox - If you have multiple sandboxes that contain apps, the
Cloud Applications view displays the sandboxes and groups the apps under their
respective sandbox.
l Check Supported Plugins - If your application uses plug-ins, you must verify that the
plug-ins are supported in ActiveMatrix BusinessWorks™ before you push the
application to the cloud. You can do so by clicking this button.
You should now see the APIs displayed in the API Explorer in the format that you specified
in the Settings dialog. Expanding an API shows you its version, the resource path, and the

TIBCO ActiveMatrix BusinessWorks™ REST Reference


136 | Eclipse Views for REST

operations you can perform on that resource.


The API Explorer view has the following quick-access buttons that you can use to format
the way the APIs are listed:
l
Refresh
l
Expand All
l
Collapse All

l
Group by API Registry
l
API Presentation
l
API Registries. Selecting a registry from this drop-down list toggles between
displaying and hiding the registry in the API Explorer.

Searching for APIs in API Explorer


Use the search filter that appears at the bottom of the API Explorer view to search for API
names that match the string that you enter in the Filter text box. You can search by typing
in the version number, the full API name, or a full word within an API name. Wildcards is
not supported. The search is case insensitive.

Filtering the APIs in the API Explorer view


If your APIs reside in multiple locations and you have set up the API registries in the
Settings dialog of the API Modeler view, you can filter the APIs in API Modeler such that it
shows you only the APIs available in a certain registry.
To do so, click the ( ) button on the upper right corner of the API Modeler view and select
the registry whose APIs you want to view.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


137 | Eclipse Views for REST

Settings
The Settings dialog is configured by default to access the TIBCO ActiveMatrix
BusinessWorks™ site. You can configure additional registries that you might need to access
using this dialog.

API Registry Configurations


To configure a new API registry, click the New button. Enter the following information:

name A unique name for the registry

type Registry type


l Cloud - Select the option when the registry is in the cloud and
then enter the URL in the URL text box.
l Local Folder - Select the option if the API resides on your local file
system, and then browse to the folder using the Browse button.

URL If you selected Cloud as your registry type, you must enter the site's URL
in this text box.

Authentication When creating a new API registry, enter your user name and password for
the registry that exists on the Cloud.

API Presentation
Configure how you want your API to appear in this view. The three types of presentations
available are:
l Flat - Displays the APIs as a flat list with each API's version number displayed next to
its name in parenthesis. If there are multiple versions of the same API, each version is
shown as a separate API, hence multiple APIs with the same name but different
version numbers.
l Hierarchical - Displays every API as a hierarchy of API name label with version
number folder under it and the actual API under the version folder. If there are
multiple versions for an API, each version is listed in its own separate folder under
the API name label.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


138 | Eclipse Views for REST

l Latest Version - If one or more APIs in your registry has multiple versions, selecting
this option shows only the latest version of the API and hides the older versions.

Other Configurations
Group by API registry - Groups the APIs according to the registry from which they were
discovered.
Show API Registry URL - Displays the URL of the APIs next to the registry name.
Group apps by sandbox - If you have multiple sandboxes that contain apps, the Cloud
Applications view displays the sandboxes and groups the apps under their respective
sandbox.
Check Supported Plug-ins - This button refreshes the supported list of plug-ins from
TIBCO ActiveMatrix BusinessWorks™. When you import an existing project that uses plug-
ins, you can validate that the plug-ins used in the project are supported in ActiveMatrix
BusinessWorks™ by clicking this button. A message is displayed indicating that the
supported plug-ins are synchronized. The read-only list of supported plug-ins shows up in
the Supported Plug-ins tab of the Properties dialog that you can access from the right-
click menu as shown below. You can verify that you have the latest list from the
synchronization timestamp at the bottom of the Properties dialog. You can also access the
Check Supported Plug-ins option by right-clicking in the API registry that you want to
connect to and selecting it from the resulting context menu.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


139 | Eclipse Views for REST

This list represents the plug-ins that is available to your projects in ActiveMatrix
BusinessWorks during runtime. In order to use a plug-in during design time, you must have
the plug-in installed locally on your machine. If your project uses a plug-in that is not
supported in ActiveMatrix BusinessWorks, an error message is displayed while pushing the
project to the cloud.
Properties - The Properties context menu item opens a dialog which provides information
about the registry from which you selected Properties in its General tab. The Supported
Plug-ins tab provides a read-only list of plug-ins that are supported in ActiveMatrix
BusinessWorks.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


140 | The REST and JSON Palette in TIBCO Business Studio™ for BusinessWorks™

The REST and JSON Palette in TIBCO


Business Studio™ for BusinessWorks™
The REST and JSON palette in TIBCO Business Studio for BusinessWorks provides activities
that you can use when creating a REST service or reference.
For more information about these activities, see the "REST and JSON" palette topics in
TIBCO ActiveMatrix BusinessWorks™ Bindings and Palettes Reference.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


141 | Security

Security
ActiveMatrix BusinessWorks provides basic authentication and HTTPS support on REST
services.
The Basic Authentication policy secures the HTTP layer of REST, SOAP, and pure HTTP
services by validating user name and password credentials stored in HTTP headers. User
name and password credentials can be authenticated against an XML File Authentication
provider.

Overview of Policies
Policies are categorized under the following policy types:
HTTP Security
l Basic Authentication
The Basic Authentication policy secures the HTTP layer of REST, SOAP, and pure
HTTP services by validating user name and password credentials stored in HTTP
headers. User name and password credentials can be authenticated against an XML
File Authentication provider or an LDAP Authentication provider.
l Basic Credential Mapping
The Basic Credential Mapping policy enables authentication for specified users by
automatically attaching appropriate credentials to request messages before they
reach services. You can choose to enforce Fixed or Conditional credential mapping.

SOAP Security
l WSS Provider
Configure the WSS Provider policy to enforce and validate authentication,
confidentiality, integrity, and time stamping of service-side messages.
l WSS Consumer
Configure the WSS Consumer policy to enforce and validate confidentiality, integrity,
time stamping, and credential mapping of response messages.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


142 | Security

Managing Policy Resources


Manage policies and policy resources from TIBCO Business Studio for BusinessWorks .

Creating a Folder for Policies


Policies are always stored in the Policies folder. The folder might not exist in projects you
have imported from previous versions of ActiveMatrix BusinessWorks™ 6.x. If you create a
new policy to add to an activity or binding, the Policies folder is automatically created. You
can also create a special folder to contain policies.
To create a special folder for policies, follow these steps:

Procedure
1. In the Project Explorer pane, right-click the application module and select New >
Folder to launch the BusinessWorks Application Folder wizard.
The Folder wizard opens.
2. Specify the following values in the New Folder window:
l Enter or select the parent folder: Type the name of the parent folder, or
select an existing folder to be the parent folder.
l Folder name: Type Policies.
3. Click Finish to create the Policies folder.
The new folder displays in the Project Explorer pane.
4. Right-click the Policies folder, and select Special Folders > Use as Policies Folder.

Result
The folder can now store policies.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


143 | Security

Creating an Authentication Resource


Policies use authentication resources to verify credentials and provide appropriate
credentials for users. Follow these steps to create a policy authentication resource.

Procedure
1. In the Project Explorer, right-click the Resources Folder, and select a new shared
resource. For example, select New > XML Authentication.
2. Edit the following fields:
l Resource Folder: Name of the folder where the resource is located.
l Package: Name of the package in the module where the new resource is
added. Accept the default package, or browse to select a different package
name.
l Resource Name: Name of the resource. Accept the default name, or type a new
name.
3. Click Finish.

Result
The authentication resource displays under the Resources folder in the Project Explorer.

Associating a Policy
Enforce security on your ActiveMatrix BusinessWorks™ application, by associating a policy
with an existing activity or binding.

Associating a Policy with an Activity


1. In the Process Editor, select the activity to associate the policy with. Activities that
support policies display the Policy tab under the Properties tab.
2. From the Properties tab, select the Policy tab.

3. Click the Add Policy to Activity icon.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


144 | Security

4. From the Select Policy window, perform one of the following actions:
l Click Create a New Policy to set up a new policy with resources. Policies you
can add to the activity are listed under Select the type of policy.
For more information about setting up policies and resources from the policy
wizard, see appropriate sections under HTTP Security and SOAP Security.
Click Finish to create the new policy.
l Select an existing policy under Matching Items and click OK.

The policy is associated with the activity.

Associating a Policy with a Binding


1. In the Process Editor, select the binding to associate the policy with.
2. From the Properties tab, select the Bindings tab.
3. Click the name of the binding under the Binding section.
4. Click the Bindings tab, and select the Policy field from the tree.

5. Click the Add Policy icon.


6. From the Select Policy window, perform one of the following actions:
l Click Create a New Policy to set up a new policy with resources. Policies you
can add to the activity are listed under Select the type of policy.
For more information about setting up policies and resources from the policy
wizard, see the appropriate sections under HTTP Security and SOAP Security.
Click Finish to create the new policy.
l Select an existing policy under Matching Items and click OK.

The policy is associated with the binding.

Removing a Policy
Follow these steps to remove a policy from an activity or a binding.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


145 | Security

Removing a Policy From an Activity


1. Select the activity associated with the policy.
2. From the Properties tab, select the Policy tab.

3. Select the policy to remove, and click the Delete the selected policy icon.

The policy is no longer associated with the activity.

Removing a Policy From a Binding


1. Select the binding associated with the policy.
2. From the Properties tab, select the Binding tab.
3. Under the Policies field, select the policy to remove, and click the Delete the

selected policy icon.

The policy is no longer associated with the binding.

HTTP Security
Apply security to the HTTP layer of REST, SOAP, and pure HTTP services.

Enforcing Basic Authentication


Implement the Basic Authentication policy to ensure user credentials in request messages
are authenticated.
First, set up a new Basic Authentication policy by creating and configuring the policy and
its resources. Next, associate the policy with an activity or binding in your application.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


146 | Security

Setting Up a Policy with Resources


Follow these steps to set a new Basic Authentication policy with resources:

1. In the Project Explorer, right-click the Policies folder and select New > Policy.

The Policy Wizard opens.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


147 | Security

2. Specify the following values in the Create New Policy Window:


l Policy Folder: Name of the folder where policies are located by default.
l Package: Name of the package in the module where the new policy is added.
Accept the default package, or browse to select a different package name.
l Policy Name: Name of the new policy. By default, the policy name is
configured to match the security policy you choose. For example, if you select
the Basic Authentication policy, the default name of the policy is Basic
Authentication.
3. Under Select the type of Policy, click Basic Authentication.
4. From the Policy Defaults drop-down menu, select one of the following options:

TIBCO ActiveMatrix BusinessWorks™ REST Reference


148 | Security

Note: The Policy Defaults menu offers a list of commonly used policy
configurations to choose from. After you select a Policy Default, a policy
with preconfigured settings and related resources is created. If resources
already exist in the module, the newly created policy automatically refers
them. However, if no resources exist, new resources with default settings
are created and referred to by the policy. To view policy configurations
and new resources that might be created, see the Default description at
the bottom of the Policy Wizard.

l Username/Password in workspace XML file: Select this option to verify user


credentials through an XML Authentication resource stored in your workspace.
A new Basic Authentication policy configured for XML authentication and the
following resources are produced in your workspace:
o A sample XML File containing user name and password credentials with
the default file name XMLUsers.xml
o A new XML Authentication resource with the default file name
BasicAuthentication_AuthenticationProvider.authxml
l Username/Password in filesystem XML file: Select this option to verify user
credentials through an XML Authentication resource stored in your local file
system. A new Basic Authentication policy configured for XML authentication is
produced in your workspace:
o A sample filesystem XML File the default file name BasicAuthentication_
AuthenticationProvider.authxml
l Username/Password in LDAP: Select this option to verify user credentials
through an LDAP Authentication resource. A new Basic Authentication policy
configured for LDAP authentication and the following resource is produced in
your workspace:
o A new LDAP Authentication resource with the default file name
BasicAuthentication_AuthenticationProvider.ldapResource.
l Empty Policy (No Default) : Select this option to create a new Basic
Authentication policy with no preselected options and no resources.
5. Optional. Select Always create new shared resources to ensure new resources are
generated for the policy and referred to by the policy.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


149 | Security

6. Optional. Select Create module properties for common fields to override default
properties in newly created resources with module properties. Resources with
module properties for common fields are generated after you select this option.
7. Select Finish to create the policy.

Configuring Resources and the Policy


For resource configurations, see the following topics under the "Shared Resources" topic in
the TIBCO Cloud™ Integration Bindings and Palettes Reference guide.
l XML Authentication
l LDAP Authentication

For policy configuration details, see the topic "Basic Authentication", under "Policy
Resources" in the TIBCO Cloud™ Integration Bindings and Palettes Reference guide.

Associating the Policy with an Activity or a Binding


You can associate the Basic Authentication policy with the following activities and bindings:
l HTTP Receiver Activity
l Wait for HTTP Request Activity

Note: Credentials authenticated on this activity are not used for


propagation during credential mapping.

l SOAP Service Binding


l REST Service Binding

For instructions about how to enforce a policy on an activity, or a binding in your


application, see Associating Policies topic.

Enforcing Basic Credential Mapping


Map credentials for different types of users by enforcing the Basic Credential Mapping
Policy.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


150 | Security

First, create and configure new policy. Next, associate the policy, with an activity or a
binding in your application.

Setting Up a Policy with Resources


Follow these steps to set up a new Basic Credential Mapping policy with resources:

1. In the Project Explorer, right-click the Policies folder and select New > Policy.

The Policy Wizard is displayed.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


151 | Security

2. Specify the following values in the Create New Policy Window:


l Policy Folder: Name of the folder where policies is located.
l Package: Name of the package in the module where the new policy is added.
Accept the default package, or browse to select a different package name.
l Policy Name: Name of the new policy. By default, the policy name is
configured to match the security policy you choose.
3. Under Select the type of Policy, select Basic Credential Mapping.
4. From the Policy Defaults drop-down menu, select one of the following options:

TIBCO ActiveMatrix BusinessWorks™ REST Reference


152 | Security

Note: The Policy Defaults menu offers a list of commonly used policy
configurations to choose from. After you select a Policy Default, a policy
with preconfigured settings and related resources is created. If resources
already exist in the module, the newly created policy automatically refers
them. However, if no resources exist, new resources with default settings
are created and referred to by the policy. To view policy configurations
and new resources that might be created, see the Default description at
the bottom of the Policy Wizard.

l Fixed Credentials: Select this option to ensure a fixed set of credentials are
mapped for all users. A new Basic Credential Mapping policy configured for
Fixed Basic Credential Mapping and the following resource is produced in your
workspace:
o An Identity Provider resource with the default file name
BasicCredentialMapping_FixedIdentityProvider.userIdResource
l Authenticated & Anonymous Users : Select this option to enforce Basic
Credential Mapping for authenticated users and anonymous users. A new Basic
Credential Mapping policy configured for conditional basic credential mapping
and the following resources are produced in your workspace:
o An Identity Provider resource for authenticated users with the default
file name BasicCredentialMapping_AuthIdentityProvider.userIdResource
o An Identity Provider resource for anonymous users with the default file
name BasicCredentialMapping_AnonIdentityProvider.userIdResource
l Role Based Credentials: Select this option to enforce basic credential mapping
for authenticated users with roles. A new Basic Credential Mapping policy
configured for conditional basic credential mapping and the following
resources are produced in your workspace:
o An Identity Provider resource for authenticated users with the default
file name BasicCredentialMapping_AuthIdentityProvider.userIdResource
o Two separate Identity Provider resources for authenticated users with
roles. The default file names of the resources are
BasicCredentialMapping_RoleIdentityProvider.userIdResource and

TIBCO ActiveMatrix BusinessWorks™ REST Reference


153 | Security

BasicCredentialMapping_RoleIdentityProvider1.userIdResource
l Empty Policy (No Default) : Select this option to create a new Basic
Authentication policy with no preselected options and no resources.
5. Optional. Select Always create new shared resources to ensure new resources are
generated for the policy and referred to by the policy.
6. Optional. Select Create module properties for common fields to override default
properties in newly created resources with module properties. Resources with
module properties for common fields are generated after you select this option.
7. Select Finish to create the policy.

Configuring Resources and the Policy


For more information about resource configurations, see Identity Provider in the Shared
Resources topics in the TIBCO ActiveMatrix BusinessWorks™ Bindings and Palettes Reference
guide.
For more information about policy configuration details, see Basic Credential Mapping,
under Policy Resources in the TIBCO ActiveMatrix BusinessWorks™ Bindings and Palettes
Reference guide.

Associating the Policy with an Activity or a Binding


You can associate the Basic Credential Mapping policy with the following activities and
bindings:
l SEND HTTP Request Activity
l Invoke REST API Activity

Note: To enforce credential mapping on a SOAP reference, apply the WSS


Consumer policy and select either SAML Token based Credential Mapping or
Username Token based Credential Mapping.

For instructions about enforcing a policy on an activity or binding in your application, see
Associating Policies.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


154 | TIBCO Documentation and Support Services

TIBCO Documentation and Support Services


For information about this product, you can read the documentation, contact TIBCO
Support, and join TIBCO Community.

How to Access TIBCO Documentation


Documentation for TIBCO products is available on the TIBCO Product Documentation
website, mainly in HTML and PDF formats.
The TIBCO Product Documentation website is updated frequently and is more current than
any other documentation included with the product.

Product-Specific Documentation
The following documentation for this product is available on the TIBCO ActiveMatrix
BusinessWorks™ page:
l TIBCO ActiveMatrix BusinessWorks™ Release Notes
l TIBCO ActiveMatrix BusinessWorks™ Installation
l TIBCO ActiveMatrix BusinessWorks™ Application Development
l TIBCO ActiveMatrix BusinessWorks™ Bindings and Palettes Reference
l TIBCO ActiveMatrix BusinessWorks™ Concepts
l TIBCO ActiveMatrix BusinessWorks™ Error Codes
l TIBCO ActiveMatrix BusinessWorks™ Getting Started
l TIBCO ActiveMatrix BusinessWorks™ Migration
l TIBCO ActiveMatrix BusinessWorks™ Performance Benchmarking and Tuning
l TIBCO ActiveMatrix BusinessWorks™ REST Implementation
l TIBCO ActiveMatrix BusinessWorks™ Refactoring Best Practices
l TIBCO ActiveMatrix BusinessWorks™ Samples

TIBCO ActiveMatrix BusinessWorks™ REST Reference


155 | TIBCO Documentation and Support Services

How to Contact TIBCO Support


Get an overview of TIBCO Support. You can contact TIBCO Support in the following ways:
l For accessing the Support Knowledge Base and getting personalized content about
products you are interested in, visit the TIBCO Support website.
l For creating a Support case, you must have a valid maintenance or support contract
with TIBCO. You also need a user name and password to log in to TIBCO Support
website. If you do not have a user name, you can request one by clicking Register on
the website.

How to Join TIBCO Community


TIBCO Community is the official channel for TIBCO customers, partners, and employee
subject matter experts to share and access their collective experience. TIBCO Community
offers access to Q&A forums, product wikis, and best practices. It also offers access to
extensions, adapters, solution accelerators, and tools that extend and enable customers to
gain full value from TIBCO products. In addition, users can submit and vote on feature
requests from within the TIBCO Ideas Portal. For a free registration, go to
TIBCO Community.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


156 | Legal and Third-Party Notices

Legal and Third-Party Notices


SOME TIBCO SOFTWARE EMBEDS OR BUNDLES OTHER TIBCO SOFTWARE. USE OF SUCH EMBEDDED
OR BUNDLED TIBCO SOFTWARE IS SOLELY TO ENABLE THE FUNCTIONALITY (OR PROVIDE LIMITED
ADD-ON FUNCTIONALITY) OF THE LICENSED TIBCO SOFTWARE. THE EMBEDDED OR BUNDLED
SOFTWARE IS NOT LICENSED TO BE USED OR ACCESSED BY ANY OTHER TIBCO SOFTWARE OR FOR
ANY OTHER PURPOSE.

USE OF TIBCO SOFTWARE AND THIS DOCUMENT IS SUBJECT TO THE TERMS AND CONDITIONS OF A
LICENSE AGREEMENT FOUND IN EITHER A SEPARATELY EXECUTED SOFTWARE LICENSE AGREEMENT,
OR, IF THERE IS NO SUCH SEPARATE AGREEMENT, THE CLICKWRAP END USER LICENSE AGREEMENT
WHICH IS DISPLAYED DURING DOWNLOAD OR INSTALLATION OF THE SOFTWARE (AND WHICH IS
DUPLICATED IN THE LICENSE FILE) OR IF THERE IS NO SUCH SOFTWARE LICENSE AGREEMENT OR
CLICKWRAP END USER LICENSE AGREEMENT, THE LICENSE(S) LOCATED IN THE “LICENSE” FILE(S) OF
THE SOFTWARE. USE OF THIS DOCUMENT IS SUBJECT TO THOSE TERMS AND CONDITIONS, AND
YOUR USE HEREOF SHALL CONSTITUTE ACCEPTANCE OF AND AN AGREEMENT TO BE BOUND BY THE
SAME.

This document is subject to U.S. and international copyright laws and treaties. No part of this
document may be reproduced in any form without the written authorization of Cloud Software
Group, Inc.

TIBCO, the TIBCO logo, the TIBCO O logo, ActiveMatrix BusinessWorks, ActiveSpaces, Business Studio,
TIBCO Business Studio, TIBCO Designer, TIBCO Enterprise Administrator, Enterprise Message Service,
Rendezvous, and TIBCO Runtime Agent are either registered trademarks or trademarks of Cloud
Software Group, Inc. in the United States and/or other countries.

Java and all Java based trademarks and logos are trademarks or registered trademarks of Oracle
and/or its affiliates.

This document includes fonts that are licensed under the SIL Open Font License, Version 1.1, which is
available at: https://scripts.sil.org/OFL

Copyright (c) Paul D. Hunt, with Reserved Font Name Source Sans Pro and Source Code Pro.

All other product and company names and marks mentioned in this document are the property of
their respective owners and are mentioned for identification purposes only.

This software may be available on multiple operating systems. However, not all operating system
platforms for a specific software version are released at the same time. See the readme file for the
availability of this software version on a specific operating system platform.

TIBCO ActiveMatrix BusinessWorks™ REST Reference


157 | Legal and Third-Party Notices

THIS DOCUMENT IS PROVIDED “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR
IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT.

THIS DOCUMENT COULD INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS. CHANGES


ARE PERIODICALLY ADDED TO THE INFORMATION HEREIN; THESE CHANGES WILL BE INCORPORATED
IN NEW EDITIONS OF THIS DOCUMENT. CLOUD SOFTWARE GROUP, INC. MAY MAKE IMPROVEMENTS
AND/OR CHANGES IN THE PRODUCT(S) AND/OR THE PROGRAM(S) DESCRIBED IN THIS DOCUMENT AT
ANY TIME.

THE CONTENTS OF THIS DOCUMENT MAY BE MODIFIED AND/OR QUALIFIED, DIRECTLY OR


INDIRECTLY, BY OTHER DOCUMENTATION WHICH ACCOMPANIES THIS SOFTWARE, INCLUDING BUT
NOT LIMITED TO ANY RELEASE NOTES AND "READ ME" FILES.

This and other products of Cloud Software Group, Inc. may be covered by registered patents. Please
refer to TIBCO's Virtual Patent Marking document (https://www.tibco.com/patents) for details.

Copyright © 2023. Cloud Software Group, Inc. All Rights Reserved.

TIBCO ActiveMatrix BusinessWorks™ REST Reference

You might also like