TIBCO ActiveMatrix BusinessWorks

electricianpathInternet και Εφαρμογές Web

13 Δεκ 2013 (πριν από 3 χρόνια και 9 μήνες)

166 εμφανίσεις

TIBCO ActiveMatrix BusinessWorks
Plug-in for Facebook
User's Guide
Software Release 1.0
May 2012
Contents
Important Information............................................................................................5
Preface.....................................................................................................................7
Related Documentation............................................................................................................8
Connecting with TIBCO Resources........................................................................................10
Chapter 1 Introduction....................................................................11
Plug-In Overview....................................................................................................................12
Activity Overview....................................................................................................................13
Chapter 2 Authentication and Authorization Example.................15
Introduction to Facebook Authentication................................................................................16
Preparing Your Example App..................................................................................................17
Generating Extended Authentication Tokens..........................................................................18
Chapter 3 Facebook Palette............................................................19
Graph Query Activity..............................................................................................................20
Graph Query Configuration Tab...................................................................................20
Graph Query Input Tab................................................................................................20
Graph Query Output Tab.............................................................................................21
Graph Query Error Output Tab....................................................................................21
Graph Query Example Scenario.................................................................................22
Graph Query Troubleshooting......................................................................................23
Search Activity........................................................................................................................24
Search Configuration Tab............................................................................................24
Search Input Tab..........................................................................................................24
Search Output Tab.......................................................................................................25
Search Error Output Tab..............................................................................................25
Search Example Scenario...........................................................................................25
FQL Query Activity.................................................................................................................27
FQL Query Configuration Tab......................................................................................27
FQL Query Input Tab...................................................................................................28
FQL Query Output Tab................................................................................................28
FQL Query Error Output Tab.......................................................................................28
FQL Query Example Scenario....................................................................................29
Publish Activity.......................................................................................................................30
Publish Configuration Tab............................................................................................30
Publish Input Tab.........................................................................................................31
Publish Output Tab......................................................................................................31
TIBCO ActiveMatrix BusinessWorks Plug-in for Facebook
TOC | 3
Publish Error Output Tab.............................................................................................31
Publish Example Scenario...........................................................................................32
Delete Activity.........................................................................................................................34
Delete Configuration Tab.............................................................................................34
Delete Input Tab...........................................................................................................35
Delete Output Tab........................................................................................................35
Delete Error Output Tab...............................................................................................35
Delete Activity Troubleshooting....................................................................................36
RealTimeListener Activity.......................................................................................................37
RealTimeListener Configuration Tab...........................................................................37
RealTimeListener Output Tab......................................................................................38
RealTimeListener Error Output Tab.............................................................................38
RealTimeListener Example Scenario..........................................................................39
Chapter 4 Troubleshooting and Errors..........................................41
Troubleshooting Overview......................................................................................................42
Troubleshooting Activity Errors...............................................................................................43
Facebook Plug-in Exceptions.................................................................................................44
Chapter 5 Process Example............................................................45
Example Overview.................................................................................................................46
Creating the Parsing Page Feeds Process.............................................................................47
Creating the Product Direction Process.................................................................................49
TIBCO ActiveMatrix BusinessWorks Plug-in for Facebook
4 | TOC
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 BYANY OTHER TIBCO SOFTWARE OR
FOR ANY OTHER PURPOSE.
USE OF TIBCO SOFTWARE AND THIS DOCUMENT IS SUBJECT TO THE TERMS AND CONDITIONS
OF A LICENSE AGREEMENT FOUND IN EITHER A SEPARATELY EXECUTED SOFTWARE LICENSE
AGREEMENT, OR, IF THERE IS NO SUCH SEPARATE AGREEMENT, THE CLICKWRAP END USER
LICENSE AGREEMENT WHICH IS DISPLAYED DURING DOWNLOAD OR INSTALLATION OF THE
SOFTWARE (AND WHICH IS DUPLICATED IN THE LICENSE FILE) OR IF THERE IS NO SUCH SOFTWARE
LICENSE AGREEMENT OR CLICKWRAP END USER LICENSE AGREEMENT, THE LICENSE(S) LOCATED
IN THE “LICENSE” FILE(S) OF THE SOFTWARE. USE OF THIS DOCUMENT IS SUBJECT TO THOSE
TERMS AND CONDITIONS, AND YOUR USE HEREOF SHALL CONSTITUTE ACCEPTANCE OF AND
AN AGREEMENT TO BE BOUND BY THE SAME.
This document 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, The Power of Now, TIBCO ActiveMatrix BusinessWorks, TIBCO Rendezvous, TIBCO Administrator,
and TIBCO Enterprise Message Service are either registered trademarks or trademarks of TIBCO Software
Inc. in the United States and/or other countries.
EJB, Java EE, J2EE, and all Java-based trademarks and logos are trademarks or registered trademarks of Sun
Microsystems, Inc. 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 PERIODICALLYADDED 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 (c) 2012 TIBCO Software Inc. ALL RIGHTS RESERVED.
TIBCO Software Inc. Confidential Information
TIBCO ActiveMatrix BusinessWorks Plug-in for Facebook
Preface
The TIBCO ActiveMatrix BusinessWorks™ integration platform enables companies to rapidly integrate
systems and automate business processes. The TIBCO BusinessWorks Plug-in for Facebook allows ActiveMatrix
BusinessWorks customers to navigate, query, and interact with the Facebook social graph without any coding
by using the activities in the Facebook palette.
Related Topics
Related Documentation on page 8
Connecting with TIBCO Resources on page 10
TIBCO ActiveMatrix BusinessWorks Plug-in for Facebook
Related Documentation
This section lists documentation resources you may find useful.
TIBCO ActiveMatrix BusinessWorks Plug-in for Facebook Documentation
The following documents form the TIBCO ActiveMatrix BusinessWorks Plug-in for Facebook documentation
set.
• TIBCO ActiveMatrix BusinessWorks Plug-in for Facebook Installation. Read this manual for instructions on
site preparation and installation.
• TIBCO ActiveMatrix BusinessWorks Plug-in for Facebook User's Guide. Read this manual for information on
how to use the product.
• TIBCO ActiveMatrix BusinessWorks Plug-in for Facebook Release Notes. Read the release notes for a list features.
This document also contains lists of known issues and closed issues for this release.
TIBCO ActiveMatrix BusinessWorks Documentation
TIBCO ActiveMatrix BusinessWorks is a prerequisite for the TIBCO ActiveMatrix BusinessWorks Plug-in
for Facebook. The TIBCO ActiveMatrix BusinessWork documentation set includes the following documents.
• TIBCO ActiveMatrix BusinessWorks Concepts. Read this manual before reading any other manual in the
documentation set. This manual describes terminology and concepts of TIBCO ActiveMatrix BusinessWorks,
and the other manuals in the documentation set assume you are familiar with the information in this
manual.
• TIBCO ActiveMatrix BusinessWorks Getting Started. Steps you through a very simple example of designing,
deploying, and monitoring a ActiveMatrix BusinessWorks process.
• ActiveMatrix BusinessWorks Process Design Guide. Describes how to create, edit, and test business processes
using TIBCO ActiveMatrix BusinessWorks.
• ActiveMatrix BusinessWorks Palette Reference Describes each of the palettes available in TIBCO ActiveMatrix
BusinessWorks.
• TIBCO ActiveMatrix BusinessWorks Administration. Describes how to use TIBCO Administrator to deploy,
manage, and monitor TIBCO ActiveMatrix BusinessWorks processes.
• TIBCO ActiveMatrix BusinessWorks Installation. Read this manual for information on installing one or more
components of ActiveMatrix BusinessWorks and setting up a ActiveMatrix BusinessWorks domain.
• TIBCO ActiveMatrix BusinessWorks Error Codes. Describes errors returned by TIBCO ActiveMatrix
BusinessWorks.
• TIBCO ActiveMatrix BusinessWorks Release Notes. Read the release notes for a list of new and changed
features. This document also contains lists of known issues and closed issues for this release.
Other TIBCO Products
The following products are tightly integrated with TIBCO ActiveMatrix BusinessWorks and with the Plug-in
for Facebook.
• TIBCO Designer™ software. An easy to use graphical user interface for design-time configuration of
TIBCO applications. TIBCO Designer includes online help for each palette.
• TIBCO Administrator™ software. TIBCO Administrator is the monitoring and managing interface for
new-generation TIBCO products such as TIBCO ActiveMatrix BusinessWorks.
• TIBCO Adapter software
TIBCO ActiveMatrix BusinessWorks Plug-in for Facebook
8 | Preface
Third-Party Documentation
Facebook developer documentation discusses the Facebook social graph in detail, describes the authentication
and authorization process, and explains how Facebook permissions work. For up-to-date information on
those topics and other topics relevant to using the plugin, go to the Facebook Developer Documentation.
Related Topics
Preface on page 7
TIBCO ActiveMatrix BusinessWorks Plug-in for Facebook
Preface | 9
Connecting with TIBCO Resources
How to Join TIBCOmmunity
TiBCOmmunity is an online destination for TIBCO customers, partners, and resident experts. It is a place to
share and access the collective experience of the TIBCO community. TIBCOmmunity offers forums, blogs,
and access to a variety of resources. To register, go to http://www.tibcommunity.com.
How to Access TIBCO Documentation
After you join TIBCOmmunity, you can access the documentation here: http://docs.tibco.com.
How to Contact TIBCO Support
For comments or problems with this manual or the software it addresses, contact TIBCO Support as follows:
• For an overview of TIBCO Support, and information about getting started with TIBCO Support, visit this
site:
http://www.tibco.com/services/support
• If you already have a valid maintenance or support contract, visit this site:
https://support.tibco.com
Entry to this site requires a username and password. If you do not have a username, you can request one.
Related Topics
Preface on page 7
TIBCO ActiveMatrix BusinessWorks Plug-in for Facebook
10 | Preface
Chapter
1
Introduction
Before you start using the activities in the TIBCO ActiveMatrix BusinessWorks Plug-in for Facebook palette, you
need an overview of the plug-in and of the different activities.
Topics
• Plug-In Overview
• Activity Overview
TIBCO ActiveMatrix BusinessWorks Plug-in for Facebook
Plug-In Overview
TIBCO ActiveMatrix BusinessWorks is a scalable, extensible, and easy to use integration platform that allows
you to develop integration projects. TIBCO ActiveMatrix BusinessWorks uses the TIBCO Designer graphical
user interface (GUI) for defining business processes and the TIBCO ActiveMatrix BusinessWorks process
engine executes the business processes. For a detailed discussion, see TIBCO ActiveMatrix BusinessWorks
Concepts.
ActiveMatrix BusinessWorks supports plug-ins. When you install a plug-in, activities for the plug-in become
available in the TIBCO Designer interface. You can add the plug-in activities to the business process you are
designing, and integrate them with the process flow. At runtime, the plug-in activities are executed as part
of the ActiveMatrix BusinessWorks process execution.
The TIBCO ActiveMatrix BusinessWorks Plug-in for Facebook is unique in its powerful integration capabilities,
and also unique in its dependency on another company's product. Because the plug-in uses the public API
of the platform, in this case, the Facebook Graph API, any open issues that have been reported against the
third-party API result in problems with the plug-in. If Facebook makes changes to their public API, the
activities functionality might become limited or might change.
Because the information about the activities is easy to extract from the Facebook Developer documentation,
this manual's focus is on an overview of each activity's tab. The manual also includes a typical example
scenario for each activity. For example, the Graph Query example scenario queries the feed for a user you
specify.
Related Topics
Introduction on page 11
TIBCO ActiveMatrix BusinessWorks Plug-in for Facebook
12 | Introduction
Activity Overview
When you start working with the plug-in, you might initially have some questions about the activities.
Search, Graph Query, and FQL Query Activities
The Search, Graph Query, and FQL Query activities allow you to mine the Facebook social graph for data.
You can direct each of the activities to other TIBCO ActiveMatrix BusinessWorks activities to filter the
information you retrieve.
On the Input tab of each of the three activities includes the following fields.
pageSize
Number of iterms included in each retrieval. Default is 1.
maxNumOfPages
Number of retrieval operations each time the process is run. Default is 1.
For example, if you set maxNumOfPages to 2 and page_Size to 3, the system retrieves six items. If you set
maxNumOfPages to 1 and page_Size to 4, the system retrieves four items.
You use the different data retrieval activities in different situations.
Search
Allows you to perform a simple search over the whole Facebook user space. You cannot restrict the
search parameters, though you could filter the output with another BusinessWorks activity.
Graph Query
Allows you to query an object and associated connections, for example, a user's friends or a user's post.
You must specify the object ID for the object you want to retrieve information about.
FQL Query
Allows you to perform a database query using Facebook Query Language. You can specify a user name
when you use FQL, but you do not need the user ID.
Publish and Delete Activities
Publish and Delete activities add objects or remove objects. These activities modify the space of the user or
other object. The app that is associated with the TIBCO BusinessWorks ActiveMatrix Plug-in for Facebook
must have permission to perform the activities.
As a rule, the user associated with the app and the app itself must be friends of a user to publish to a user's
page or to remove items from a user's page. The app can only remove items that it published earlier.
A further restriction is that the TIBCO BusinessWorks ActiveMatrix plug-in can delete only objects that the
plug-in posted. Even if the user associated with the plug-in app made a change using the Facebook UI, the
plug-in cannot undo that change.
Related Topics
Introduction on page 11
TIBCO ActiveMatrix BusinessWorks Plug-in for Facebook
Introduction | 13
Chapter
2
Authentication and Authorization Example
The Facebook Platform uses the OAuth 2.0 protocol for authentication and authorization. The protocol itself and
how Facebook uses the protocol can change at any time. This document therefore provides only an example.
Topics
• Introduction to Facebook Authentication
• Preparing Your Example App
• Generating Extended Authentication Tokens
TIBCO ActiveMatrix BusinessWorks Plug-in for Facebook
Introduction to Facebook Authentication
Each activity in the plug-in includes a token field in the Input tab. You must include an authentication token
in the token field to run the process.
The Facebook implementation of the OAuth 2.0 protocol consists of three steps:
User authentication
Ensures that the user who logs into Facebook is a valid Facebook user, that is, a user with a valid Facebook
user name and password.
App authorization
Ensures that when your app asks a user for access, the user knows exactly what data and capabilities
they are providing to your application.
Most ActiveMatrix BusinessWorks Plug-in for Facebook applications do not ask users for access but
work with publicly available user data instead.
App authentication
Ensures that users can be sure they are giving data to your app and not to a different app.
After your app completes these steps, the app is issued an access token that allows the app to access the user's
information if it has appropriate permissions. For example, you app might be able to examine the posts of a
user and of all friends of the user.
For background information on Facebook Authentication, go to the Core Concepts section of the
Facebook Developer documentation and select Authenticating an App in the sidebar. Do not click one
of the authentication flow links on the first page.
Related Topics
Authentication and Authorization Example on page 15
TIBCO ActiveMatrix BusinessWorks Plug-in for Facebook
16 | Authentication and Authorization Example
Preparing Your Example App
Before you begin
You can run some Facebook examples without authentication tokens, and you can generate a token for very
limited use with just one user. However, if you want to follow this example to generate a token for longer
use, you should make sure you have two Facebook users that are friends.
App_admin
A user who logs in to create or run the app.
App_user
A user who represents the company that runs the application. This user friends other users, thereby
gaining access to the data of the company's friends.
It is possible to have one user act as App_admin and App_user, but a clean separation between the application
creator and the company representative is useful.
About this task
For this example, you have to create an app and set up appropriate permissions for the App_admin and
App_user users.
This example illustrates one way of using authentication tokens. How you set up your environment
depends on what you want to do and on what Facebook supports.
Procedure
1.Log in as App_admin and create an app with the privacy settings you want to use. See the Facebook
Developer documentation, especially the tutorial.
Facebook generates an App ID and an App Secret and makes it available to App_admin through a redirect
URL, which looks like the following.
https://www.facebook.com/dialog/oauth &client_id=app_id
&redirect_uri=https://www.facebook.com/connect/login_success.html &response_type=token
&scope=read_stream,email,user_birthday,user_events,user_groups,
user_checkins,friends_groups,friends_checkins,friends_events,publish_stream
2.While logged in as App_admin, send a friend request to App_user to get access to the data of the friends
of App_user.
3.Log in as App_user and accept the friend request.
When App_user accepts the friend request, Facebook sends an access token for App_user to App_admin.
By accepting the request, App_user makes all data and all visible data of friend's of App_user available
to the app.
You can use the access token ID in the token field of the different activities' Input tab.
Results
The app now has access to all friends of the activity for the amount of time that Facebook uses as the default.
When this manual was written, the default was approximately 2 hours.
Related Topics
Authentication and Authorization Example on page 15
TIBCO ActiveMatrix BusinessWorks Plug-in for Facebook
Authentication and Authorization Example | 17
Generating Extended Authentication Tokens
Before you begin
Before you start generating extended authentication tokens, create users and prepare your app. See Preparing
Your Example App on page 17.
About this task
By default, a Facebook authentication token expires after two hours. You can extend the token to be valid for
six days.
The precise expirations for tokens and extended tokens depend entirely on the settings Facebook
assigns to those tokens.
Procedure
1.Log in as the App_user user and select App Settings > Advanced.
2.Enable Deprecate offline access and save your settings.
3.In a Web browser, access the Facebook page for App_admin and go to the privacy page settings
http://www.facebook.com/about/privacy/your_info.
4.Log in as App_user, select Apps and Settings, and remove the app.
5.Log out, clear your browser's cache, and use the following redirect URL for getting the initial token. The
URL cannot contain spaces, line breaks below are added for legibility.
https://www.facebook.com/dialog/oauth &client_id=app_id
&redirect_uri=https://www.facebook.com/connect/login_success.html &response_type=token
&scope=read_stream,email,user_birthday,user_events,user_groups,
user_checkins,friends_groups,friends_checkins,friends_events,publish_stream
6.Use the token that is returned for a short time (less than two hours).
7.Go to a different machine, start a Web browser, and log in to Facebook as App_user.
You will now exchange the short-term token for a long-term token. The extension request requires that
you have a currently valid token.
8.Use that extension URL with the existing token, App ID, App Secret, and so on to extend the token. The
URL cannot contain spaces, line breaks below are added for legibility.
https://graph.facebook.com/oauth/access_token ?client_id=app_id&client_secret=app_secret
&grant_type=fb_exchange_token&fb_exchange_token=token
Related Topics
Authentication and Authorization Example on page 15
TIBCO ActiveMatrix BusinessWorks Plug-in for Facebook
18 | Authentication and Authorization Example
Chapter
3
Facebook Palette
The Facebook Palette contains the activities you can include in your business process.
Topics
• Graph Query Activity
• Search Activity
• FQL Query Activity
• Publish Activity
• Delete Activity
• RealTimeListener Activity
TIBCO ActiveMatrix BusinessWorks Plug-in for Facebook
Graph Query Activity
The Facebook social graph represents the connections between Facebook objects such as users, links, and
pages. You can use the Graph Query Activity to query the social graph and then publish the results for further
use.
Graph Query allows you to search for a specific object and its details. It does not return results across all
Facebook objects like Search but focuses on a single object. A Graph Query searches a much smaller space
than a Search activity, but it requires the Object ID for the object you want information about.
Related Topics
Facebook Palette on page 19
Graph Query Configuration Tab on page 20
Graph Query Input Tab on page 20
Graph Query Output Tab on page 21
Graph Query Error Output Tab on page 21
Graph Query Example Scenario on page 22
Graph Query Troubleshooting on page 23
Graph Query Configuration Tab
The Graph Query Configuration tab lets you specify the name and description of your query, select an object
to query, and specify the connections of the object that you are interested in.
DescriptionField or Property
Name of the query.Name
Query description.Description
One of the Facebook objects to query on.Object
Click this checkbox to query connections between objects. A CollectionName
drop-down appears.
Query Connection
Type of connection you can query. For example, if you select a Post object, this
drop-down allows you to select Comments, Insights, and Likes.
See the Facebook Developer documentation for details.
CollectionName
Related Topics
Graph Query Activity on page 20
Graph Query Input Tab
DescriptionField or Property
Run the process twice to retrieve information, with different values
in the Input tab. .
graphObjectID
1.Use your own user ID or the string "me", including the double
quotes to retrieve the object you want to query. For example,
you might want to query a friend's connections, and you need
that friend's user ID to do so.
TIBCO ActiveMatrix BusinessWorks Plug-in for Facebook
20 | Facebook Palette
DescriptionField or Property
2.In a second Graph Query activity, specify the ID of the object
that you actually want to retrieve information about.
Maximum number of fetch operations the process performs.
Default is 1.
If you specify -1, the plug-in fetches data until the end of the result
set Facebook returns, regardless of the page size limit.
maxNumOfPages
Number of items returned for each fetch operation. Default is 1.
If you specify -1 for maxNumOfPages, this value is ignored.
page_Size
Additional parameters, depending on the selection you made in
the Configuration tab.
additionalParams
Facebook authentication token (OAuth token) to access the datatoken
Related Topics
Graph Query Activity on page 20
Graph Query Output Tab
XML representation of the returned object. The information available in the object depends on the object that
is selected in the Configuration tab and on the permissions settings for that object. For example, if you select
the object Link and the CollectionName Comments to get all comments on a link, the following fields are
included in the output.
• id
• metadata
• type
• from
• message
• createdTime
• likes
Related Topics
Graph Query Activity on page 20
Graph Query Error Output Tab
DescriptionError
If the plug-in cannot send the request or parse the response, an
FBPluginException results. A summary of the error returned from Facebook
displays in a dialog.
Select Window > Show Console to see the complete error message.
FBPluginException
If you get this error with a process that previously worked properly, Facebook
might have added fields to the object the activity is using. Check the input
field of the activity for missing input and see the Facebook documentation
for details.
TIBCO ActiveMatrix BusinessWorks Plug-in for Facebook
Facebook Palette | 21
DescriptionError
If the HTTP connection to Facebook is not available, or if another connection
problem that is unrelated to authorization exists, an FBConnectionException
results.
FBConnectionException
If your token is invalid, your token expired, or you do not have permissions
to retrieve or publish the information you want to retrieve or publish, an
FBOauthException results.
The error message from Facebook is not specific and you might have to
explore whether the problem is related to the token or related to permissions.
FBOauthException
Related Topics
Graph Query Activity on page 20
Graph Query Example Scenario
Before you begin
• You need a Facebook Authentication Token. See Authentication and Authorization Example on page 15.
• You need the User ID of a Facebook user. A common approach is to first run a query with the user "me",
and to retrieve that user's friends. In a second pass, user IDs of friends can be passed in and the information
can be retrieved when you set the Graph Query CollectionName to Friends to collect the names of the
user's friends.
About this task
The precise setup of the Configuration tab and the Input tab for an activity depends on the supported objects
in the Facebook API and in the plug-in. The example scenario queries the feed for a user you specify.
This example scenario illustrates only one way of using the activity.
Procedure
1.In TIBCO Designer, create a process select the Facebook palette, and add the Graph Query activity to the
process.
2.Connect the Start activity to Graph Query and Graph Query to the End activity.
3.Select the Graph Query activity and make the following choices in the Configuration tab.
– Name - Graph Query 42
– Object - User
– QueryConnection - Checked
– CollectionName - Feed
You check the QueryConnection checkbox to select connections associated with the selected object.
4.(Optional) Select the Input tab, select $_globalVariables, and enter the following values in the Activity
Input pane.
– GraphObjectID - Enter the User token for the user you want to query.
– token - Enter the Facebook authentication token this process should use.
You can specify the ID and the token in the mapper instead.
5.Run the process.
6.Select the Output tab and click Source.
You can review or process the feed data for the user you specified.
TIBCO ActiveMatrix BusinessWorks Plug-in for Facebook
22 | Facebook Palette
Related Topics
Graph Query Activity on page 20
Graph Query Troubleshooting
At times, your Graph Query might return different results than you expect. Review this information to help
resolve your problem.
• When you use a Graph Query to query a user's connection, you specify the ID in the Input tab. If you
specify the User ID instead of the Connection ID, Facebook queries the User, and the results correspond
to the object. Check carefully in the input tab of any activity, that you use the correct ID. The User ID and
the Connection ID are different, though no error results if you use the User ID in place of a Connection
ID.
• While working with a Graph Query, some confusion might result with a user's Subscribers and Subscribedto
connections.
– USER_ID/Subscribers - This user connection returns the people who are subscribed to given USER_ID.
According to Facebook documentation all friends are users' subscribers, but when you try to access
this connection it returns only the actual subscribers, not friends.
– USER_ID/Subscribedto - This user connection returns the list of users to whom the given USER_ID
is subscribed. According to Facebook documentation USER_ID is subscribed to all his friends, but
when you try to access this connection it returns only the user to whom USER_ID is explicitly subscribed
to, not all friends of the user.
Facebook documentation does not discuss this behavior, but all Facebook tools and APIs (Graph API,
SOAP_UI, etc.) return the same result as the plug-in.
• When you access user information with Graph Query, you can only access basic information. You cannot
access information on the user's interests such as books, movies, and so on. Consider using an FQL Query
instead.
• When you query for the links of a user, the query returns only the links of the user, not links of other
users.
• When you set up a Graph Query activity to retrieve all Likes for a Link on a user's page, no error results
even if you specify a User ID in the Input tab because Facebook cannot distinguish between User ID and
Link ID. When you run the process, it returns the Likes for the User.
To resolve the issue, change the graphObjectID on the Input tab to be a Link ID.
Related Topics
Graph Query Activity on page 20
TIBCO ActiveMatrix BusinessWorks Plug-in for Facebook
Facebook Palette | 23
Search Activity
The Search activity allows you to search public objects in the social graph. Searchable objects include public
posts, people, pages, events, groups, places, and checkins. By default, Search returns one result.
Add quotes around strings that include special characters.
You might also need to add a set of single quotes if the string you want to search for already includes double
quotes, or if text is repeating in the string. For example, to search for "fun fun fun" , enter the text '"fun fun
fun"'.
Related Topics
Facebook Palette on page 19
Search Configuration Tab on page 24
Search Input Tab on page 24
Search Output Tab on page 25
Search Error Output Tab on page 25
Search Example Scenario on page 25
Search Configuration Tab
DescriptionField or Property
Name of the searchName
Query searchDescription
The Facebook objects to search on.Object Type
Related Topics
Search Activity on page 24
Search Input Tab
DescriptionField or Property
Text to search Facebook for.searchText
Maximum number of fetch operations the process performs.
Default is 1.
If you specify -1, the plug-in fetches data until the end of the result
set Facebook returns, regardless of the page size limit.
maxNumOfPages
Number of items returned for each fetch operation. Default is 1.
If you specify -1 for maxNumOfPages, this value is ignored.
pageSize
Additional parameters, depending on the object you select in the
Configuration tab.
additionalParams
The token field only appears if you selected Place or User in the
Configuration tab. For other selections, you are performing a search
over public data and no token is required.
token
TIBCO ActiveMatrix BusinessWorks Plug-in for Facebook
24 | Facebook Palette
Related Topics
Search Activity on page 24
Search Output Tab
XML representation of the returned object. The information available in the object depends on the object that
is selected in the Configuration tab and on the permissions settings for that object.
Related Topics
Search Activity on page 24
Search Error Output Tab
DescriptionError
If the plug-in cannot send the request or parse the response, an
FBPluginException results. A summary of the error returned from Facebook
displays in a dialog.
Select Window > Show Console to see the complete error message.
FBPluginException
If you get this error with a process that previously worked properly, Facebook
might have added fields to the object the activity is using. Check the input
field of the activity for missing input and see the Facebook documentation
for details.
If the HTTP connection to Facebook is not available, or if another connection
problem that is unrelated to authorization exists, an FBConnectionException
results.
FBConnectionException
If your token is invalid, your token expired, or you do not have permissions
to retrieve or publish the information you want to retrieve or publish, an
FBOauthException results.
The error message from Facebook is not specific and you might have to
explore whether the problem is related to the token or related to permissions.
FBOauthException
Related Topics
Search Activity on page 24
Search Example Scenario
Before you begin
You need a Facebook Authentication Token. See Authentication and Authorization Example on page 15.
About this task
The precise setup of the Configuration tab and the Input tab for an activity depends on the supported objects
in the Facebook API and in the plug-in.For this example, you need an access token for a User object and Place
object. Other objects do not require additional access tokens.
This example scenario illustrates only one way of using the activity.
Procedure
1.In TIBCO Designer, create a process, select the Facebook palette, and add a Search activity to the process.
TIBCO ActiveMatrix BusinessWorks Plug-in for Facebook
Facebook Palette | 25
2.Connect the Start activity to Search and Search to the End activity.
3.Select the Search activity and make the following choices in the Configuration tab.
– Name: Search 55
– Object Type: Post
Setting these values allows you to search for posts. that contain the search text you specify in the Input
tab.
4.Select the Input tab, and enter the following values in the Activity Input pane.
– search_text - Type in the search text, for example, "Two-Second Advantage". Double quotes are
required.
5.Run the process.
6.Select the Output tab and click Source.
The Source pane displays the posts on Facebook that include the string.
Related Topics
Search Activity on page 24
TIBCO ActiveMatrix BusinessWorks Plug-in for Facebook
26 | Facebook Palette
FQL Query Activity
Facebook Query Language, or FQL, allows you to query the data available in the Facebook social graph. In
contrast to the Graph Query activity and the Search activity, you can narrow down the search results.
What is displayed in the output depends on the permissions associated with the token.
FQL queries use the following syntax:
SELECT [fields] FROM [table] WHERE
[conditions]
Unlike SQL, the FQL FROM clause can contain only a single table. You can define subqueries by using IN
keyword in the SELECT clause or in the WHERE clauses. However, subqueries cannot reference variables
in the outer query's scope.
Your query can include basic boolean operators ( AND or NOT logical operators) and ORDER BY and LIMIT
clauses. Your query must be indexable, which means that it queries properties that are marked as indexable
in the Facebook Graph API documentation.
Some of the advanced functionality available in the FQLAPI is not supported by the Facebook FQL Querey
activity. For example, if you want to perform multiple queries, you have to feed the result of one FQL Query
into a second FQL Query.
For some queries, you need not only the authentication token but also the application token. See the
Facebook documentation for details.
Related Topics
Facebook Palette on page 19
FQL Query Configuration Tab on page 27
FQL Query Input Tab on page 28
FQL Query Output Tab on page 28
FQL Query Error Output Tab on page 28
FQL Query Example Scenario on page 29
FQL Query Configuration Tab
The Configuration tab allows you to define the query by following these steps:
1.Define the FROM clause by selecting one of the items in the Tables dropdown.
2.Define the SELECT clause by selecting one or more of the columns that become available when you click
Pick Columns.
3.Define the WHERE clause, using the syntax discussed in the Facebook developer documentation. You
can define subqueries by using the IN keyword in the WHERE clause. However, subqueries cannot
reference variables in the outer query's scope.
DescriptionField or Property
Name of the FQL QueryName
FQL Query description.Description
List of tables over which you can run the FQL Query. See the Facebook Developer
Documentation for details on what each table means.
For example, Comment queries this table to obtain comments associated with one
Facebook object, for example, comments associated with a Post, Link, Video, or Photo.
Tables
TIBCO ActiveMatrix BusinessWorks Plug-in for Facebook
Facebook Palette | 27
DescriptionField or Property
Click Pick Columns to display a multi-choice table, click the check boxes next to the
fields to select, and click OK.
Columns
WHERE clause for the FQL Query.Where
Related Topics
FQL Query Activity on page 27
FQL Query Input Tab
DescriptionField or Property
Optional field to override the WHERE clause of the FQL Query at
runtime.
Use this field if a BusinessWorks activity feeds data to this activity,
and you want to use something in the input data as the query
string.
whereClause
Specify only the WHERE clause. If the syntax of the text in
this field does not match the WHERE clause syntax, an
error results.
Facebook OAuth token to access the datatoken
Related Topics
FQL Query Activity on page 27
FQL Query Output Tab
XML representation of the returned object. The information available in the object depends on the object that
is selected in the Configuration tab and on the permissions associated with the token. The token permissions
ultimately depend on the permissions the user associated with the token granted to the App.
The plug-in supports a subset of the output returned by the Facebook FQL Query API. If the Facebook
Query API changes, even those fields might not all be available.
Related Topics
FQL Query Activity on page 27
FQL Query Error Output Tab
DescriptionError
If the plug-in cannot send the request or parse the response, an
FBPluginException results. A summary of the error returned from Facebook
displays in a dialog.
Select Window > Show Console to see the complete error message.
FBPluginException
If you get this error with a process that previously worked properly, Facebook
might have added fields to the object the activity is using. Check the input
field of the activity for missing input and see the Facebook documentation
for details.
TIBCO ActiveMatrix BusinessWorks Plug-in for Facebook
28 | Facebook Palette
DescriptionError
If the HTTP connection to Facebook is not available, or if another connection
problem that is unrelated to authorization exists, an FBConnectionException
results.
FBConnectionException
If your token is invalid, your token expired, or you do not have permissions
to retrieve or publish the information you want to retrieve or publish, an
FBOauthException results.
The error message from Facebook is not specific and you might have to
explore whether the problem is related to the token or related to permissions.
FBOauthException
Related Topics
FQL Query Activity on page 27
FQL Query Example Scenario
Before you begin
• You need a Facebook Authentication Token. See Authentication and Authorization Example on page 15.
• Decide on an indexable column field with a corresponding value to perform the query over.
About this task
The precise setup of the Configuration tab and the Input tab for an activity depends on the supported objects
in the Facebook API and in the plug-in. This example scenario illustrates only one way of using the activity.
This example scenario illustrates only one way of using the activity.
Procedure
1.In TIBCO Designer, create a process, select the Facebook palette, and add an FQL Query activity to the
process.
2.Connect the Start activity to FQL Query and FQL Query to the End activity.
3.Select the FQL Query activity and select or type the following in the Configuration tab.
– Name - FQL Query 58
– Tables - user
– Columns -
uid,first_name,middle_name,last_name,pic,religion,movies,about_me,notes_count,email,third_party_id
– where - uid=me()
4.Select FQL Query in the Process Pane to display the Column Editor and verify the fields you typed in the
Columns field are selected.
You can change the fields to query from the Columns editor.
5.Run the process.
6.Select the Output tab and click Source.
The <Output> element displays the requested information. What can be displayed depends on the token
associated with the App.
7.Click Source to display the XML version of the output.
Related Topics
FQL Query Activity on page 27
TIBCO ActiveMatrix BusinessWorks Plug-in for Facebook
Facebook Palette | 29
Publish Activity
Your ActiveMatrix BusinessWorks Plug-in for Facebook process can publish to the Facebook social graph by
using HTTP POST requests. You must have an authentication token. You cannot publish to all objects.
The Post section in the Graph API Facebook Developer documentation includes details on a post's
fields. The Publish activity includes only a subset of these fields.
Examples
For example, to publish an event, follow these steps:
1.In the Configuration tab, select Events (of a User) and click Apply.
2.If you want to invite someone to your event, create another Publish activity and select Invited (of an Event)
in the Configuration tab.
3.The invited user can then publish Attending (of an Event), Maybe (of an Event) and Declined (of an Event).
Another good example is publishing notes.
Facebook Documentation
The Facebook documentation includes information about the post's connection. When this manual was
written, the most relevant information was at https://developers.facebook.com/docs/reference/api/post/.
Consult also the section on publishing at http://developers.facebook.com/docs/reference/api.
The Graph API documentation for each Facebook object includes a Connection section that includes a Create
section. This section explains how to publish comments or like that object.
Setting the Privacy Field for the Feed of a User
If you want to set the privacy field for the Feed of a User, you can use a JSON string, for example:
"{'value':'CUSTOM', 'friends':'ALL_FRIENDS', 'description':'US,CA'}"
Related Topics
Facebook Palette on page 19
Publish Configuration Tab on page 30
Publish Input Tab on page 31
Publish Output Tab on page 31
Publish Error Output Tab on page 31
Publish Example Scenario on page 32
Publish Configuration Tab
The Publish configuration tab lets you specify what you want to publish. For example, you might publishes
an event to a user's page.
DescriptionField or Property
Name of the Publish activity.Name
Publish activity description.Description
Drop-down list of potential connections you might publish.
When you use the Publish activity to publish the Links (of a Page), you must pass in
a page token. Passing in a user token results in an error.
Connection
TIBCO ActiveMatrix BusinessWorks Plug-in for Facebook
30 | Facebook Palette
Related Topics
Publish Activity on page 30
Publish Input Tab
DescriptionField or Property
The name and contents of the first element of the Input tab depends
on the selection you make in the Configuration tab. For example,
<first element>
if you choose Comments (of a Post), you can specify the ID of the
post you want to publish a comment to, and the parameters you
can specify for the comment.
The precise parameters you can specify depend on the selection
you make in the Configuration tab. For example, if you choose
Comments (of a Post), you can specify the message of the comment.
parameters
Facebook OAuth token to access the datatoken
Related Topics
Publish Activity on page 30
Publish Output Tab
DescriptionField or Property
Typically the ID of the published object.
For Attending, Maybe, Declined, Invited and Likes connections,
the Publish activity returns true or false instead of an ID.
publishResult
Related Topics
Publish Activity on page 30
Publish Error Output Tab
DescriptionError
If the plug-in cannot send the request or parse the response, an
FBPluginException results. A summary of the error returned from Facebook
displays in a dialog.
Select Window > Show Console to see the complete error message.
FBPluginException
If you get this error with a process that previously worked properly, Facebook
might have added fields to the object the activity is using. Check the input
field of the activity for missing input and see the Facebook documentation
for details.
If the HTTP connection to Facebook is not available, or if another connection
problem that is unrelated to authorization exists, an FBConnectionException
results.
FBConnectionException
TIBCO ActiveMatrix BusinessWorks Plug-in for Facebook
Facebook Palette | 31
DescriptionError
If your token is invalid, your token expired, or you do not have permissions
to retrieve or publish the information you want to retrieve or publish, an
FBOauthException results.
The error message from Facebook is not specific and you might have to
explore whether the problem is related to the token or related to permissions.
FBOauthException
Related Topics
Publish Activity on page 30
Publish Example Scenario
Before you begin
You need a Facebook Authentication Token. See Authentication and Authorization Example on page 15.
About this task
The precise setup of the Configuration tab and the Input tab for an activity depends on the supported objects
in the Facebook API and in the plug-in. This example scenario illustrates only one way of using the activity.
The example scenario publishes an event to a user's page. After the process has run, you can see in the Output
tab that an event was published, but you cannot see any information about the event. You could insert a
Sleep activity, and follow that with an FQL Query or a Graph Query to check that the event is visible on the
pages to which it was published.
This example scenario illustrates only one way of using the activity.
Procedure
1.In TIBCO Designer, create a process, select the Facebook palette, and add a Publish activity to the process.
2.Connect the Start activity to Publish and Publish to the End activity.
3.Select the Publish activity and make the following choices in the Configuration tab.
– Name - Publish 42
– Connection - Events (of a User)
4.Select the Input tab specify activity input for which you have predefined global variables.
– Profile ID - In the ProcessData pane, open $_globalVariables, open GlobalVariables, and connect from
the User ID you set up earlier to the profileID in the Activity Input pane.
You can get that ID by performing a Graph Query for a User Object's Friends.
– Token - Connect from the user's Authentication token in the Process Data pane to the token field in
the Activity Input pane.
5.Open parameters and specify event parameters as shown in the following example screen.
TIBCO ActiveMatrix BusinessWorks Plug-in for Facebook
32 | Facebook Palette
6.Run the process.
7.Select the Output tab and verify that the Output tab indicates that the event was published.
8.To independently verify that the event was published, navigate to the Facebook home page and log in as
the user that was used in this Publish activity. Look at the user's events to verify the event is visible.
Related Topics
Publish Activity on page 30
TIBCO ActiveMatrix BusinessWorks Plug-in for Facebook
Facebook Palette | 33
Delete Activity
The delete activity allows you to delete objects in the social graph. For example, you might be able to delete
a comment or delete a like for a post.
The plug-in can only delete items that the plug-in added, and can only perform the deletion if the
user's permissions allow it.
Related Topics
Facebook Palette on page 19
Delete Configuration Tab on page 34
Delete Input Tab on page 35
Delete Output Tab on page 35
Delete Error Output Tab on page 35
Delete Activity Troubleshooting on page 36
Delete Configuration Tab
The Delete activity Configuration tab includes the following objects:
• Link
• Post
• Page
• Event
• Other
• Comment
If you select Other, you can specify other objects by specifying the Object ID in the Input tab. Those objects
include groups, notes, photos, or other objects that the plug-in App published earlier. The Connection
drop-down menu of the Publish tab shows all objects the plug-in App can publish. You can only specify
objects that are not included in the Delete Configuration tab when you choose Other.
DescriptionField or Property
Name of the Delete activity.Name
Delete activity description.Description
Select the type of object you want to delete from the drop-down menu. When this
manual was written, information about permissions you might need to delete an object
was available at http://developers.facebook.com/docs/authentication/permissions.
The Delete activity can only delete objects that have an ID. Objects that do not have
an ID, such as Attending, Invited, and Maybe, cannot be deleted separately from the
Object
object. For those cases, the whole object, for example the event, is deleted if the
permissions are set to allow this.
If you selected Post as the object, you can delete the like of the post.Unlike this object
Related Topics
Delete Activity on page 34
TIBCO ActiveMatrix BusinessWorks Plug-in for Facebook
34 | Facebook Palette
Delete Input Tab
DescriptionField or Property
ID of the object to be deleted, for example, a post ID.graphObjectID
If you accidentally specify the User ID, the user with that
ID is deleted.
Facebook OAuth token to access the datatoken
Related Topics
Delete Activity on page 34
Delete Output Tab
DescriptionField or Property
True if successful.
If the Delete operation is not successful, an error results.
deleteResult
Related Topics
Delete Activity on page 34
Delete Error Output Tab
DescriptionError
If the plug-in cannot send the request or parse the response, an
FBPluginException results. A summary of the error returned from Facebook
displays in a dialog.
Select Window > Show Console to see the complete error message.
FBPluginException
If you get this error with a process that previously worked properly, Facebook
might have added fields to the object the activity is using. Check the input
field of the activity for missing input and see the Facebook documentation
for details.
If the HTTP connection to Facebook is not available, or if another connection
problem that is unrelated to authorization exists, an FBConnectionException
results.
FBConnectionException
If your token is invalid, your token expired, or you do not have permissions
to retrieve or publish the information you want to retrieve or publish, an
FBOauthException results.
The error message from Facebook is not specific and you might have to
explore whether the problem is related to the token or related to permissions.
FBOauthException
Related Topics
Delete Activity on page 34
TIBCO ActiveMatrix BusinessWorks Plug-in for Facebook
Facebook Palette | 35
Delete Activity Troubleshooting
At times, your Delete activity might behave differently than you expect. Review this information to help
resolve your problem.
• When you attempt to use the Delete activity to delete posts from a user's profile, an Invalid Parameter
Error results. The behavior is based on a difference between a user's links and a user's feeds and the
corresponding access tokens.
– USER_ID/links - Returns the links created by the mentioned USER_ID. The link is same as post with
additional attribute link. To access all the links (public, private) of the user we need his access token
with "read_stream" permission, otherwise only the links that are public will be displayed.
– USER_ID/feed - Return anything that was posted on given USER_IDs wall. This includes updates
from given USER_ID and his friends. The updates include status, posts, and links from given USER_ID
and his friends. To access all the feeds we need "read_stream" permission on the user or else we'll only
get public feeds.
• When you use the Publish activity to publish the Links or Checkins of a User, Facebook returns a 1-part
ID for that user. When the Delete activity attempts to delete that Link or Checkin, the Delete operation
fails because Facebook expects a 2-part ID.
This issue has been reported as http://bugs.developers.facebook.net/show_bug.cgi?id=10413.
• Even though the Delete activity includes a Page option, you cannot delete a page. The Publish activity
does not support publishing a page, and your App cannot delete items it did not publish.
Related Topics
Delete Activity on page 34
TIBCO ActiveMatrix BusinessWorks Plug-in for Facebook
36 | Facebook Palette
RealTimeListener Activity
The RealTimeListener activity is a TIBCO ActiveMatrix BusinessWorks starter activity. It enables ActiveMatrix
BusinessWorks customers to subscribe to changes in data in Facebook. By listening to changes, rather than
polling the Facebook servers, an ActiveMatrix BusinessWorks application can improve reliability and decrease
load times.
Internally, the listener starter activity follows these steps to set up a subscription:
1.An internal Tomcat server is set up with an endpoint URL. The server receives both HTTP GET requests
(for subscription verification) and HTTP POST requests (for actual changed data) from Facebook.
2.The Tomcat server makes a POST to the Facebook graph API URL to subscribe to changes on certain
Facebook objects, and is ready to handle the verification request.
3.Facebook servers will make an HTTP GET request to the callback URL.
4.The Tomcat server verifies the verify_token value that ActiveMatrix BusinessWorks passes to Facebook
and returns the hub.challenge value. This verification technique prevents malicious apps from using the
real-time feature as tool for distributed denial-of-service (DDoS) attacks.
5.If there is a valid subscription, and if data changes, Facebook servers make an HTTP POST request to the
callback URLActiveMatrix BusinessWorks specified. The request has a content type of application/json.
The body is a JSON-encoded string that contains one or more changes. By default, ActiveMatrix
BusinessWorks outputs the content in XML. You can instead output the content in JSON.
Related Topics
Facebook Palette on page 19
RealTimeListener Configuration Tab on page 37
RealTimeListener Output Tab on page 38
RealTimeListener Error Output Tab on page 38
RealTimeListener Example Scenario on page 39
RealTimeListener Configuration Tab
DescriptionField or Property
Name of the RealTimeListener activity.Name
RealTimeListener activity description.Description
The IP address (or machine name) that you run this listener on.Endpoint Address
Port of the listener endpointPort
ID of your app.App ID
The access token associated with the app. This is not the user access token.Access Token
Object you want to subscribe to. Facebook currently allows you to subscribe to user,
permission, and page objects.
Object type
The list of fields and a list of connections in the selected object that you want to
subscribe to.
Fields
Click this check box to receive the output in JSON format. The default is text.JSON
Click this checkbox to set up the connection as an SSL connection.SSL
Keystore file location. Visible only if you turned on SSL.Keystore File
Password of the keystore file. Visible only if you turned on SSL.Keystore Password
TIBCO ActiveMatrix BusinessWorks Plug-in for Facebook
Facebook Palette | 37
Related Topics
RealTimeListener Activity on page 37
RealTimeListener Output Tab
The change notification sent from Facebook does not include the actual data values; to obtain those, you can
request them as normal, subject to the usual privacy restrictions.
If you select the JSON Object field in the Configuration tab, the output is a JSON object. If you do not select
the JSAN Object field in the Configuration tab, the output is XML.
DescriptionField or Property
Object this notification is for.object
List of changed object entries.entry
Object ID of the change object entry.uid
Fields that are changed for the changed object entry.changed_fields
Time at which the change happened.time
Related Topics
RealTimeListener Activity on page 37
RealTimeListener Error Output Tab
DescriptionError
If the plug-in cannot send the request or parse the response, an
FBPluginException results. A summary of the error returned from Facebook
displays in a dialog.
Select Window > Show Console to see the complete error message.
FBPluginException
If you get this error with a process that previously worked properly, Facebook
might have added fields to the object the activity is using. Check the input
field of the activity for missing input and see the Facebook documentation
for details.
If the HTTP connection to Facebook is not available, or if another connection
problem that is unrelated to authorization exists, an FBConnectionException
results.
FBConnectionException
If your token is invalid, your token expired, or you do not have permissions
to retrieve or publish the information you want to retrieve or publish, an
FBOauthException results.
The error message from Facebook is not specific and you might have to
explore whether the problem is related to the token or related to permissions.
FBOauthException
Related Topics
RealTimeListener Activity on page 37
TIBCO ActiveMatrix BusinessWorks Plug-in for Facebook
38 | Facebook Palette
RealTimeListener Example Scenario
Before you begin
• You need a Facebook Authentication Token. See Authentication and Authorization Example on page 15.
• You need the User ID of a Facebook user. A common approach is to first run a query with the user "me",
and to retrieve that user's friends. In a second pass, user IDs of friends can be passed in and the information
can be retrieved.
About this task
The precise setup of the Configuration tab and the Input tab for an activity depends on the supported objects
in the Facebook API and in the plug-in. This example scenario illustrates only one way of using the activity.
The example scenario implements a real-time listener that checks for changes to the feed and the friends of
a user you specify.
This example scenario illustrates only one way of using the activity.
Procedure
1.In TIBCO Designer, create a process and drag the RealTimeListener activity on top of the Design pane.
RealTimeListener replaces the Start activity.
2.Select the RealTimeListener activity and make the following choices in the Configuration tab.
– Name - RealTimeListener 37
– Endpoint Address - Specify an address such as bwsm-test.company37.com
– App ID - Paste in the ID for the App that is making the connection to Facebook.
– Access Token - Paste in the Access Token associated with the App that is making the connection to
Facebook.
– Object Type - User
– Fields - Click Pick Fields and specify the connections for the specified user, for example, feed and
friends.
You check the QueryConnection checkbox to select connections associated with the selected object.
3.Run the process and select the Output tab of the RealTimeListener.
4.Change a field in any user who granted permission to the App. The feed gets updates from every user
who granted permission.
If you are not logged in as a user who can make a change, you might have to log in and log out again.
5.Return to TIBCO Designer and select the RealTimeListener Output tab.
The changed field shows feed, and the time field shows the time at which the feed was last changed.
Related Topics
RealTimeListener Activity on page 37
TIBCO ActiveMatrix BusinessWorks Plug-in for Facebook
Facebook Palette | 39
Chapter
4
Troubleshooting and Errors
If you encounter problems when you run a process, you can often resolve the problem by looking at the console,
the error output, and the error code documentation.
Topics
• Troubleshooting Overview
• Troubleshooting Activity Errors
• Facebook Plug-in Exceptions
TIBCO ActiveMatrix BusinessWorks Plug-in for Facebook
Troubleshooting Overview
When your TIBCO ActiveMatrix BusinessWorks process encounters an error, it highlights the activity where
the error occurred in red and displays an error in a dialog. Several causes for the error are possible.
BusinessWorks process error
If there is a problems with your BusinessWorks process setup, the error displays in a dialog. Choose
Window > Show Console to display detailed error information.
Select the Output tab in the activity to see the error output. If the message code starts with BW, you can
look up the code in the TIBCO ActiveMatrix BusinessWorks Error Code documentation.
Facebook Plug-in Error Output
If there is a problem with the plug-in configuration, the error displays in the dialog. Choose Window
> Show Console to display detailed error information.
To resolve the error, try the suggestions in Facebook Plug-in Exceptions on page 44. Contact TIBCO
Support after you have verified that the error is not the result of a change on the Facebook side.
Related Topics
Troubleshooting and Errors on page 41
TIBCO ActiveMatrix BusinessWorks Plug-in for Facebook
42 | Troubleshooting and Errors
Troubleshooting Activity Errors
When your run a process and an error results, or when you run a process and the result is not what you
expected, several reasons are possible.
• Facebook behavior has changed since the plug-in was released. Read the Facebook API documentation
carefully.
• The behavior you expect does not completely map to the behavior of the Facebook API. For example,
certain terms such as "link" might mean something very specific.
• In some situations, you can give an input in the Input tab that does not match the item selected in the
Configuration tab.
See the Troubleshooting sections of individual activities and the Release Notes, as well as Facebook developer
documentation for additional troubleshooting pointers.
Related Topics
Troubleshooting and Errors on page 41
TIBCO ActiveMatrix BusinessWorks Plug-in for Facebook
Troubleshooting and Errors | 43
Facebook Plug-in Exceptions
If running a process results in an error, the activity where the error occurred is highlighted in red. When you
select the activity's Error Output tab, the Error displays, along with any error that Facebook sent to the plug-in.
DescriptionError
If the plug-in cannot send the r equest or parse the r esponse, an
FBPluginException results. A summary of the error returned from Facebook
displays in a dialog.
Select Window > Show Console to see the complete error message.
FBPluginException
If you get this error with a process that previously worked properly, Facebook
might have added fields to the object the activity is using. Check the input
field of the activity for missing input and see the Facebook documentation
for details.
If the HTTP connection to Facebook is not available, or if another connection
problem that is unrelated to authorization exists, an FBConnectionException
results.
FBConnectionException
If your token is invalid, your token expired, or you do not have permissions
to retrieve or publish the information you want to retrieve or publish, an
FBOauthException results.
The error message from Facebook is not specific and you might have to
explore whether the problem is related to the token or related to permissions.
FBOauthException
Related Topics
Troubleshooting and Errors on page 41
TIBCO ActiveMatrix BusinessWorks Plug-in for Facebook
44 | Troubleshooting and Errors
Chapter
5
Process Example
A simple example can help you get started setting up your own processes with the TIBCO ActiveMatrix
BusinessWorks Plug-in for Facebook. The example assumes you understand how to set up and run TIBCO
BusinessWorks processes from TIBCO Designer.
Topics
• Example Overview
• Creating the Parsing Page Feeds Process
• Creating the Product Direction Process
TIBCO ActiveMatrix BusinessWorks Plug-in for Facebook
Example Overview
The example assumes that a small family-owned purveyor of hand-crafted garden ornaments has a select
number of customers. Each customer is a fan of the store's Facebook page, which helps customers keep abreast
of new products and other exciting developments. The tutorial uses the term fan for any user who added a
comment to a page post, liked a post, or added a post to the company page.
To help determine product direction, the webmaster can use the TIBCO ActiveMatrix BusinessWorks Plug-In
for Facebook to determine the interests of the customers. For example, the plug-in is set up to collect the user
IDs of the company's fans. If more than 50% of the company's fans are also fans of the National Weather
Service, the company crafts a small number of weather stations tastefully framed in Brazilian ironwood, and
posts a brief introduction to the product to the company Facebook page, with a link to the company Web site
for more details and photos.
The example consists of two processes.
ParsingPageFeeds Process
The ParsingPageFeeds process collects the user ID of the fans of the company's facebook page. The process
includes the following activities.
1.A Graph Query extracts the company's page feed and passes it to three Mapper activities.
2.Three Mapper activities take extract three types of users who are interested in the company from the page
feed. For example, the Get Users who Posted activity extracts all users who posted to the company page.
3.A Java Code MergeUIDs activity combines the output of the three Mapper activities, with a list of all
company fans passed on to the next process. The code eliminates duplicates.
ProductDirection Process
The ProductDirection process is the top-level process. It determines which of the company fans are also fans
of the National Weather Service, and compares the two numbers. If more than 50% of the company fans are
also passionate about weather, the process gives a green light for production of the new product. The process
includes the following activities.
1.The ParsingPageFeeds process extracts the User IDs of all fans of the company from the company feed.
2.The Check Fans of Other Page activity iterates over the company fans and checks for each fan whether
the user is also interested in the National Weather Service.
3.The CompareFanCounts activity compares counts the company fans and the users who are both fans of
the company and fans of the National Weather Service. The activity true if more than half of the company's
fans are interested in weather.
Facebook authentication tokens are required for each process.
Related Topics
Process Example on page 45
TIBCO ActiveMatrix BusinessWorks Plug-in for Facebook
46 | Process Example
Creating the Parsing Page Feeds Process
Before you begin
• This description assumes that you know how to configure TIBCO BusinessWorks processes. See the TIBCO
BusinessWorks documentation for details.
• To configure this example for your own application, you need the Page ID for the company page and a
Facebook Authentication Token.
About this task
The Parsing Page Feeds Process extracts User IDs of the company's fans from the company feed. This example
assumes a user is a fan if that user posted to the company page, liked a post on the company page, or
commented on a company page post. You can review the example included in the product, or create the
process as follows.
Procedure
1.Open TIBCO Designer and select New Empty Project when prompted.
2.In the panel on the left, click the Palettes tab and click Process.
3.Drag a process into the Design panel on the right and define the process.
– Name - ParsingPageFeeds
– targetNamespace - Filled in by Designer
4.Double-Click the process.
A Start and End activity appear in the Design panel.
5.Click the Facebook palette, drag a GraphQuery activity to the right of the Start activity in the Design panel,
and set up the GraphQuery.
a) Select the Connector icon in the menu bar and drag a line from the Start activity to the GraphQuery
activity.
b) Click the GraphQuery activity. In the Configuration tab, name the activity Our Page and make the
following selections.
• Object - Page
• QueryConnection - Checked
• CollectionName - Feed
c) In the Input tab, open the ProcessData on the left and the ActivityInput on the right and direct the data
flow.
• Copy the company's Page ID into the graphObjectID field.
• Copy your authentication token into the token field.
6.Select the General Activity palette, drag three Mapper activities into the Process, and connect and configure
those activities.
a) Drag a line from the GraphQuery activity to the first Mapper activity.
b) Repeat for the other two Mapper activities.
c) Configure each activity to extract one type of user from the company feed.
See the TIBCO BusinessWorks documentation for information about Mapper activities, or look at the
example.
7.Select the Java pallet, drag a Java Code activity into the Design panel, and make connections from the
Mapper activities to the Java Code activity, as shown in the screen shot below.
TIBCO ActiveMatrix BusinessWorks Plug-in for Facebook
Process Example | 47
8.In the Java Code, loop through the user IDs the Mapper activities have as their output and make sure no
duplicates are included. The list of User IDs of company fans becomes the input to the Product Direction
process.
9.Modify the Input tab of the End activity so the output of the MergeUIDs activity is passed on to the next
activity.
See the TIBCO BusinessWorks documentation for details.
Figure 1: ParsingPageFeeds Process
Related Topics
Process Example on page 45
TIBCO ActiveMatrix BusinessWorks Plug-in for Facebook
48 | Process Example
Creating the Product Direction Process
About this task
The Product Direction process first runs the ParsePageFeeds process, which returns all fans of the company.
The process looks at each user and checks whether that user is also a fan of the National Weather Service
page. Finally, ProductDirection determines the percentage of weather aficionado among the company fans
and gives the green light for the new product if more than 50% are interested in the weather.
Procedure
1.Open TIBCO Designer and select New Empty Project.
2.In the panel on the left, click the Palettes tab and click Process.
3.Drag a process into the Design panel on the right and define the process.
– Name - ProductDirection
– targetNamespace - Filled in by Designer
4.Double-Click the process.
A Start and End activity appear in the Design panel.
5.From the Project tab, drag the ParsingPageFeeds process into the Design panel and connect it with the
Start activity.
6.Click the Facebook palette, and drag an FQL Query activity to the right of the process and make the
following selections.
a) Configuration tab:
• Name - Check Fans of other Page
• Tables - remove check_in, add page_fan
• Colums - uid, page_id
b) Input tab:
• Create three global variables, access_token, Page_ID and otherPage_ID and spacify the value for
each. If you are using the sample project, replace the values of the existing global variables.
• Spedify a Where clause that checks for a user whether that user is a fan of the National Weather
Service, identified by otherPage_ID.
concat(concat(concat
("uid =", $uids/uids)," and page_id="),
$_globalVariables/ns:GlobalVariables/otherPage_ID)
See the TIBCO ActiveMatrix BusinessWorks documentation for more information.
7.Make a group, as follows:
a) Select the arrow icon in the toolbar and drag a square around the FQl Query (Check Fans of Other
Page).
b) Click the Group icon in the tool bar to create a group and allow for processing of each result.
c) Connect the process with the FQL Query group
See the TIBCO BusinessWorks documentation for information about Group activities, or look at the
example.
8.Select the Java pallet and drag a Java Code activity into the Design panel. This activity collects the output
of Check Fans of other Page and compares is with the total number of company fanse. The activity returns
true if at least 50% of the company page fans are also fans of the National Weather Service.
TIBCO ActiveMatrix BusinessWorks Plug-in for Facebook
Process Example | 49
Figure 2: ProductDirection Process
Related Topics
Process Example on page 45
TIBCO ActiveMatrix BusinessWorks Plug-in for Facebook
50 | Process Example