Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved


Chapter 8 Using Sample Projects : The LinkedInPeopleSearch Project

The LinkedInPeopleSearch Project
The LinkedInPeopleSearch project describes how to use TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON to invoke the LinkedIn server and receive responses from the Service Provider.
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.
Figure 16 The REST People Search Process
The process performs the following operations:
1.
The Find_People_ID activity invokes the LinkedIn server with a given WADL file to find all the people whose name contains John Bender and then receives response data in JSON format from the LinkedIn server. The response data lists the name and ID of each person whose name contains John Bender.
The given WADL file, linkedin-wadl.xml, is located in the RESTJSON_HOME\examples\LinkedInPeopleSearch\apigee-wadl-library\linkedin directory.
2.
The Parse JSON activity converts JSON data to XML data with an XML schema file and passes the XML data to the Log_Each_Person group.
The XML schema file, schema.xsd, is located in the RESTJSON_HOME\examples\LinkedInPeopleSearch\JSONSchema directory.
3.
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.
Setting Up the Project
Before running the project, you need to perform the following steps to set up the project in TIBCO Designer:
1.
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 LinkedInPeopleSearch folder, which is located in the RESTJSON_HOME\examples\LinkedInPeopleSearch directory. Click OK. The project is displayed.
4.
a.
Click the Global Variables tab in the Project panel.
b.
Click the LinkedIn_OAuth item and then click Open Advanced Editor at the top of the left corner in this panel. The Global Variables dialog is displayed.
c.
Set values for the Access_Token, Consumer_Key, Consumer_Secret, and Token_Secret parameters under the LinkedIn_OAuth item. These values are provided by the Service Provider. In this example, you should register your application with LinkedIn to receive an API key. For more information, see https://developer.linkedin.com/documents/quick-start-guide.
d.
Click OK to save your setting.
5.
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.
d.
Click OK to save your setting.
6.
Select Project > Save from the TIBCO Designer menu to save the project.
Running the Project
After setting up the project, complete the following steps to trigger the REST People Search process:
1.
In the Project panel, click the Tester tab and then click Start testing viewed process at the upper left corner in this panel. The Select Processes To Load dialog is displayed.
2.
Select the REST People Search (current) check box and then click Load Selected. The process is started.
When the process executes, the elements of the process change colors depending upon what is occurring in the executing process instance. If all the transition lines change to green, it means the process runs successfully.
3.
Click Stop testing to return to the Design mode.
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.

Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved