TIB Bwpluginrestjson 2.1 Users Guide
TIB Bwpluginrestjson 2.1 Users Guide
Two-Second Advantage®
Important Information
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.
THE SOFTWARE ITEMS IDENTIFIED BELOW ARE AVAILABLE UNDER SEPARATE SOFTWARE LICENSE
TERMS AND ARE NOT PART OF A TIBCO PRODUCT. AS SUCH, THEY ARE NOT COVERED BY THE TERMS
OF YOUR AGREEMENT WITH TIBCO, INCLUDING ANY TERMS CONCERNING SUPPORT, MAINTENANCE,
WARRANTIES, AND INDEMNITIES. DOWNLOAD AND USE THESE ITEMS IS SOLELY AT YOUR OWN
DISCRETION AND SUBJECT TO THE LICENSE TERMS APPLICABLE TO THEM. BY PROCEEDING TO
DOWNLOAD, INSTALL OR USE ANY OF THESE ITEMS, YOU ACKNOWLEDGE THE FOREGOING
DISTINCTIONS BETWEEN THESE ITEMS AND TIBCO PRODUCTS.
This document contains confidential information that 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 TIBCO Software Inc.
TIBCO, Two-Second Advantage, TIBCO Hawk, TIBCO Rendezvous, TIBCO Runtime Agent, TIBCO ActiveMatrix
BusinessWorks, TIBCO Administrator, TIBCO Designer, TIBCO ActiveMatrix Service Gateway, TIBCO BusinessEvents,
TIBCO BusinessConnect, and TIBCO BusinessConnect Trading Community Management are either registered trademarks
or trademarks of TIBCO Software Inc. in the United States and/or other countries.
Enterprise Java Beans (EJB), Java Platform Enterprise Edition (Java EE), Java 2 Platform Enterprise Edition (J2EE), and all
Java-based trademarks and logos are trademarks or registered trademarks of Oracle Corporation in the U.S. and other
countries.
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.
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. TIBCO SOFTWARE 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.
Copyright © 2012-2017 TIBCO Software Inc. All rights reserved.
TIBCO Software Inc. Confidential Information
| iii
Contents
Figures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .vii
Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ix
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xi
Related Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xii
TIBCO ActiveMatrix BusinessWorks Plug-in for REST and JSON Documentation . . . . . . . . . . . . . . . . . . . . xii
Other TIBCO Product Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xii
Typographical Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiii
TIBCO Product Documentation and Support Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xv
How to Access TIBCO Documentation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xv
How to Contact TIBCO Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xv
How to Join TIBCO Community . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xv
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
iv
| Contents
Badgerfish Conversion Rule . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Normal Conversion Rule . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Root Node Conversion Rule . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Null and Empty Values Conversion Rule . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Special Symbols Conversion Rule . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
Contents v
|
Error Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
vi
| Contents
Setting Up the Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
Running the Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
Expected Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
The InvokePartnerREST Project. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
Process Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
Setting Up the Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
Running the Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
Expected Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
Figures vii
|
Figures
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
viii
| Figures
Figure 29 CreditCheck Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
Figure 30 Credit Check Service Mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
Figure 31 The Configuration Panel for the LoanRequestProcess . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
Figure 32 Returned Response . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
Figure 33 JSON Input . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
Figure 34 Output Results When Property Is True . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
Figure 35 Output Results When Property Is False . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
Tables ix
|
Tables
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
x
| Tables
Table 29 REST Service Configuration Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
Table 30 Resource Configuration Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
Table 31 Method Configuration Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
Table 32 Configuration Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
Table 33 Configuration Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
Table 34 Proxy Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
Table 35 Trace Message Roles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
Table 36 Properties of Trace Message Roles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
| xi
Preface
TIBCO ActiveMatrix BusinessWorks Plug-in for REST and JSON used with TIBCO
ActiveMatrix BusinessWorks, allows you to expose TIBCO ActiveMatrix BusinessWorks
processes as RESTful web services, invoke RESTful web service APIs, and translate data
between JSON and XML formats.
Topics
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
xii
| Related Documentation
Related Documentation
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
|
Preface xiii
Typographical Conventions
Convention Use
ENV_NAME TIBCO products are installed into an installation environment. A product installed into
an installation environment does not access components in other installation
TIBCO_HOME
environments. Incompatible products and multiple instances of the same product must
be installed into different installation environments.
An installation environment consists of the following properties:
• Name Identifies the installation environment. This name is referenced in
documentation as ENV_NAME. On Microsoft Windows, the name is appended to
the name of Windows services created by the installer and is a component of the
path to the product shortcut in the Windows Start > All Programs menu.
• Path The folder into which the product is installed. This folder is referenced in
documentation as TIBCO_HOME.
RESTJSON_HOME TIBCO ActiveMatrix BusinessWorks Plug-in for REST and JSON is installed into a
directory within TIBCO_HOME. This directory is referenced in documentation as
RESTJSON_HOME. The default value of RESTJSON_HOME depends on the operating
system. For example, on Windows systems, the default value is C:\tibco\bw\plugins\restjson.
code font Code font identifies commands, code examples, filenames, pathnames, and output
displayed in a command window. For example:
Use MyCommand to start the foo process.
bold code font Bold code font is used in the following ways:
• In procedures, to indicate what a user types. For example: Type admin.
• In large code samples, to indicate the parts of the sample that are of particular
interest.
• In command syntax, to indicate the default parameter for a command. For example,
if no parameter is specified, MyCommand is enabled:
MyCommand [enable | disable]
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
xiv
| Typographical Conventions
Convention Use
italic font Italic font is used in the following ways:
• To indicate a document title. For example: See TIBCO ActiveMatrix
BusinessWorks Concepts.
• To introduce new terms. For example: A portal page may contain several portlets.
Portlets are mini-applications that run in a portal.
• To indicate a variable in a command or code syntax that you must replace. For
example: MyCommand PathName
Key combinations Key name separated by a plus sign indicate keys pressed simultaneously. For example:
Ctrl+C.
Key names separated by a comma and space indicate keys pressed one after the other.
For example: Esc, Ctrl+Q.
The note icon indicates information that is of special interest or importance, for
example, an additional action required only in certain circumstances.
The tip icon indicates an idea that could be useful, for example, a way to apply the
information provided in the current section to achieve a specific result.
The warning icon indicates the potential for a damaging situation, for example, data
loss or corruption if certain steps are taken or not taken.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
Preface xv
|
For information about this product, you can read the documentation, contact TIBCO
Support, or join TIBCO Community.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
xvi
| TIBCO Product Documentation and Support Services
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
|1
Topics
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
2
| Chapter 1 Plug-in Introduction
Product Overview
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
Product Overview 3
|
• Support for generating XML schemas from JSON data by using JSON tools. See
Using the JSON Tools on page 34 for more information.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
4
| Chapter 1 Plug-in Introduction
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
|5
This chapter describes the steps to configure and run TIBCO ActiveMatrix
BusinessWorksTM Plug-in for REST and JSON in TIBCO Designer.
Topics
• Overview, page 6
• Starting TIBCO Designer, page 7
• Creating a Project, page 8
• Creating an OAuth1.0 Shared Resource, page 10
• Creating a TIBCO ActiveMatrix BusinessWorks Process, page 11
• Adding Activities to the Process, page 12
• Testing the Process, page 13
• Deploying a Project, page 14
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
6
| Chapter 2 Getting Started
Overview
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
|
Starting TIBCO Designer 7
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
8
| Chapter 2 Getting Started
Creating a Project
After starting TIBCO Designer, you can create a project or open an existing project in the
displayed Startup panel. A project contains configuration files, which define options used
by a runtime plug-in.
To create a project in TIBCO Designer, perform the following steps:
1. In the TIBCO Designer Startup panel, click New Empty Project as shown in
Figure 1.
2. In the Save Project dialog box, save the project at a specific location.
a. Click Select a file from the file system next to the Project Directory field on
the Multi-File Project tab.
b. Navigate to the location where you intend to save the project and specify a name
for the project as shown in Figure 2. Click OK.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
|
Creating a Project 9
The TIBCO Designer window is displayed with the newly created project.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
10
| Chapter 2 Getting Started
To use the OAuth 1.0 authentication, you must create an OAuth1.0 shared resource in an
existing project and then run an Invoke REST API process.
To create an OAuth1.0 shared resource, perform the following steps:
1. Open the project folder you created in Creating a Project on page 8 in the Project
panel.
2. Expand the REST and JSON palette in the Palette panel, and drag the OAuth1.0 icon
to the Design panel to create a shared resource.
3. Configure the created OAuth1.0 shared resource and then click Apply to save the
configuration.
For more information about configuring OAuth1.0 shared resources, see OAuth1.0 on
page 40.
4. Save the project.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
Creating a TIBCO ActiveMatrix BusinessWorks Process 11
|
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
12
| Chapter 2 Getting Started
If you cannot view the REST and JSON palette in the Palettes panel, select Palettes
> Activities > REST and JSON from the TIBCO Designer menu to make the palette
visible.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
|
Testing the Process 13
After creating and configuring a process, you can test the process by using the test mode
tool. Testing the process helps you check whether the process works properly before
deploying it. For more information, see TIBCO ActiveMatrix BusinessWorksTM Process
Design Guide.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
14
| Chapter 2 Getting Started
Deploying a Project
Before deploying a project, you must create an Enterprise Archive file (EAR file) that
contains the configuration for the process definition. You can upload the archive to
TIBCO Administrator to deploy the associated application.
Complete the following steps to deploy a configured project:
1. Save the project in the TIBCO Designer window. Ensure that the processes saved in
the project is tested.
2. To create an Enterprise Archive, select Tools > Create Project EAR from the TIBCO
Designer menu.
3. Expand the newly created Enterprise Archive and select the Process Archive. Click
on the Processes tab.
4. In the Select A Resource dialog box, expand the folder to select the process definition
you want to include and then click Apply.
5. To build an archive, click the Enterprise Archive that you created in Step 2. Then click
Build Archive in the Configuration tab. An EAR file is generated and saved in the
location specified in the File Location field in the Configuration tab.
6. Deploy the project in TIBCO Administrator. Start TIBCO Administrator and upload
the EAR file for the project. Deploy the application and start the process.
See TIBCO ActiveMatrix BusinessWorksTM Administration for details about how to
deploy a project in TIBCO Administrator.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
| 15
This chapter explains the supported normal conversion rules and Badgerfish conversion
rules for mapping data between JSON and XML. It also describes the supported schema
types for formatting XML data and the supported root node conversion.
Topics
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
16
| Chapter 3 Supported XML and JSON Conversion
The different properties of XML and JSON formats do not guarantee all content in XML
is converted to JSON. For example, XML supports inline metadata with tags and
attributes, which has no such standard form in JSON. TIBCO ActiveMatrix
BusinessWorksTM Plug-in for REST and JSON provides the schema types to format XML
data and the conversion rules to map data:
• Schema Types
• Conversion Rules
When converting data between JSON and XML, you can format XML data with the
supported schema types.
Schema Types
You can use the following schema types to format XML data:
• Generic
• XSD
• Java Classes
See Supported Schema Types for Formatting XML Data on page 18 for more information.
Conversion Rules
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON supports the
following conversion functionalities:
• Converting data with the Badgerfish conversion rule, which is a comprehensive
conversion between JSON and XML.
See Badgerfish Conversion Rule on page 21 for more information.
• Converting data with normal conversion rules, which is a lossy conversion compared
to the Badgerfish conversion.
See Normal Conversion Rule on page 25 for more information.
• Root node control.
See Root Node Conversion Rule on page 28 for more information about root node
conversion.
• Null and empty values control.
See Null and Empty Values Conversion Rule on page 30 for more information about
converting data with null and empty values.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
JSON and XML Conversion Overview 17
|
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
18
| Chapter 3 Supported XML and JSON Conversion
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON supports mapping
XML data with the following schema types:
• Generic
• XSD
• Java Classes
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON supports different
implementation mechanisms when converting between JSON data and XML data based
on the XSD schema type. You can select an implementation mechanism by configuring
the com.tibco.plugin.restjson.json.111CompatibleMode property.
If you set this property to false or do not add the property, XSD schemas are used for
converting data between XML and JSON.
If you set this property to true, XSD schemas are not used for converting data between
XML and JSON, they are used for mapping and validating XML data. Besides, the XSD
schema type decides which data types and elements are preserved according to the
element definition in XSD when rendering JSON.
See Implementation Mechanism Exchange for Parsing and Rendering on page 116 for
details about how to change the approach.
Generic
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON supports conversion
of JSON strings to XML strings and vice versa.
XSD
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON supports converting
a JSON string to the structured XML data with an XML schema and vice versa.
If you do not select the Badgerfish check box, the XML schema handles the JSON data
based on the definition in XSD when parsing JSON data to XML data.
Java Classes
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON supports conversion
of a JSON string to structured XML data with a POJO JAR file, and vice versa.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
|
Supported Schema Types for Formatting XML Data 19
The plug-in generates XSD based on the given root of the Java class. The simple name of
the Java class root name is mapped to the XSD root element in lowercase. The fields of the
root class are mapped to the XSD sub-elements. The elements in the converted XSD are
surrounded with the xsd:all group type.
Conversion is not supported for Java collection. In the mapping, the supported Java
collection is surrounded with the xsd:all group type. If the Validate Output check box or
the Validate Input check box is selected when running the Parse JSON activity or the
Render JSON activity, a validation error message is generated.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
20
| Chapter 3 Supported XML and JSON Conversion
Corresponding
Supported Java Type XML Example XSD Type
java.math.BigDecimal <big-decimal>342346.445332</big-decimal> xsd:decimal
Collection Types
java.util.Vector </linked-list>
java.util.LinkedHashSet
Datetime Types
Other Types
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
|
Badgerfish Conversion Rule 21
If the Badgerfish check box is selected, ensure that the input data follows Badgerfish
conversion rules.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
22
| Chapter 3 Supported XML and JSON Conversion
Converted in JSON:
{
"doc": {
"@id":"1",
"$":"A unix timestamp or any date accepted by
strtotime"
}
}
Converted in JSON:
{
"method":{
"@id":"1",
"doc":{
"@id":"2",
"$":"A unix timestamp or any date accepted by
strtotime"
}
}
}
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
Badgerfish Conversion Rule 23
|
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
24
| Chapter 3 Supported XML and JSON Conversion
1. If you convert JSON data to XML data and then convert back to JSON data with the XSD schema type, TIBCO
ActiveMatrix BusinessWorks treats CDATA as a common text node.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
|
Normal Conversion Rule 25
Compared with Badgerfish conversion, normal conversion is lossy but it generates much
leaner and cleaner data.
1. If the StAXON check box under XSD schema type is selected, it handles JSON input
with key _content_ in the normal way as a JSON key.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
26
| Chapter 3 Supported XML and JSON Conversion
XML data types The same data type defined in the Java class
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
|
Normal Conversion Rule 27
1. If the original XML element is a simple element that contains an attribute or a namespace, a _content_ key is add-
ed before the JSON content after the XML data is rendered to JSON data with the normal conversion rule.
For example, the original XML data:
<root>
<a attr="test">testA</a>
<b xmlns="namespaces">testA</b>
</root>
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
28
| Chapter 3 Supported XML and JSON Conversion
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON provides the root
node control. The following sections outline root node conversion rules:
• Root Node Mapping from JSON to XML
• Root Node Mapping from XML to JSON
XSD When converting a JSON string to structured XML data with the XSD schema
type:
• If the input JSON string has a single root, the root is preserved in the
converted XML data.
Note: If JSON root does not match with output editor root and either
Badgerfish is not selected or StAXON is selected, the root element of
schema specified in Output tab in the Parse JSON activity is used as
wrapper in the generated XML.
• If the input JSON string does not have a single root, the root element of
the schema, which you specified in the Output tab in the Parse JSON
activity, is used as the root element.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
Root Node Conversion Rule 29
|
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
30
| Chapter 3 Supported XML and JSON Conversion
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON offers the capability
to convert elements whose values are null or empty between XML and JSON. Both
Badgerfish conversions and normal conversions are in line with the following rules:
• Mapping from XML Data to JSON Data
• Mapping from JSON Data to XML Data
Table 7 Null and Empty Values Conversion Rules for Rendering JSON
XML
Description JSON Data
Data
An empty XML element1 <a/> {"a":null}
An XML element with whitespace text node2 <a> </a> {"a":" "} or {"a":{"$":" "}}
1. If the Java Classes schema type is used, the converted JSON data must be {"a":""}.
2. When converting an XML element with whitespace text node to JSON data, as for the converting result, the
Badgerfish conversion rule is different from the normal conversion rule:
With the normal conversion rule selected, the converting result is {"a":" "}.
With the Badgerfish conversion rule selected, the converting result is {"a":{"$":" "}}.
Table 8 Null and Empty Values Conversion Rules for Parsing JSON
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
|
Null and Empty Values Conversion Rule 31
Table 8 Null and Empty Values Conversion Rules for Parsing JSON (Cont’d)
1. If the Java Classes schema type is used, the converted XML data should be <a>null<a/>.
• If the XSD schema type or the Java Classes schema type is used when parsing JSON,
no matter whether the original data is an empty JSON array, an empty JSON object, or
an empty JSON string, the converting result is always <a/>.
• If the XSD schema type with StAXON is used when parsing an empty JSON array,
then respective element is not generated in the output XML.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
32
| Chapter 3 Supported XML and JSON Conversion
A JSON key might contain whitespaces and some special symbols , such as - %, $, #,
which are not allowed in an element key or an attribute key in XML. By default, these
special symbols are removed when parsing JSON. However, in StAXON implementation,
exception is raised when parsing these special symbols in the JSON keys.
• If the number sign (#) occurs in the middle of a JSON key when parsing JSON with
the Badgerfish conversion rule, the content behind #, including the #, is removed.
For example, the original JSON data:
{
"product":{
"name#A":"Kindle"
}
},
• If StAXON option is enabled, exception is raised when handling special symbols such
as - #, %, $ ($ with text) in the JSON keys. However, for $ (single) as the JSON
element key, it is handled as per Badgerfish conversion rule.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
| 33
This chapter explains how to use the JSON tools and Swagger tools provided with TIBCO
ActiveMatrix BusinessWorks Plug-in for REST and JSON.
Topics
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
34
| Chapter 4 Plug-in Tools
With TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON, you can
generate an XML schema file from a given JSON file by using the JSON tools. JSON
tools use normal conversion rules. See Normal Conversion Rule on page 25 for more
information about the normal conversion rules.
• If the input JSON data does not have a root, the default root element, JSON, is added in
the output XML schema.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
Using the Swagger Tools 35
|
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON supports Swagger
on both client and server sides. On the server side, you can export RESTful services to
Swagger web server. See Chapter 7, Managing RESTful Web Services, page 77 for
details. On the client side, you can use the Swagger tool to download Swagger API
description file and call your RESTful web services in TIBCO ActiveMatrix
BusinessWorks processes.
This section specifies how to download Swagger API description files to your TIBCO
ActiveMatrix BusinessWorks process.
To download a Swagger API description file, perform the following steps:
1. Start TIBCO Designer.
2. Create or open a project.
3. Click Tools > Swagger Tools > Load Swagger JSON files from the TIBCO Designer
menu.
4. Enter the Swagger doc URL in the Load Swagger API description JSON file dialog.
5. Click OK to download the Swagger API description file.
6. Select Project > Save from the TIBCO Designer menu to save the project.
When the download is completed, a Swagger JSON File folder is displayed in the Project
panel, which contains the API description file. The generated file is .txt file.
When you download Swagger API description file from the Swagger doc URL, all the
files are added in the Swagger JSON File folder, and the newly downloaded file overwrites the
existing file with the same name.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
36
| Chapter 4 Plug-in Tools
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
|
I 37
I
Chapter 5 REST and JSON Palette
This chapter describes the REST and JSON palette, which contains one shared resource
and four activities for TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and
JSON.
Topics
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
38
| Chapter 5 REST and JSON Palette
The REST and JSON palette consists of one shared resource and four activities as shown
in Figure 4.
Shared Resource
The OAuth 1.0 shared resource for TIBCO ActiveMatrix BusinessWorksTM Plug-in for
REST and JSON is used to set the related parameters for OAuth 1.0.
Activities
To perform different functionalities, REST and JSON activities can be divided into two
groups: REST activities and JSON activities.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
REST and JSON Palette Overview 39
|
REST Activities
The following activities can be used to invoke RESTful web services and to expose
TIBCO ActiveMatrix BusinessWorks processes as RESTful web services:
• Invoke REST API
• REST Dispatch and Reply
JSON Activities
The activities in this group are used to convert data between JSON format and XML
format. The included activities in this group are as follows:
• Parse JSON
• Render JSON
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
40
| Chapter 5 REST and JSON Palette
OAuth1.0
Shared Resource
The OAuth1.0 shared resource allows you to set up the related parameters for OAuth 1.0.
This shared resource is used when you want to use the OAuth 1.0 authentication with the
Invoke REST API activity.
Configuration
The Configuration tab contains the following fields as shown in Table 9. Apart from the
Name an
You can obtain the following field information from a Service Provider.
Consumer Yes The Consumer Key for authenticating the Consumer access to protected
Key resources from a web service.
Consumer Yes The Consumer Secret for authenticating the Consumer access to protected
Secret resources from a web service.
Access Yes The Access Token for authenticating the Consumer access to protected
Token resources from a web service.
Token Secret Yes The Token Secret for authenticating the Consumer access to protected
resources from a web service.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
Invoke REST API 41
|
Activity
The Invoke REST API activity calls RESTful web services and receives responses from
the service provider.
Configuration
The fields on the Configuration tab are described in Table 10.
Global
Field Var? Description
Name No The name to display as the label for the activity in the process definition.
Resource URI Yes This field specifies the root and path of a URI resource. For example,
http://api.linkedin.com/v1/people/~.
Note: This field is available only when the protocol type is None.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
42
| Chapter 5 REST and JSON Palette
Global
Field Var? Description
Method Yes The following REST methods are used for the requests:
• GET
• POST
• PUT
• DELETE
• PATCH
Note: If the protocol type is WADL or Swagger, only the methods that
correspond to the API are listed in the Method field.
Response Type Yes The response data type, which the Service Provider supports. TIBCO
ActiveMatrix BusinessWorksTM Plug-in for REST and JSON provides
the following options:
• Default: To use the default data type specified by the Service Provider
to return data
• XML: the Service Provider returns data in XML format
• JSON: the Service Provider returns data in JSON format
• Binary: the Service Provider returns data in Binary format
Rich Output No Selecting this check box enables you to customize the data structure of
the output activity in the Output Editor tab. See Output Editor on
page 54 for more information.
If the response data is in binary format, ensure that the Rich Output
check box is selected.
Trust HTTPS Host Yes Selecting this check box enables you skip to verify the host name of the
Service Provider.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
|
Invoke REST API 43
Global
Field Var? Description
Authentication No The authentication types that are supported by the Service Provider. The
following are the authentication types supported by TIBCO ActiveMatrix
BusinessWorksTM Plug-in for REST and JSON:
• No Authentication
• Basic Authentication
• OAuth 1.0
• OAuth 2.0
WADL File No The path and name of a WADL file. The Invoke REST API activity
refines the process input from the WADL file.
Note: This field only appears when you select WADL as the protocol
type.
Swagger File No The path and name of a Swagger file. The Invoke REST API activity
refines the process input from the Swagger file. You can reuse the
Swagger API description file that was downloaded using Swagger Tool.
Rename the .txt file to .json to configure Invoke REST API activity.
Note: This field only appears when you select Swagger as the protocol
type. This activity supports Swagger 1.2 and 2.0 specifications.
Base URL No The base URL to define the RESTful web service that you want to
invoke.
Selects a base URL from the list.
Method ID No The Method ID to define the API that you want to invoke.
Selects a method ID from the list.
Fields displayed when Basic Authentication is selected as the authentication type. You can
obtain the field information from a Service Provider.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
44
| Chapter 5 REST and JSON Palette
Global
Field Var? Description
OAuth 1.0 Yes The OAuth1.0 shared resource, which specifies OAuth 1.0 related
Parameters parameters.
See OAuth1.0 on page 40 for more information about the OAuth1.0
shared resource.
Fields displayed when OAuth 2.0 is selected as the authentication type. You can obtain the
field information from a Service Provider.
Access Token Yes Specifies one of the following ways to send the access token along with
Position your HTTP request:
Header Send the access token in an HTTP header.
Access Token Name Yes The name authorized by the authorization server’s token endpoint.
Access Token Value Yes The value authorized by the authorization server’s token endpoint.
Reload Button
If the WADL or Swagger file is changed, you must use the Reload button to refresh the
WADL or Swagger file to update the Configuration and Input tabs.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
|
Invoke REST API 45
You cannot alter the structure of the HTTP request message in the Input tab. If the data
structure in the WADL file or Swagger file does not match the RESTful web service, edit
the elements in the file and click Reload.
Table 11 shows the rules for mapping a WADL file to the input parameters.
Table 11 Rules for Mapping a WADL File to the Input Parameters (Sheet 1 of 3)
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
46
| Chapter 5 REST and JSON Palette
Table 11 Rules for Mapping a WADL File to the Input Parameters (Sheet 2 of 3)
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
Invoke REST API 47
|
Table 11 Rules for Mapping a WADL File to the Input Parameters (Sheet 3 of 3)
Table 12 shows the rules for mapping a Swagger file to the input parameters.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
48
| Chapter 5 REST and JSON Palette
Table 12 Rules for Mapping a Swagger File to the Input Parameters (Cont’d)
Input
Parameter Mapping Rule Example
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
|
Invoke REST API 49
Table 12 Rules for Mapping a Swagger File to the Input Parameters (Cont’d)
Input
Parameter Mapping Rule Example
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
50
| Chapter 5 REST and JSON Palette
Table 12 Rules for Mapping a Swagger File to the Input Parameters (Cont’d)
Input
Parameter Mapping Rule Example
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
Invoke REST API 51
|
You cannot alter the structure of the HTTP request message in the Input Editor tab.
However, you can alter the child items under the three main parameters: Query, Header and
body (including Form, Text, Binary, and Multipart). For example, add another param item under the
Query parameter.
Table 13 Description of the Input Parameters When WADL or Swagger Files are Unused
Form Specifies the name/value pairs that represent the body of the HTTP message.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
52
| Chapter 5 REST and JSON Palette
Table 13 Description of the Input Parameters When WADL or Swagger Files are Unused (Cont’d)
Input Editor
The Input Editor tab describes the data structure for the HTTP request message in the
Input tab. If the Protocol type is WADL or Swagger, you can alter the element structure
under the these parameters: Query, Header, and Body. See Table 13 on page 51 for more details
about each parameter.
For each element you add, you must provide a name, data type, and the parameter details
such as required, optional, or repeating.
For more information about how to use the Input Editor tab, see "Specifying Data
Schema" in TIBCO ActiveMatrix BusinessWorksTM Palette Reference.
Input
The Input tab contains the following fields as shown in Table 14.
Timeout The amount of time (in milliseconds) to wait for a response from the server. The
default value is 0.
Parameters The items displayed under the Parameters item vary depending on whether the
Enable WADL check box in the Configuration tab is selected. See Sending
Data in the HTTP request on page 44 for detailed information about the items.
The following items only appear in the Activity Input panel when the OAuth 1.0
authentication type is selected in the Configuration tab.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
Invoke REST API 53
|
ConsumerSecret The Consumer Secret provided by a web service. The Consumer Secret is set in
the specified OAuth1.0 shared resource, but you can override the value by
specifying a Consumer Secret in this field.
AccessToken The Access Token provided by a web service. The Access Token is set in the
specified OAuth1.0 shared resource, but you can override the value by
specifying an Access Token in this field.
TokenSecret The Token Secret provided by a web service. The Token Secret is set in the
specified OAuth1.0 shared resource, but you can override the value by
specifying a Token Secret in this field.
The following items only appear in the Activity Input panel when the OAuth 2.0
authentication type is selected in the Configuration tab.
OAuth2TokenName The name of the access token provided by the authorization server’s token
endpoint. The access token name is set in the Token Name field in the
Configuration tab, but you can override the value by specifying an access
token name in this field.
OAuth2TokenValue The value of the access token provided by the authorization server’s token
endpoint. The access token value is set in the Token Value field in the
Configuration tab, but you can override the value by specifying an access
token value in this field.
The following items only appear in the Activity Input panel when the Basic Authentication
type is selected in the Configuration tab.
username A valid user name for accessing a website. The user name is set in the
Username field in the Configuration tab, but you can override the value by
specifying a user name in this field.
password A valid password for accessing a website. The password is set in the Password
field in the Configuration tab, but you can override the default by specifying a
password in this field.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
54
| Chapter 5 REST and JSON Palette
Output Editor
The Output Editor tab describes the data structure in the Output tab. It allows you to add
headers and set the response data type.
For each element you add or edit, you must provide a name, data type, and whether the
parameter is required, optional, or repeating.
This tab is available only when the Rich Output check box is selected in the
Configuration tab. When the Rich Output option is enabled, the output varies depending
on the schema type defined in the Output Editor tab.
For more information about how to use the Output Editor tab, see "Specifying Data
Schema" in TIBCO ActiveMatrix BusinessWorksTM Palette Reference.
Output
The Output tab contains the following fields as shown in Table 15.
The following fields appear when you select the Rich Output check box in the Configuration tab .
Error Output
The Error Output tab lists the exceptions that can be generated by the Invoke REST API
activity. See Trace Messages on page 133 for more information about error codes.
Exception Cause
JSONRestException An exception occurs when invoking REST API during the runtime.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
|
Invoke REST API 55
Exception Cause
ActivityTimeoutException An exception occurs when the response is timed out.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
56
| Chapter 5 REST and JSON Palette
Activity
The REST Dispatch and Reply activity exposes TIBCO ActiveMatrix BusinessWorks
processes as RESTful web services. With this activity, users can map HTTP requests to
TIBCO ActiveMatrix BusinessWorks processes. Once a request is received, the REST
Dispatch and Reply activity calls the bound process and takes the output of the activities
in the called process as the reply.
You can also use the REST Dispatch and Reply activity to handle cross-origin requests.
See Support for Cross-Origin Requests on page 131 for details about the rules that the
activity uses to handle cross-origin requests.
Configuration
The Configuration tab contains the following fields as shown in Table 17.
Reply For Yes The HTTP Receiver process starter that received the requests. This is a
selection list of available HTTP Receiver activities that can receive REST
Resource requests.
Enable No Selecting this check box enables the use of existing WADL files to describe a
WADL RESTful web service for binding TIBCO ActiveMatrix BusinessWorks
Reference processes. The RESTful web service is loaded in the Service Editor tab and
the Service Editor becomes read-only.
Clearing the check box enables the use of a custom RESTful web service
created in the Service Editor tab for binding TIBCO ActiveMatrix
BusinessWorks processes. For more details, see Creating a RESTful Web
Service with Service Editor on page 79.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
REST Dispatch and Reply 57
|
Global
Field Var? Description
WADL No Specify a WADL file that you want to use. The WADL file specified here can
Reference either be a standard one or a custom one created by using the WADL palette.
For details, see Creating a RESTful Web Service with a WADL Palette on
page 80.
Note: This field is available only when the Enable WADL Reference check
box is selected.
Enable OAuth No Selecting this check box enables the use of OAuth. After enabling the OAuth,
the REST Dispatch and Reply activity validates the access token sent from
the request that calls the APIs during runtime.
OAuth Server Yes This field is only available after you select the Enable OAuth check box.
URL Specify the OAuth server URL. The plug-in connects to the OAuth server
based on the URL.
Service Editor
On the Service Editor tab you can bind HTTP requests to corresponding TIBCO
ActiveMatrix BusinessWorks processes. See Exposing BusinessWorks Processes as
RESTful Web Services for details about how to bind HTTP requests to TIBCO
ActiveMatrix BusinessWorks processes to expose TIBCO ActiveMatrix BusinessWorks
processes as RESTful web services.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
58
| Chapter 5 REST and JSON Palette
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON uses Swagger
version 2.0 to export Swagger API description files.
To export RESTful web services to a Swagger web server, click the Export Swagger
button. Then, on the Export Docs dialog box, provide information as per Table 19.
REST API Host (Required) The host where your REST APIs reside. The default is the one in the Rest
Service base URL.
Swagger Server Port (Required) The Swagger server port. The default value is 9999.
This field is available only when you select the ZIP exporting format.
Export Dir (Required) The directory where the file is exported to.
ZIP/WAR Name (Required) The name of the exported file. The default is api-docs.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
REST Dispatch and Reply 59
|
Keep Global (Optional) Select the check box to export the names of corresponding global
Variables variables you have defined.
Clear the check box to export only the values of corresponding global variables that
you have defined.
Access Token (Optional) Specify where the access token is located in an HTTP request: HTTP
Position header, HTTP query, or both.
This field is available only when you enable OAuth.
Show Advanced (Optional) Select this check box if you want to customize the Swagger web page.
After selecting the Show Advanced check box, the following fields are displayed.
API Version (Optional) The current version of the API exported to Swagger.
Title (Optional) The title of the API exported to Swagger. This title is displayed at the top
of the Swagger web page.
Description (Optional) A brief description of the API exported to Swagger. This description is
displayed next to the API tile. You can define styles in the description by inserting
HTML tags, such as, <a>.
Terms of Service (Optional) The link that direct to the terms of service.
License Name (Optional) The name of the license type used in the API.
License URL (Optional) The URL of the license used in the API.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
60
| Chapter 5 REST and JSON Palette
The RESTful web service can be either an existing service described by the referenced
WADL file or a custom one created in the Service Editor tab. See Creating a RESTful
Web Service with Service Editor on page 79 for details about creating a RESTful web
service.
If the WADL file needs modification, you can edit the WADL file separately. See Editing
a RESTful Web Service for more details.
Overview
The Overview tab displays the general binding information with pairs of the RESTful
web service and the bound TIBCO ActiveMatrix BusinessWorks process.
The RESTful web service is displayed in the following format:
method||methodID||resource
Output
The Output tab contains the following fields as shown in Table 20.
Error Output
The Error Output tab lists the exceptions that can be generated by the REST Dispatch
and Reply activity. See Trace Messages on page 133 for details about error codes.
Table 21 REST Dispatch and Reply Error Output
Exception Description
msg The response message from the REST Dispatch and Reply activity.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
|
Parse JSON 61
Parse JSON
Activity
The Parse JSON activity takes JSON data, processes it, and turns it into XML data.
Configuration
The Configuration tab contains the following fields as shown in Table 22.
Schema Type No Specifies a schema type for the output data. The supported schema types are
as follows:
• Generic
• XSD
• Java Classes
The default value in this field is the XSD schema type. See Supported
Schema Types for Formatting XML Data on page 18 for more information.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
62
| Chapter 5 REST and JSON Palette
Global
Field Var? Description
Validate Yes Selecting this check box enables validation output data against the output
Output schema. By default, the Validate Output check box is cleared.
This check box is only available when one of the following schema types is
selected:
• XSD
• Java Classes
Jar Location No The absolute path and name of a POJO class resource, which is used to define
a schema for the output data. The POJO class resource should be in JAR
format.
This field is only available when the Java Classes schema type is selected.
StAXON No This check box is available when the schema type is XSD. You can select the
check box for parsing larger JSON payloads to XML more efficiently.
Note: User can configure the
property to prefer
com.tibco.plugin.restjson.json2xml.preferNamespaceFromSchema
namespace from schema. Refer to Preferring Namespace from Schema Using
StAXON.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
Parse JSON 63
|
Input
The Input tab contains the following field as shown in Table 23.
Output Editor
The Output Editor tab allows you to define or reference an XML schema for the activity
output. You can use the JSON Tools to generate an XML schema file with a given JSON
file.
This tab is only available when the XSD schema type is selected in the Configuration tab.
See Using the JSON Tools on page 34 for more information about the JSON Tools. See
"Specifying Data Schema" in TIBCO ActiveMatrix BusinessWorksTM Palette Reference
for more information about the Output Editor.
Output
The output for the Parse JSON activity varies depending on the data schema you specified
in the Schema Type field in the Configuration tab.
Error Output
The Error Output tab lists the exceptions that can be generated by the Parse JSON
activity. See Trace Messages on page 133 for more information about error codes.
Exception Cause
JSONParseException An exception occurs when parsing JSON data.
When using a POJO JAR file to format the XML data, TIBCO ActiveMatrix
BusinessWorksTM Plug-in for REST and JSON only supports class names in lowercase in
the input JSON data.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
64
| Chapter 5 REST and JSON Palette
Render JSON
Activity
When you use the Render JSON activity to render an XML HTTP URL to a JSON string,
the forward slashes are not escaped by default. See Escaping Forward Slash on page 121
for details about how to escape a forward slash.
Configuration
The Configuration tab contains the following fields as shown in Table 25.
Global
Field Var? Description
Name No The name to display as the label for the activity in the process definition.
Schema Type No Specifies the schema type for the input data. The supported schema types are
as follows:
• Generic
• XSD
• Java Classes
See Supported Schema Types for Formatting XML Data on page 18 for more
information.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
|
Render JSON 65
Global
Field Var? Description
Remove Root Yes Specifies whether or not to remove the root element in the output JSON
string.
Validate Yes Selecting this check box enables validation input data against the input
Input schema.
This check box is only available when one of the following schema types is
selected:
• XSD
• Java Classes
Jar Location No The absolute path and name of a POJO class resource that is used to define a
schema for the input data. The POJO class resource should be in JAR format.
This field is only available when the Java Classes schema type is selected.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
66
| Chapter 5 REST and JSON Palette
Input Editor
The Input Editor tab allows you to define or reference an XML schema for the activity
input. You can use the JSON Tools to generate an XML schema file with a given JSON
file.
This tab is only available when the XSD schema type is selected in the Configuration tab.
See Using the JSON Tools on page 34 for more information about the JSON Tools. See
"Specifying Data Schema" in TIBCO ActiveMatrix BusinessWorksTM Palette Reference
for more information about the Input Editor.
Input
The input data for the Render JSON activity is in XML format; the schema type of the
XML data varies depending on the schema type you specified in the Schema Type field in
the Configuration tab.
Output
The Output tab contains the following field as shown in Table 26.
Error Output
The Error Output tab lists the possible exceptions that can be generated by the Render
JSON activity. See Trace Messages on page 133 for more information about error codes.
Exception Cause
JSONRenderException An exception occurs when rendering the data.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
| 67
This chapter explains the WADL palette, which is used to create WADL (Web Application
Description Language) files. A WADL file defines how a RESTful web service behaves
and teaches clients how to interact with the service.
Topics
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
68
| Chapter 6 WADL Palette
The WADL palette consists of one shared resource and a series of components used for
creating a WADL file as shown in Figure 5.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
|
Application 69
Application
Shared Resource
Configuration
The Configuration tab contains the following fields as shown in Table 28.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
70
| Chapter 6 WADL Palette
Component
A RESTful web service consists of various resources that contain specific information.
The REST Service component is used to define the base URL of a RESTful web service,
which is referenced by each resource added in the RESTful web service. One or more
REST services can be added to an application.
See Guidelines for Creating and Editing a RESTful Web Service on page 78 for details
about rules applied to a REST service element.
Configuration
The Configuration tab contains the following fields as shown in Table 29.
Base URL Yes (Required) The base URL of the RESTful web service.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
Resource 71
|
Resource
Component
The resource element acts as a container and is the source of specific information. Each
resource is referenced with a global identifier. The Resource component is used to define
resource-related parameters. The resource parameters are shared by all the sub resources
and methods under this resource. One or more resources can be added to a RESTful web
service.
See Guidelines for Creating and Editing a RESTful Web Service on page 78 for more
details about rules applied to a resource element.
Configuration
The Configuration tab contains the following fields as shown in Table 30.
Parameters No The parameters that are used in this resource. The parameters
specified here are inherited by the methods added to this resource.
Use and next to the Parameters table to add and remove
parameters; use and to arrange the order of parameters.
The name and style attributes must be specified each time a parameter is
added.
Query No A URI query parameter for all methods that apply to this resource.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
72
| Chapter 6 WADL Palette
Method
Component
A method element is a child node of a resource. The Method component is used to define
methods used for the HTTP request. One or more methods can be added to a resource.
See Guidelines for Creating and Editing a RESTful Web Service on page 78 for more
details about rules applied to a method element.
Configuration
The Configuration tab contains the following fields as shown in Table 31.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
Request 73
|
Request
Component
The Request component is used to define the input to a method with a collection of a
parameters and representations. Only one request can be added to a method.
See Guidelines for Creating and Editing a RESTful Web Service on page 78 for more
details about rules applied to a request element.
Configuration
The Configuration tab contains the following fields as shown in Table 32.
Representations No The representation of the HTTP request. By default, the request data
can be any data format.
Two options are available: XML and JSON.
XML The request data is in XML format when the XML radio button
is selected.
JSON The request data is in JSON format when the JSON radio
button is selected.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
74
| Chapter 6 WADL Palette
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
Response 75
|
Response
Component
The Response component is used to define the output to a method with a collection of
parameters and representations. One or more responses can be added to a method.
See Guidelines for Creating and Editing a RESTful Web Service on page 78 for more
details about rules applied to a response element.
Configuration
The Configuration tab contains the following fields.
Representations No The representation of the response. By default, the response data can be
any data format.
Two options are available: XML and JSON.
XML The response data is in XML format when the XML radio button
is selected.
JSON The response data is in JSON format when the JSON radio
button is selected.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
76
| Chapter 6 WADL Palette
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
| 77
This chapter explains how to create and edit RESTful web services, and describes rules
that apply to WADL files. This chapter also specifies how to expose TIBCO ActiveMatrix
BusinessWorks processes as RESTful web services, and how to export RESTful web
services to a WADL file or a Swagger file.
Topics
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
78
| Chapter 7 Managing RESTful Web Services
A WADL file is used to describe RESTful web services. This section describes some rules
and restrictions applied for a WADL file, which are useful when creating and editing
RESTful web services.
Adhere to the following rules when creating and editing a RESTful web service:
• RESTful web service The base URL of the RESTful web service must be unique.
• Resource A resource element must adhere to the following rules:
— The resource ID must be unique among siblings. That is, the resource ID must be
different from any other ID, even a method ID, in the WADL file.
— The resource path must be unique among siblings. That is, the resource path must
be different from any other resource path under the same RESTful web service in
the WADL file.
— The values of both the name and style attributes must be unique. The values cannot
be the same as that of another resource parameter and the request parameters of the
method under this resource.
• Method A method element must adhere to the following rules:
— The method ID must be unique among siblings. That is, the method ID must be
different from any other ID, even a resource ID, in the WADL file.
— A method element can contain only one request node.
• Request A request element must adhere to the following rules:
— The request name must be unique among siblings.
— The values of both the name and style attributes must be unique. The values cannot
be the same as that of another request parameter and the method resource
parameters.
• Response The response name must be unique among siblings.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
Creating a RESTful Web Service 79
|
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON supports binding
HTTP requests from a custom RESTful web service to TIBCO ActiveMatrix
BusinessWorks processes.
You can create a custom RESTful web service in the following ways:
• Use the Service Editor tab of the REST Dispatch and Reply activity to create a
RESTful web service. See Creating a RESTful Web Service with Service Editor for
details.
If a RESTful web service is created in this way, the binding process can be performed
directly in the Service Editor tab. See Service Editor on page 57 for details.
• Use the WADL palette to create a WADL file to describe a custom RESTful web
service. See Creating a RESTful Web Service with a WADL Palette for details.
If a RESTful web service is created in this way, to bind the HTTP requests, you must
select the Enable WADL Reference check box and select the created WADL file in
the WADL Reference field in the Configuration tab, and then perform the binding
process in the Service Editor tab. See REST Dispatch and Reply on page 56 for
details.
Ensure that the Enable WADL Reference check box is cleared in the Configuration
tab.
5. Enter the service name and the base URL for the RESTful web service in the right
panel and click Apply to save your configuration.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
80
| Chapter 7 Managing RESTful Web Services
6. Right-click the newly added service node in the left panel and select Add > Resource.
A resource node with the default name, Resource0, is added under the service node.
7. Enter a resource path and parameters to use in the right panel. See Resource on
page 71 for details about the resource parameters.
8. Right-click the newly added resource node and select Add > Method. A method node
with the default name, Method0, is added under the resource node. See Method on page 72
for details about the method element.
9. Enter a method ID and method name in the right panel.
See Service Editor on page 57 for details about how to bind this HTTP request to a
TIBCO ActiveMatrix BusinessWorks process.
The following steps: step 10 and step 11 are optional. If you want to define additional
or specific parameters for a method node, except for parameters inherited from the
parent resource node, you can add a request node to specify more parameters.
10. Right-click the method node, and then select Add > Request or Add > Response. A
request node or a response node are added under the method node.
11. Enter parameters used for the request node or response node. See Request on page 73 and
Response on page 75 for details about the request and response components.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
Creating a RESTful Web Service 81
|
7. Configure the resource in the Resource Configuration panel. See Resource on page 71
for details about the resource parameters.
8. Double-click the Resource icon in the Design panel, and then drag the Method icon
in the Palettes panel to the Design panel.
9. Configure the method in the Method Configuration panel. See Method on page 72 for
details about the method element.
10. Double-click the Method icon in the Design panel, and then drag the Request icon in
the Palettes panel to the Design panel.
11. Configure the request in the Request Configuration panel. See Request on page 73 for
details about the request component.
12. Drag the Response icon from the Palettes panel to the Design panel.
13. Configure the response in the Response Configuration panel. See Response on
page 75 for details about the response component.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
82
| Chapter 7 Managing RESTful Web Services
• Use the WADL Palette If a RESTful web service is created as described in Creating a
RESTful Web Service with a WADL Palette, you can edit the RESTful web service by
directly clicking the corresponding element in the WADL tree as shown in Figure 7.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
|
Editing a RESTful Web Service 83
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
84
| Chapter 7 Managing RESTful Web Services
After creating a RESTful web service, you can bind HTTP requests to TIBCO
ActiveMatrix BusinessWorks processes to expose TIBCO ActiveMatrix BusinessWorks
processes as RESTful web services.
2. In the right panel, click Browse resources next to the Process Name field. The
Select a Resource dialog is displayed.
3. In the Select a Resource dialog, select the process that you want to bind to and click
OK.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
Exposing BusinessWorks Processes as RESTful Web Services 85
|
After selecting the process, you can click Go to reference resource next to the
Process Name field to direct to the bound process, where you can view and change
the configurations of the bound process.
If you want to remove the bound process, click Clear reference to clear your
current selection.
4. In the right panel, click Bind. The Process Binding dialog is displayed.
5. In the Process Binding dialog, configure the input and output mappings, and then
click Bind to save your configurations. See Configuring the Input and Output Binding
for details.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
86
| Chapter 7 Managing RESTful Web Services
• 200 (OK)
• 400 (Bad Request)
• 404 ( Not Found )
• 500 (Internal Server Error)
• 401 (Unauthorized ): This respond code is available when you enable OAuth.
Additionally, the plug-in also supports customizing the 200, 400, and 500 response codes.
To customize the response codes, complete the following steps:
1. In the Output Binding panel, click the Binding tab.
2. In the Activity Input panel, expand RESTResponse > Headers.
3. Right-click StatusLine, and then select Statement > Surround with choice.
4. In the Choice dialog, specify the number of the when conditions, and whether you need
the otherwise conditions, and then click OK.
5. Enter values in the When, Otherwise and StatusLine nodes accordingly as shown in
Figure 9.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
Exposing BusinessWorks Processes as RESTful Web Services 87
|
Prerequisites
Before downloading multiple parts of messages in one request from the server side, you
need to enable the handleAllMimePartsAsAttachment property in the designer.tra file:
1. Navigate to the TIBCO_HOME\designer\version_number\bin directory.
2. Open the designer.tra file, and enter the following parameters in one line:
bw.plugin.http.handleAllMimePartsAsAttachment=true
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
88
| Chapter 7 Managing RESTful Web Services
TIBCO ActiveMatrix BusinessWorks Plug-in for REST and JSON supports exporting a
RESTful Web Services to a WADL file.
To export a RESTful Web Services to a WADL file, complete the following steps after you
define a RESTful web service in the REST Dispatch and Reply activity:
1. Click the REST Dispatch and Reply activity in the process.
2. In the Service Editor tab, click Export WADL. The Export WADL dialog is
displayed as shown in Figure 10.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
Exporting RESTful Web Service to Swagger 89
|
TIBCO ActiveMatrix BusinessWorks Plug-in for REST and JSON supports exporting the
RESTful web services to Swagger version 2.0.
To Export the RESTful web services to Swagger, complete the following steps:
1. Create a RESTful web services in the REST Dispatch and Reply activity. See Creating
a RESTful Web Service on page 79 for details about how to create a RESTful web
service.
2. Click the REST Dispatch and Reply activity in the process.
3. In the Service Editor tab, click Export Swagger. The Export Swagger dialog is
displayed as shown in Figure 11.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
90
| Chapter 7 Managing RESTful Web Services
Note: You can also update the server port by updating the winstone.properties file which is
located in the api-docs directory after you export the Swagger file.
7. In the Export Dir field, specify a directory where the file is exported to.
8. Name the exported file in the ZIP/WAR Name field.
9. If you select the ZIP format, specify the JRE Home in the JRE Home field.
10. If you want to export the names of corresponding global variables, select the Keep
Global Variables check box.
11. If you enable the OAuth function, specify where the access token is located in an
HTTP request in the Access Token Position list.
12. If you want to customize the Swagger web page, select the Show Advanced check
box and configure the corresponding fields. See Export Swagger Button on page 58
for details.
13. Click OK to save the configuration.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
|
Exporting RESTful Web Service to Swagger 91
You can change what is displayed on the page by clicking the following buttons:
• Show/Hide: Click to show or hide the APIs on the page.
• List Operations: Click to list all the operations of APIs.
• Expand Operations: Click to expand all the operations of APIs.
2. Browse the API list and expand an API. Select a response content type and parameter
content type from the two lists as shown in Figure 13.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
92
| Chapter 7 Managing RESTful Web Services
3. Enter the required parameters, and then click Try it out to test the API as shown in
Figure 14.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
Exporting RESTful Web Service to Swagger 93
|
You might fail to call the REST APIs in Swagger due to the cross-origin restrictions. See
Support for Cross-Origin Requests on page 131 for details about the rules to conduct a
cross-origin request.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
94
| Chapter 7 Managing RESTful Web Services
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
|
Usi 95
Topics
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
96
| Chapter 8 Using Sample Projects
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON examples are
packaged with the installation of the plug-in. This chapter describes how to run examples
on a Microsoft Windows platform.
The following examples are provided in the plug-in:
• The LinkedInPeopleSearch Project - Shows how to invoke the LinkedIn server and
receives response from the server.
• The JSONSample Project - Shows how to convert data between JSON and XML with
normal conversion rules and Badgerfish conversion rules.
• The InvokePartnerREST Project - Shows how to expose TIBCO ActiveMatrix
BusinessWorks processes as RESTful web services and how to invoke the RESTful
web service.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
|
The LinkedInPeopleSearch Project 97
Process Description
This project contains the REST People Search process. This process invokes the LinkedIn
server to find all the people whose name is John Bender. Figure 16 shows the REST People
Search process definition.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
98
| Chapter 8 Using Sample Projects
3. For each person listed in the converted XML data, the following activities are
processed in the Log_Each_Person group:
a. The More_Info activity invokes the LinkedIn RESTful web services with the ID of a
person whose name contains John Bender, and receives the response data in XML
format from the LinkedIn server and then passes the data to the Log Search Result
activity. The response data lists more information about the person, John Bender .
For example, the information about headline of John Bender.
b. The Log Search Result activity logs the received data in a specified file.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
The LinkedInPeopleSearch Project 99
|
5. Configure the Global variable for the generated log file of the Log Search Result
activity.
a. Click the Global Variables tab in the Project panel.
b. Click the LogFile item and then click Open Advanced Editor at the top of the
left corner in this panel. The Global Variables dialog is displayed.
c. Expand the LogFile item and then set the value of the Path parameter to a directory
and a file name, which you want to save the generated log file in. For example,
C:\temp\Linkin.txt.
You can set breakpoints in the process definition at a specified point where you want to
stop a running process and examine its state and process data, for example, you can set
breakpoints before or after an activity.
See TIBCO ActiveMatrix BusinessWorksTM Process Design Guide for detailed
information on using the test mode, including setting breakpoints and the element colors
in the test mode.
Expected Results
After the process is successfully completed, the specified log file is generated.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
100
| Chapter 8 Using Sample Projects
Processes Description
This project contains the following predefined processes:
• The JSON Badgerfish Process
• The Trading Orders Process
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
The JSONSample Project 101
|
1. The Render JSON activity takes XML data, and renders it as a JSON string. The
output data is structured with an XML schema file, Book_info.xsd, which is located in the
RESTJSON_HOME\examples\JSONSample\Badgerfish directory.
2. The Parse Back activity takes the converted JSON data and then converts it to XML
data.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
102
| Chapter 8 Using Sample Projects
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
The JSONSample Project 103
|
4. Configure the Global Variables for a JSON file, which is used to convert to XML
format.
a. Click the Global Variables tab in the Project panel.
b. Click the JSON_Plugin item and then click Open Advanced Editor at the
top of the left corner in this panel. The Global Variables dialog is displayed.
c. Expand the JSON_Plugin item and then set a value for the SampleProjectDir
parameter. The value should be as follows:
RESTJSON_HOME\examples\JSONSample\
You can set breakpoints in the process definition at a specified point where you want to
stop a running process and examine its state and process data, for example, you can set
breakpoints before or after an activity.
See TIBCO ActiveMatrix BusinessWorksTM Process Design Guide for detailed
information on using the test mode including setting breakpoints and the element colors in
the test mode.
Expected Results
If the processes perform successfully, the green color is displayed between each activity.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
104
| Chapter 8 Using Sample Projects
The Invoke_partner_rest project describes how to use the REST Dispatch and Reply activity to
expose TIBCO ActiveMatrix BusinessWorks processes as RESTful web services and how
to use the Invoke REST API activity to invoke the exposed RESTful web services.
Business Scenario
This project implements a complete workflow of asking for a loan from a bank through
the mortgage broker as shown in Figure 19.
Here, a lender wants to ask for a loan from Bank C. The lender sends his request to the local
broker. After receiving the loan request, the broker sends the loan request to Bank C that the
lender prefers and Bank C invokes the CreditCheck service to check whether the lender is
qualified for the loan.
Lender
Mortgage Broker
Bank
CreditCheck
Service
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
The InvokePartnerREST Project 105
|
Process Definition
Four process folders are included in the Invoke_partner_rest project:
• Borrow This folder contains one process, LoanRequestProcess, which is used by the
lender to initiates a loan request.
See LoanRequestProcess (in the Borrow Folder) for more details.
• MortgageBroker This folder contains a PartnerProcesses process folder and a
LoanRequestProcess process for the broker to handle the request from the lender.
— The LoanRequestProcess process is used for the broker to send the request to the
corresponding bank according to the request from the lender.
See LoanRequestProcess (in the MortgageBroker Folder) for more details.
— The PartnerProcesses folder contains the partners of the broker. That is, banks that are
available for the banker to invoke. The bank process in this folder invokes the
corresponding bank service when a request is received.
See PartnerProcess(in the MortgageBroker Folder) for more details.
• Banks This folder contains two separate RESTful services to be invoked. Each folder
contains one shared resource and three processes. See Banks for more details.
• CreditCheck This folder contains one shared resource and three processes. See
Credit Check for more details.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
106
| Chapter 8 Using Sample Projects
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
The InvokePartnerREST Project 107
|
Banks
This folder contains two folders: Bank_A and Bank_C.
Take the Bank_C folder as an example. As shown in Figure 23, one shared resource and
three processes are included in the Bank_C process folder.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
108
| Chapter 8 Using Sample Projects
• The Bank_C_Process process is exposed as a RESTful web service. When a loan request
is received, it invokes the subprocess to check the credit of the lender as shown in
Figure 24.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
|
The InvokePartnerREST Project 109
Figure 25 Bank_C_Service
shows how the HTTP request and response are mapped to the input and output of the
bound Bank_C_Process process.
Figure 26 Bank_C_Service
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
110
| Chapter 8 Using Sample Projects
Credit Check
The CreditCheck folder includes one shared resource and two processes as shown in
Figure 28.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
The InvokePartnerREST Project 111
|
Figure 30 shows how the HTTP request and response are mapped to the input and output
of the bound CreditCheck service process.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
112
| Chapter 8 Using Sample Projects
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
The InvokePartnerREST Project 113
|
6. Select Project > Save from the TIBCO Designer menu to save the project.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
114
| Chapter 8 Using Sample Projects
You can set breakpoints in the process definition at a specified point where you want to
stop a running process and examine its state and process data, for example, you can set
breakpoints before or after an activity.
See TIBCO ActiveMatrix BusinessWorksTM Process Design Guide for detailed
information on using the test mode including setting breakpoints and the element colors in
the test mode.
Expected Results
After the process is completed, the response is returned in the Output tab as shown in
Figure 32.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
| 115
This chapter explains some advanced settings for use of TIBCO ActiveMatrix
BusinessWorksTM Plug-in for REST and JSON.
Topics
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
116
| Appendix A Advanced Topics
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON supports different
implementation mechanisms when converting between JSON data and XML data based
on the XSD.
Badgerfish conversion rule has the same impact when converting between JSON data and
XML data in different implementation mechanisms.
This section uses an example to show the output of an implementation mechanism varies
with the value of com.tibco.plugin.restjson.json.111CompatibleMode property. It also specifies how to
select an implementation mechanism by configuring this property.
Example
Different implementation mechanisms affect the output when you convert data between
JSON and XML format based on the XSD.
For example, when paring JSON data to XML data based on the provided XSD schemas,
if you set the com.tibco.plugin.restjson.json.111CompatibleMode property to true, the attribute
information in JSON is converted to a common XML element. Figure 33 shows an
example of input data, and Figure 34 shows an example of output data.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
Implementation Mechanism Exchange for Parsing and Rendering 117
|
In the selected XSD file, "age" is defined as an attribute. When you set the property to false,
the JSON pairs "age": "30" are converted to XML attributes and namespaces are added
according to selected XSD file as shown in Figure 35.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
118
| Appendix A Advanced Topics
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
JSON Render Related Properties 119
|
When rendering XML data to JSON data, you can implement the following functions by
configuring the JSON Render related properties:
• Checking Empty Elements for JSON Render
• Ignoring Namespace
• Escaping Forward Slash
• Formatting the Output String
If such elements have a namespace defined, after conversion, the namespace with emp
followed after the prefix xmlns is added to the JSON objects.
Example
For example, the input data is shown as follows:
<home>
<address>
<address2>homeAddress</address2>
<city>cityName</city>
<state>StateName</state>
</address>
</home>
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
120
| Appendix A Advanced Topics
After you set the property value to true, the empty XML elements that are not defined in
XML but defined in XSD are rendered into empty JSON array or empty JSON objects
when the XSD schema type is used. The output is displayed as follows:
{
"home":{
"address":{
"address1":[
],
"address2":"homeAddress",
"city":"cityName",
"state":"StateName"
}
}
}
If you set the property value to false or do not add the property, the output is displayed as
follows:
{
"home":{
"address":{
"address2":"homeAddress",
"city":"cityName",
"state":"StateName"
}
}
Ignoring Namespace
You can configure the com.tibco.plugin.restjson.xml2json.namespaceIgnored property to ignore the
namespace and prefix information when converting XML to JSON. The default value is
false, indicating that the namespace information is considered when rendering JSON files.
The value true indicates that the namespace information is ignored.
This property is applicable for the Generic and XSD schema types.
To ignore the namespace information:
1. Navigate to the TIBCO_HOME\designer\version_number\bin directory.
2. Open the designer.tra file.
3. Add the com.tibco.plugin.restjson.xml2json.namespaceIgnored property in the file and set its value
to true.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
JSON Render Related Properties 121
|
Example
For example, the input data is shown as follows:
<root_ns xmlns = "http://NamespaceTest.com/Parent">
<person_id>001a</person_id>
</root_ns>
After you set the property value to true, the namespace is ignored. The output data is
displayed as follows:
{
"root_ns":{
"person_id":{
"$":"001a"
}
}
}
If you do not add this property, or set this property value to false, the output is displayed as
follows:
{
"root_ns":{
"@xmlns":"http://NamespaceTest.com/Parent",
"person_id":{
"$":"001a"
}
}
}
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
122
| Appendix A Advanced Topics
Example
For example, the input data is shown as follows:
<Phone>
<telephone xmlns = "http://NamespaceTest.com/test">8161000</telephone>
</Phone>
After you set the property value to true, the forward slash is escaped. The output data is
displayed as follows:
{
"Phone":{
"telephone":{
"@xmlns":"https:\/\/round-lake.dustinice.workers.dev:443\/http\/NamespaceTest.com\/test",
"$":"8161000"
}
}
}
If you do not add this property, or set this property value to false, the output is displayed as
follows:
{
"Phone":{
"telephone":{
"@xmlns":"http://NamespaceTest.com/test",
"$":"8161000"
}
}
}
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
|
JSON Render Related Properties 123
Example
For example, the input data is shown as follows:
<root_attr attr_default="newDefault" attr_fixed="attr_fixed_value">
<people_info>
<people_address attr_optional="attr_required_optional" attr_required="attr_required_value">
<street>XD</street>
<city>BJ</city>
<state>BJ</state>
<country>China</country>
</people_address>
<children_number>35</children_number>
</people_info>
<product prodid="12">tv</product>
<shoesize color="black">39</shoesize>
</root_attr>
If you set the property value to true or do not add this property, the output data is displayed
as follows:
{
"root_attr": {
"@attr_default": "newDefault",
"@attr_fixed": "attr_fixed_value",
"people_info": {
"people_address": {
"@attr_optional": "attr_required_optional",
"@attr_required": "attr_required_value",
"street": {
"$": "XD"
},
"city": {
"$": "BJ"
},
"state": {
"$": "BJ"
},
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
124
| Appendix A Advanced Topics
"country": {
"$": "China"
}
},
"children_number": {
"$": 35
}
},
"product": {
"@prodid": 12,
"$": "tv"
},
"shoesize": {
"@color": "black",
"$": 39
}
}
}
If you set this property value to false, the output is displayed as follows:
{"root_attr":{"@attr_default":"newDefault","@attr_fixed":"attr_fixed_value","people_info":{"people_address":
{"@attr_optional":"attr_required_optional","@attr_required":"attr_required_value","street":{"$":"XD"},"city":{"$":"B
J"},"state":{"$":"BJ"},"country":
{"$":"China"}},"children_number":{"$":35}},"product":{"@prodid":12,"$":"tv"},"shoesize":{"@color":"black","$":39
}}}
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
JSON Parse Related Properties 125
|
When parsing JSON data to XML data, you can implement the following functions by
configuring the JSON Parse related properties:
• Adding JSON root
• Converting the Special Characters to ASCII Code
• Preferring Namespace from Schema Using StAXON
Example
For example, the input data is shown as follows:
{"product":"REST","name":"json"}
When you set the root name, for example, JsonRootName, the output data is displayed as
follows:
<JsonRootName>
<product>REST</product>
<name>json</name>
</JsonRootName>
If you do not add this property, or do not assign a value to this property, JSON is used as the
default root name.
<JSON>
<product>REST</product>
<name>json</name>
</JSON>
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
126
| Appendix A Advanced Topics
Example
For example, the input data is shown as follows:
{"Product":{"Nam$e":"REST"}}
If you do not add this property or set the value to true, the output data is displayed as
follows:
<Product>
<Name>REST</Name>
</Product>
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
JSON Parse Related Properties 127
|
Example
For example, the input data is shown as follows:
{"user_cred": {"user_name": "ab12345", "user_password": "45678"}}
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
128
| Appendix A Advanced Topics
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON employs a thread
pool to execute all the sending HTTP request operations, which is very efficient with a
high degree of concurrency.
The number of threads in the pool determines the number of operations that can
simultaneously be executed. The larger the thread-count, the more computer resources
have to be used to maintain and switch contexts between threads.
The default value for the thread pool is 10. To set up a larger value for the thread pool, do
the following:
1. Navigate to the TIBCO_HOME\designer\version_number\bin directory and locate the
designer.tra file.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
|
Setting Up a Proxy 129
Setting Up a Proxy
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON supports invoking
REST APIs by using proxy.
To specify a proxy for use, complete the following steps:
1. Navigate to the TIBCO_HOME\designer\version_number\bin directory and locate the
designer.tra file.
Parameter Description
com.tibco.plugin.restjson.proxyHost The IP address of the machine that you want to use
as the proxy.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
130
| Appendix A Advanced Topics
TIBCO ActiveMatrix BusinessWorks Plug-in for REST and JSON supports invoking a
Service Provider with SSL configurations.
The Invoke REST API activity uses the Java key store for SSL. Java key store ships
certificates signed by a well-known certification authority (CA), such as, VeriSign. Hence,
no configuration is needed for the Invoke REST API activity if the Service Provider uses
the certificates from CA.
If the Service Provider does not use well-known CA certificates or requires a specific
certificate, perform the following steps:
• Import the intermediate and root certificates to the
TIBCO_HOME\tibcojre\version_number\lib\security\cacerts directory.
• If the REST application requires a specific authentication other than the typical OAuth
authentication, you must request a client certificate from the same CA as that for your
REST application and then import the certificate to the
TIBCO_HOME\tibcojre\version_number\lib\security\cacerts directory.
• You can create a folder in the location where you store the trusted certificates, and
then create a BW_GLOBAL_TRUSTED_CA_STORE global variable in your TIBCO
ActiveMatrix BusinessWorks project to point to this folder.
The value you set for BW_GLOBAL_TRUSTED_CA_STORE must be a file URL,
for example, file:///c:/tibco/certs. See the information about trusted certificates in TIBCO
ActiveMatrix BusinessWorksTM Process Design for details about how to store
certificates to your project.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
Support for Cross-Origin Requests 131
|
When you set up a REST server where the REST Dispatch and Reply activity is located,
and set up another web application server containing all the web components, such as
HTML, CSS, and JavaScript, a cross-origin request is initiated when you use a browser
visiting the web application server to call RESTful web services exposed by the REST
server.
This section specifies several rules that apply to the REST Dispatch and Reply activity
when handling cross-origin requests.
Ordinary Requests
The REST Dispatch and Reply activity handles cross-origin requests according to the
following rules:
• The Value of the origin parameter in the request header maps to the value of the
Access-Control-Allow-Origin parameter in the response header.
• The value of the Access-Control-Allow-Methods parameter is set to OPTIONS, GET, PUT, POST,
DELETE, and *.
You can add more headers if needed. Additionally, you can override the default values of
these two headers by adding headers with the same name.
Preflight Requests
The REST Dispatch and Reply activity handles OPTIONS requests according to the
following rules:
• The value of the origin parameter in the request header maps to the value of the
Access-Control-Allow-Origin parameter in the response header.
• The value of the access-control-request-method parameter in the request header maps to the
value of the Access-Control-Allow-Methods parameter in the response header.
• The value of the access-control-request-headers parameter in the request header maps to the
value of the Access-Control-Allow-Headers parameter in the response header.
• By default, the value of the Access-Control-Max-Age parameter in the response header is set
to 20 days. You can add the same response headers to overwrite default values.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
132
| Appendix A Advanced Topics
The REST Dispatch and Reply activity fails to handle cross-origin requests when using
the TIBCO Runtime Agent version 5.7.x or earlier. To handle cross-origin requests
TIBCO Runtime Agent 5.8.0 or later is installed.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
| 133
Topics
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
134
| Appendix B Trace Messages
Trace messages provide information about plug-in activities. The messages are logged to a
log file and the console where the runtime plug-in is started.
Warn An abnormal condition is found. Processing will continue, but special attention from an
administrator is recommended.
Error An unrecoverable error occurs. Depending on the error severity, the adapter may continue with the
next operation or may stop altogether.
Debug A developer-defined tracing message. In normal operating conditions, debug messages should not
display.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
Setting Custom Engine Properties for Trace Message Roles 135
|
The following sections describe how to set properties of trace message roles in testing
environment and in deployed projects:
• Custom Properties in Testing Environment
• Custom Properties in Deployed Projects
Each property represents a trace message role as shown in Table 36. The default value for
the trace message roles are shown in the Default Value column. If the property file is not
defined, the default value will be used for the message roles.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
136
| Appendix B Trace Messages
— To disable a trace message role, set the value of the corresponding property to false.
For example, the following line sets the Trace.Error.* property to false:
Trace.Error.*=false
where,
file_directory is the location of the property file name, for example, c:/tibco.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
|
Setting Custom Engine Properties for Trace Message Roles 137
<property>
<name>name to display in TIBCO Administrator</name>
<option>name of property</option>
<default>default value</default>
<description>short description of property</description>
</property>
Perform the following steps to set properties for trace message roles in deployed projects:
1. Open the bwengine.xml file.
2. Add properties in the file to configure the trace message roles. For example, the
following lines set the com.tibco.plugin.restjson.debug property to true:
<property>
<name>RESTJSON Plug-in Debug Role</name>
<option>com.tibco.plugin.restjson.debug</option>
<default>true</default>
<description>Indicates RESTJSON debug message property.</description>
</property>
After defining the property in the bwengine.xml file, it is available in Enterprise Archive
Files that are created by TIBCO Designer, and it is displayed in the Advanced tab of
the deployment configuration in TIBCO Administrator.
3. Save EAR files in TIBCO Designer and load them into any deployment
configurations created in TIBCO Administrator.
You can alter the value of a property in the Advanced tab of the deployment
configuration and that value will be used in the deployed project. For more
information about creating and managing deployment configurations, see "Creating
and Deploying Applications" in TIBCO ActiveMatrix BusinessworksTM
Administration.
For more information about setting properties in deployed projects, see "Setting Custom
Engine Properties in Deployed Projects" in TIBCO ActiveMatrix BusinessworksTM
Administration.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
138
| Appendix B Trace Messages
Error Codes
Category: BW_Plug-in
Category: BW_Plug-in
Resolution: Check whether the XML data matches the schema file.
Category: BW_Plug-in
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
|
Error Codes 139
Category: BW_Plug-in
BW-RESTJSON-100021: JSON Schema Tool- Start to generate XML schema from JSON file,
the JSON file is [%1].
Role: infoRole
Category: BW_Plug-in
BW-RESTJSON-100022: JSON Schema Tool- Schema file generated successfully under [%1]
folder.
Role: infoRole
Category: BW_Plug-in
BW-RESTJSON-100023: JSON Schema Tool- Failed to generate schema file due to [%1].
Role: infoRole
Category: BW_Plug-in
Description: Indicates the reason why the schema file has not been generated.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
140
| Appendix B Trace Messages
Category: BW_Plug-in
Category: BW_Plug-in
Description: Indicates the conversion from JSON to XML has been started.
Category: BW_Plug-in
Category: BW_Plug-in
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
|
Error Codes 141
Category: BW_Plug-in
Category: BW_Plug-in
Category: BW_Plug-in
Category: BW_Plug-in
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
142
| Appendix B Trace Messages
Category: BW_Plug-in
Category: BW_Plug-in
Category: BW_Plug-in
Category: BW_Plug-in
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
|
Error Codes 143
Category: BW_Plug-in
Category: BW_Plug-in
Category: BW_Plug-in
Category: BW_Plug-in
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
144
| Appendix B Trace Messages
Category: BW_Plug-in
BW-RESTJSON-200003: Basic configuration, the request method is: %1, authentication style
is: [ %2 ].
Role: debugRole
Category: BW_Plug-in
Description: Indicates the basic configuration information about the Invoke REST API
activity.
Resolution: No action required.
Category: BW_Plug-in
Category: BW_Plug-in
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
|
Error Codes 145
Category: BW_Plug-in
Description: Indicates the request was sent with body content. The %1 is one of the four
REST methods: GET, POST, PUT, and DELETE.
Resolution: No action required.
Category: BW_Plug-in
Category: BW_Plug-in
Category: BW_Plug-in
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
146
| Appendix B Trace Messages
Category: BW_Plug-in
BW-RESTJSON-2000013: Trust HTTPS host enabled, the program will not validate the host.
Role: debugRole
Category: BW_Plug-in
Description: Indicates the Trust HTTPS Host option is selected and the host will not be
validated.
Resolution: No action required.
Category: BW_Plug-in
Description: Indicates the specified timeout value for the HTTP response.
Category: BW_Plug-in
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
|
Error Codes 147
BW-RESTJSON-2000020: Both the Resource URI and Method are required, make sure they are
not empty.
Role: errorRole
Category: BW_Plug-in
Description: An error occurs when running the Invoke REST API activity.
Resolution: Ensure that the specified Resource URI, and Method fields in the
Configuration tab are not empty.
BW-RESTJSON-2000021: Fail to encode the URI, the operating system doesn't support UTF-8.
Role: errorRole
Category: BW_Plug-in
Description: An error occurs when running the Invoke REST API activity with the
UTF-8 encoding character in the URI field.
Resolution: Change the encoding character in the URI field.
Category: BW_Plug-in
Description: An error occurs when running the Invoke REST API activity.
Resolution: Ensure that all the values are provided to the required Authentication
parameters.
BW-RESTJSON-2000023: Try to add OAuth2 parameters to a position other than 'Query' and
'Header'.
Role: errorRole
Category: BW_Plug-in
Description: An error occurs when setting the OAuth2 parameters to the incorrect input
items.
Resolution: Ensure the OAuth2 parameters are set to the Query and Header items in the
Input tab.
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
148
| Appendix B Trace Messages
Category: BW_Plug-in
Description: An error occurs when using the unsupported items in the body of the HTTP
request message.
Resolution: Ensure that only the Form, Text, and Binary items are defined in the body of
the HTTP request message.
Category: BW_Plug-in
Category: BW_Plug-in
BW-RESTJSON-3000002: =Error!=============> %1
Role: errorRole
Category: BW_Plug-in
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
|
Error Codes 149
BW-RESTJSON-400000: =Export Swagger. Start to export Swagger, the Swagger file is [%1].
Role: infoRole
Category: BW_Plug-in
Category: BW_Plug-in
Category: BW_Plug-in
BW-RESTJSON-400003: =Export Swagger. There are [%1] resources in the application, and
resource number [%2] is just exported to Swagger.
Role: infoRole
Category: BW_Plug-in
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
150
| Appendix B Trace Messages
BW-RESTJSON-500000: =Export WADL. Start to export WADL, the WADL file is [%1].
Role: infoRole
Category: BW_Plug-in
Category: BW_Plug-in
Category: BW_Plug-in
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON User’s Guide
Symbols
@ 21, 32
# 32
$ 22, 32
$$ 23
A
access token 40
access token name 44
access token position 44
header 44
query 44
access token value 44
activitytimeoutexception 55
at sign 21
authentication 43
authentication types 43
basic authentication 2
no authentication 43
OAuth 1.0 2, 43
OAuth 2.0 43
B
basic authentication 2, 43
password 43, 53
username 43, 53
C
CA certificates 130
consume key 40
consume secret 40
customer support xv
D
double dollar sign 23
E
Enterprise Archive 14
H
HTTP requests 56, 57
HTTPS 42
J
Jar location 62, 65
JSON activities
Parse JSON 61
Render JSON 64
JSON tools 34, 63, 66
JSONparseexception 63
JSONrenderexception 66
JSONrestexception 54
jsonstring 66
M
msg 54, 60
N
no authentication 43
O
OAuth 43
OAuth 1.0 2, 38, 43
OAuth 1.0 Parameters 44
OAuth 2.0 2, 43
access token name 44
access token position 44
access token value 44
OAuth1.0 10
OAuth2tokenname 53
OAuth2tokenvalue 53
P
password 43, 53
POJO 18, 62
process binding 85
process definition 12
prologs 21
proxy parameters 129
R
remove root 65
reply 56
resource URI 41
response type 42
REST activities
Invoke REST API 41
REST Dispatch and Reply 56
REST and JSON palette 10, 12, 38, 79
REST dispatch and reply
configuration tab 56
error output tab 60
overview tab 60
service editor
process binding 85
service editor tab 57
REST Dispatch and Reply activity 56
REST methods 42
RESTful web service 77, 79
RESTJSON_HOME xiii
root class 62, 65
S
schema type 61, 64
service editor
bind HTTP requests 84
input binding 85
output binding 85
setting up a proxy 129
proxy parameters 129
shared resource
OAuth1.0 38
signature methods 40
single dollar sign 22
SSL configuration 130
support, contacting xv
T
technical support xv
thread pool 128
TIBCO ActiveMatrix BusinessWorks 6
TIBCO Administrator 14
TIBCO Designer 7
TIBCO support
TIBCOmmunity xv
TIBCO_HOME xiii
token secret 40
U
URI 52
username 43, 53
V
validate output 62
validationexception 63
W
WADL 57
WADL file 43, 67, 78
application 69
method 72, 78
request 73, 78
resource 71, 78
response 75, 78
RESTful web service 70, 78
WADL palette 68