![]() |
Copyright © TIBCO Software Inc. All Rights Reserved |
The JSONSample project shows how to use TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON to convert data between JSON and XML using normal conversion rules and Badgerfish conversion rules. In this project, the Trading Order business object is used.The JSON Badgerfish process converts data between JSON and XML with Badgerfish conversion rules. In this process, the Generic and XSD schema types are used to construct the output data. Figure 17 shows the JSON Badgerfish process.Figure 17 The JSON Badgerfish Process
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.
1. The Read JSON activity reads a file, Book_info.json, and passes the file content to the Parse Generic activity.
2. The Parse Generic activity takes the JSON string from the Book_info.json file and then converts it to an XML string.The Trading Orders process converts data between JSON and XML with normal conversion rules on a trading orders business object. In this process, the XSD schema type is used to format the XML data. Figure 18 shows the Trading Orders process definition.Figure 18 The Trading Orders Process
1. The Read Order JSON activity reads a JSON data file, BW_new_order.json, and passes the file content to the Parse JSON activity.The BW_new_order.json file is located in the RESTJSON_HOME\examples\JSONSample\SampleData directory.The output data is structured in an XML schema file, BW_new_order.xsd, which is located in the RESTJSON_HOME\examples\JSONSample\JSON_GEN_Schemas directory.
1. The Read Order XML activity reads the BW_new_order.xml data file, and passes the file content to the Parse XML activity.
2. The Parse XML activity takes the XML data from the Read Order XML activity and then converts it to an XML schema tree based on an XML schema file, BW_new_order.xsd, which is located in the RESTJSON_HOME\examples\JSONSample\JSON_GEN_Schemas directory.
2. Click Open Existing Project in the TIBCO Designer startup panel. The Open Project dialog is displayed.
3. Click Browse next to the Project Directory field and then select the JSONSample folder, which is located in the RESTJSON_HOME\examples\JSONSample directory. Click OK. The project is displayed.
a. Click the Global Variables tab in the Project panel.
b. Click the JSON_Plugin item and then click Open Advanced Editorat 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\
d. Click OK to save your setting.
5. Select Project > Save from the TIBCO Designer menu to save the project.
1. In the Project panel, click the Tester tab and then click Start testing viewed processat the top left corner in this panel. The Select Processes To Load dialog is displayed.
2. Select the Trading Orders check box, or expand Badgerfish and select the JSON Badgerfish check box. Click Load Selected. The process is started.
3.
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.
![]() |
Copyright © TIBCO Software Inc. All Rights Reserved |