Download as pdf or txt
Download as pdf or txt
You are on page 1of 36

Workspace Plug-in for Salesforce

Developers Guide
v2.1.6.0

December 08, 2017

Genesys Professional Services

NOTICE

Copyright © 2012-2017 Genesys Telecommunications Laboratories, Inc. All rights reserved.


GENESYS PROFESSIONAL SERVICES

Genesys Telecommunications Laboratories, Inc.


2001 Junipero Serra Blvd.,
Daly City, CA 94014

Phone: 1-888-GENESYS
Fax: 1-650-466-1260

The information contained herein is proprietary and confidential and cannot be disclosed or duplicated without the prior written
consent of Genesys Telecommunications Laboratories, Inc.

You are responsible for the security of your system. Product administration to prevent unauthorized use is your responsibility. Your
system administrator should read all documents provided with this product to fully understand the features available that reduce
your risk of incurring charges for unlicensed use of Genesys products.

ABOUT GENESYS
Genesys is the world's leading provider of customer service and contact software - with more than 4,000 customers in 80 countries.
Drawing on its more than 20 years of customer service innovation and experience, Genesys is uniquely positioned to help
companies bring their people, insights and customer channels together to effectively drive today's customer conversation. Genesys
software directs more than 100 million interactions every day, maximizing the value of customer engagement and differentiating the
experience by driving personalization and multi-channel customer service - and extending customer service across the enterprise to
optimize processes and the performance of customer-facing employees. Go to www.genesys.com for more information.

TRADEMARKS
Genesys and the Genesys logo are registered trademarks of Genesys Telecommunications Laboratories, Inc. All other company
names and logos may be trademarks or registered trademarks of their respective holders.

YOUR RESPONSIBILITY FOR YOUR SYSYTEM’S SECURITY


You are responsible for the security of your system. Product administration to prevent unauthorized use is your responsibility. Your
system administrator should read all documents provided with this product to fully understand the features available that reduce
your risk of incurring charges for unlicensed use of Genesys products.

INTERNAL REFERENCE NUMBER


IRN: TDS207-0212
Services Engineering IRN – DO NOT CHANGE

WORKSPACE PLUG-IN FOR SALESFORCE DEVELOPERS GUIDE PAGE 2 OF 36


GENESYS PROFESSIONAL SERVICES

Table of Contents
1 Introduction ......................................................................................................... 4
1.1 About the Workspace Plug-in for Salesforce ...................................................................... 4
1.2 How the Software Works .................................................................................................... 5
1.2.1 Classic/Console Model .......................................................................................... 6
1.2.2 Lightning Model ...................................................................................................... 8
2 Documentation................................................................................................... 10
2.1 Salesforce Developer Documentation .............................................................................. 10
2.2 Genesys Technical Documentation .................................................................................. 10
3 Communication .................................................................................................. 11
3.1 Communication Protocol Between Workspace and Salesforce ....................................... 11
3.2 Communication Method Within Salesforce ....................................................................... 11
3.2.1 [action] Request Template ................................................................................... 11
3.2.2 AttachData Request ............................................................................................. 12
3.3 Messaging ......................................................................................................................... 13
3.3.1 Messages from Salesforce to WDE ..................................................................... 13
3.3.2 Messages from WDE to Salesforce ..................................................................... 14
3.4 Messaging Sequence ....................................................................................................... 17
3.4.1 Login .................................................................................................................... 17
3.4.2 Interaction Handling ............................................................................................. 18
4 Features ............................................................................................................. 19
4.1 Screen Pop ....................................................................................................................... 19
4.1.1 Voice Inbound ...................................................................................................... 19
4.1.2 Voice Outbound ................................................................................................... 19
4.1.3 Email .................................................................................................................... 19
4.1.4 Chat ...................................................................................................................... 19
4.1.5 Work Item ............................................................................................................. 19
4.1.6 SMS ..................................................................................................................... 20
4.1.7 Web Callback ....................................................................................................... 20
4.1.8 Open Media.......................................................................................................... 20
4.1.9 Social ................................................................................................................... 20
4.2 Data Display ...................................................................................................................... 21
4.3 Search Capability .............................................................................................................. 21
4.4 Activity Creation ................................................................................................................ 22
4.5 Logging ............................................................................................................................. 23
4.6 Mark Done from Salesforce .............................................................................................. 24
4.6.1 WDE Configuration .............................................................................................. 24
4.6.2 Salesforce Configuration ...................................................................................... 25
4.7 Browser Storage ............................................................................................................... 32
5 Customizing Salesforce ..................................................................................... 32
5.1 Classic/Console Mode ...................................................................................................... 32
5.2 Lightning Mode.................................................................................................................. 33
5.3 Custom Message from Workspace to Salesforce............................................................. 33
6 Debugging in a Browser ..................................................................................... 33

7 Packaging .......................................................................................................... 34
7.1 Using Change Sets to Deploy Code ................................................................................. 34
7.2 Using Ant to Deploy Code ................................................................................................. 34

WORKSPACE PLUG-IN FOR SALESFORCE DEVELOPERS GUIDE PAGE 3 OF 36


GENESYS PROFESSIONAL SERVICES

1 Introduction

This document is for software developers interested in customizing the behavior of how the Workspace
Plug-in functions within Salesforce.com Service or Sales Cloud solutions operating in either Classic or
Console modes.

The content of the document is technical and contains terms and procedures that should be familiar to
Salesforce and web Developers. It is strongly recommended that those attempting to work with the Plug-
in are familiar with Salesforce.com development, administration and have a reasonable understanding of
contact/call center agent operations especially those supported by the Genesys Interaction Workspace
and Workspace Desktop Edition (WDE) products.

Please note, the Plug-in is only for use with the workstation installed Workspace product and not
Workspace.Web Edition (WWE).

Due to customer demand, Genesys Professional Services purposely provide the Salesforce components
of the Plug-in as a Salesforce Unmanaged Package allowing their customers to modify the internal
scripts. Typical modifications may include:

• Customized screen pop processing


• Record creation
• Handling of custom object types
• Additional creation of Activity Tasks
• Passing of interaction attributes to specific Visualforce forms
• Custom search forms
• Update of interaction data from Salesforce to Genesys
• Dispositioning with Salesforce

It is important to note that not all the Plug-in is ‘open’ to customer modification. Modifications to the
(Interaction) Workspace Desktop Edition code to add special handling characteristics can only be
performed by contract with Genesys Professional Services. The Workspace components are only
supplied as compiled Dynamic Link Libraries (DLL’s).

There are several techniques for how code development with Salesforce Visualforce, APEX and trigger
code scripts can be performed. Genesys recommends that Developers use the Salesforce Force IDE
plug-in to Eclipse. More information on the Force IDE method can be found at:

https://developer.salesforce.com/page/Force.com_IDE

A statement on upgrades. From time to time either through maintenance or software feature updates, an
upgrade may be requested from Genesys. Genesys Professional Services reserve the right to modify the
core code within the Plug-in to repair defects or add features. If an implemented version of the Plug-in
has been modified, re-introduction of those modifications will be necessary and Genesys Professional
Services cannot guarantee how those modifications used the code sequencing in the Plug-in shall remain
consistent. All modifications to the Workspace Plug-in for Salesforce code are performed at risk and
therefore it is recommended that Genesys-code modifications are kept to a minimum and large code
processing is moved to alternative scripts.

1.1 About the Workspace Plug-in for Salesforce

The software is designed to automate interaction handling between the Genesys Workspace and
Salesforce.com. Information from an IVR, external systems or routing strategies can be used by
Salesforce to screen pop records or create tasks. The features are bi-directional, so operations in
Salesforce can drive actions in Genesys Workspace such as dialing a number or adding new data
elements to an existing interaction.

WORKSPACE PLUG-IN FOR SALESFORCE DEVELOPERS GUIDE PAGE 4 OF 36


GENESYS PROFESSIONAL SERVICES

The Workspace Plug-in for Salesforce supports most media channels of the Workspace product
including:

• Inbound Voice
• Outbound Voice (predictive, progressive and preview modes)
• Genesys email
• Genesys web chat
• SMS
• iWD tasks
• Social Engagement

Genesys Professional Services perform customer development on the Plug-in and therefore do test
functionality as new versions of Salesforce are released (3 per year – Spring, Summer and Winter).

Like Salesforce, the browsers supported by the Workspace Plug-in for Salesforce include Chrome,
Internet Explorer and Firefox but only on the Windows platform since Genesys Workspace is a .NET
application. There is no recommendation which browser the developer should use and the selection tends
to be a developer selection.

1.2 How the Software Works

It is of value for the developer to understand the high-level concept of how the Plug-in functions to
support their design interests. The following diagram represents the architecture of the Plug-In.

The Genesys Workspace is customized to implement an HTTP Listener that also supports TLS 1.1
protocol. Interaction behaviors are also customized to send state change and supporting data to HTTP
requests that are waiting against the listener. These waiting HTTP requests are sent from an Open CTI
implementation of the Plug-in within Salesforce installed via the Workspace Plug-in unmanaged package
as described in the Plug-in’ Deployment Guide. Therefore, you can consider that Salesforce is polling the
Workspace software looking for work to be performed. This poll operation is a long-poll and will return
immediately to Salesforce to trigger an action on state change receipt by the HTTP listener. Polling
between Salesforce and Workspace is performed within the user workstation between the Salesforce
browser and the Workspace software, no communication leaves the workstation in support of this
operation.

WORKSPACE PLUG-IN FOR SALESFORCE DEVELOPERS GUIDE PAGE 5 OF 36


GENESYS PROFESSIONAL SERVICES

At the same time, if there is a Salesforce request such as a click-to-dial, these are sent as supplemental
messages to Workspace and received by the HTTP listener and processed immediately.

Information exchanged between Workspace and Salesforce or vice-versa is in JSON format and where
appropriate includes all the attached data (key-value pairs) of the interaction. Note all interaction
attributes are sent to Salesforce. Please see the related information for each message type for the data
properties communications. Each message contains an ‘action’ attribute which is used by the receiving
code to dispatch to the function in support of its handling.

1.2.1 Classic/Console Model

From the perspective of the JavaScript code model implemented within Salesforce, the representation of
this handling for Classic/Console is as follows:

Salesforce Components for Classic/Console Modes

Supporting the operation of the Plug-in are APEX classes and Visualforce pages. These are as follows:

Component Type Purpose


g_ContactWrapper APEX Class Used for sorting Contact lookup results for custom
search
g_CustomCaseLookupController APEX Class Performs search within Salesforce for Cases
g_CustomLookupController APEX Class Performs search within Salesforce for Accounts,
Cases and Leads
g_WorkspaceConnectorController APEX Class Performs activity creation and searches for screen pop
processing
g_CustomCaseLookup Visualforce Custom lookup for a Case
Page

WORKSPACE PLUG-IN FOR SALESFORCE DEVELOPERS GUIDE PAGE 6 OF 36


GENESYS PROFESSIONAL SERVICES

g_CustomLookup Visualforce Custom lookup for an Account, Contact or Lead


Page
g_WorkspaceConnector Visualforce Main page for the Connector. This is used in the Call
Page Center definition URL for startup.

Each APEX class has a corresponding Test Class. Any updates to an APEX class may require an update
to the corresponding Test Class. Salesforce requires 75% code coverage before a package can be built.

A call center definition file specifies a set of fields and values that are used to define a call center
in Salesforce. The Plug-in uses this to define information needed for operation. Users will need to be
assigned to this Call Center to access the Plug-in.

Importing the Call Center xml for Classic/Console yields the following results:

The Plug-in will read these values using:

sforce.interaction.cti.getCallCenterSettings

WORKSPACE PLUG-IN FOR SALESFORCE DEVELOPERS GUIDE PAGE 7 OF 36


GENESYS PROFESSIONAL SERVICES

1.2.2 Lightning Model

The JavaScript code model implemented within Salesforce for Lightning is as follows:

Salesforce Components for Lightning Mode

Supporting the operation of the Plug-in are APEX classes and Visualforce pages. These are as follows:

Component Type Purpose


gl_ContactWrapper APEX Class Used for sorting Contact lookup results for custom
search
gl_CustomCaseLookupController APEX Class Performs search within Salesforce for Cases
gl_CustomLookupController APEX Class Performs search within Salesforce for Accounts,
Cases and Leads
gl_WorkspaceConnectorController APEX Class Performs activity creation and searches for screen pop
processing
gl_CustomCaseLookup Visualforce Custom lookup for a Case
Page
gl_CustomLookup Visualforce Custom lookup for an Account, Contact or Lead
Page
gl_WorkspaceConnector Visualforce Main page for the Connector. This is used in the Call
Page Center definition URL for startup.

Like Classic/Console modes, each APEX class has a corresponding Test Class. Any updates to an APEX
class may require an update to the corresponding Test Class. Salesforce requires 75% code coverage
before a package can be built.

WORKSPACE PLUG-IN FOR SALESFORCE DEVELOPERS GUIDE PAGE 8 OF 36


GENESYS PROFESSIONAL SERVICES

In Lightning mode, as well, a call center definition file specifies a set of fields and values that are used to
define a call center in Salesforce. The Plug-in uses this to define information needed for operation. Users
will need to be assigned to this Call Center to access the Plug-in.

Importing the Call Center xml for Lightning yields the following results:

The Plug-in will read these values using:

sforce.opencti.getCallCenterSettings

WORKSPACE PLUG-IN FOR SALESFORCE DEVELOPERS GUIDE PAGE 9 OF 36


GENESYS PROFESSIONAL SERVICES

2 Documentation

The following documentation references may be useful for specific development requirements

2.1 Salesforce Developer Documentation

These documents are released consistent with Salesforce releases, therefore it is best to perform a web
search for the latest versions.

• Open CTI Developer’s Guide – Provides API definitions and examples for CTI functionality in
Salesforce that are used in the Plug-in.
• Salesforce Console Integration Toolkit Developer’s Guide - Provides API definitions for
Console manipulations used in the Plug-in.
• Soap API Developer’s Guide – The Standard Objects section provides a list of standard objects
and their standard fields.

2.2 Genesys Technical Documentation


Use your login and password to access Genesys documentation to learn more about the Genesys
Workspace and the Omnichannel platform.

WORKSPACE PLUG-IN FOR SALESFORCE DEVELOPERS GUIDE PAGE 10 OF 36


GENESYS PROFESSIONAL SERVICES

3 Communication

3.1 Communication Protocol Between Workspace and Salesforce


Communication is done using an HTTP or HTTPS listener in Workspace and an HTTP or HTTPS client in
the Plug-in using “localhost” as the domain name, which typically refers to the address 127.0.0.1. One
dedicated port is required for communication between Workspace and Salesforce. This port acts as a poll
to verify connectivity as well as a request/response communication. The port is configurable in the
Salesforce Call Center definition. Additionally, the Call Center definition can be set to use 127.0.0.1
instead of “localhost”. Using HTTPS requires installing certificates. Please refer to Workspace Plug-in for
Salesforce Certificate Creation and Installation on how to create and install self-signed certificates on
localhost.

3.2 Communication Method Within Salesforce


Other Visual Force pages can send a custom request to the Plug-in. There are two methods available,
depending upon whether the Plug-in is running in Console mode or Classic and Lightning mode.

3.2.1 [action] Request Template

The Plug-in is expecting an action request using JSON string in the following format:

{"action":"action","actionData":{"key":"value","key ":" value"}}

Where
• action is the action to be performed
• key is the data key and value is the data value
• If the action will be done in relation to a specific active interaction, then one of the key
must be “id” and the value must be the interaction id
• Any number of key/value pairs may be present

3.2.1.1 Console Mode


The Plug-in sets up an event listener via this method:

sforce.console.addEventListener('CTIEvent', receiveSFMessage);

The receiveSFMessage is the JSON string explained above.

3.2.1.2 Classic Mode

The Plug-in sets up a Window event listener via this method:

window.addEventListener('message', receiveWindowMessage, false);

The receiveWindowMessage is the JSON string explained above.

WORKSPACE PLUG-IN FOR SALESFORCE DEVELOPERS GUIDE PAGE 11 OF 36


GENESYS PROFESSIONAL SERVICES

3.2.1.3 Lightning Mode


The Plug-in sets up a Window event listener via this method:

window.addEventListener('message', receiveWindowMessage, false);

The receiveWindowMessage is the JSON string explained above.

3.2.2 AttachData Request

This section specifically provides the communication when a Visual Force page requests to attach data to
an active Genesys interaction. The Plug-in is expecting a JSON string in the following format:

{"action":"AttachData","actionData":{"key":"value","key ":" value"}}

Where
• KVP key is the attached data key and KVP value is the attached data value
• One of the KVP key must be “id” and the KVP value must be the interaction id to attach
the data to
• Any number of key/value pairs may be present

Example:

{"action":"AttachData","actionData":{"sfdcObjectType":"Contact","id":"0371D42J52U02006"}}

3.2.2.1 Console Mode


To request to attach data from inside the Service Cloud Console:

ctiMessageAsJSON =
‘{"action":"AttachData","actionData":{"sfdcObjectType":"Contact","id":"0371D42J52U02006"}}‘;
sforce.console.fireEvent('CTIEvent', ctiMessageAsJSON, function (result) {
console.log("CTIEvent fired result: " + result); });

3.2.2.2 Classic Mode

With Classic mode, currently, Salesforce has not applied an ID to the iframe and therefore it cannot be
found under usual JavaScript element location techniques. Therefore, it is not possible to use
postMessage() javascript inter-frame messaging techniques to communicate from a Salesforce record
page to the plug-in. As a replacement, session storage can be used for storing and accessing data.

3.2.2.3 Lightning Mode


With Lightning Experience similar to Classic mode, Salesforce has not applied an ID to the iframe and
therefore it cannot be found under usual JavaScript element location techniques. Therefore, it is not
possible to use postMessage() javascript inter-frame messaging techniques to communicate from a
Salesforce record page to the plug-in. As a replacement, session storage can be used for storing and
accessing data.

WORKSPACE PLUG-IN FOR SALESFORCE DEVELOPERS GUIDE PAGE 12 OF 36


GENESYS PROFESSIONAL SERVICES

3.3 Messaging

3.3.1 Messages from Salesforce to WDE

There are two types of messages that Salesforce will send to Workspace – either a “poll” message or a
“request” message. All messages are in JSON format.

3.3.1.1 Poll Message


Message from Salesforce to Workspace to keep the connection open:
https://127.0.0.1:5050/poll={"CI":"1457294838170a"}?callback=jQuery1102019485390395857394_14572
94838164&_=1457294838172

3.3.1.2 Request Message

Request messages going from Salesforce to Workspace will contain the followings:

• action = request to Workspace


o AttachData
o ConnectionRequest
o Dial
o GetData
o RequestAttachment
o FocusChanged
• actionData = information relevant to executing the request
• CI = Connection Indicator, used to identify which Salesforce instance has sent the message so
that only one connection is allowed between Workspace and Salesforce
• Genesys interaction id (if the request is related to an interaction, e.g. RequestAttachment

3.3.1.2.1 AttachData
Request message from Salesforce to Workspace to attach data contained within “actionData” to the
interaction identified by “id”.

https://127.0.0.1:5050/?callback=jQuery1102019485390395857394_1457294838455&/request={"action":
"AttachData","CI":"1457294838170a","actionData":{"sfdcObjectId":"500F000000YwTd4IAF","id":"010A027
D61D4A004"}}&_=1457294838456

Response from Workspace is:


jQuery110205944839925505221_1413475948820({"action":"Complete"})

3.3.1.2.2 ConnectionRequest
Request message from Salesforce to Workspace to establish a connection when Salesforce Plug-in is
initiated. PollInterval is a Call Center field (Poll Queue Timeout) that tells Workspace how long Salesforce
waits before sending a poll message after Salesforce receives any message from Workspace. It is used
to determine when that connection can be deemed as no longer active and a new connection can be
accepted.
This message is sent at a specified interval in a Call Center field (Request Timeout) until Workspace will
respond with either a ConnectionAccepted or ConnectionDenied.

https://127.0.0.1:5050/?callback=jQuery1102019485390395857394_1457294838164&/request={"action":
"ConnectionRequest","actionData":{},"pollInterval":"100","CI":"1457294838170a"}&_=1457294838165

WORKSPACE PLUG-IN FOR SALESFORCE DEVELOPERS GUIDE PAGE 13 OF 36


GENESYS PROFESSIONAL SERVICES

Response from Workspace when the connection is accepted:


jQuery1102019485390395857394_1457294838164
({"action":"ConnectionAccepted","CI":"1457294838170a","monitorSFDCSession":"true"})

Response from Workspace when connection is rejected:


jQuery1102019485390395857394_1457294838164
({"action":"ConnectionDenied","CI":"1457294838170a"})

3.3.1.2.3 Dial
Request message from Salesforce to Workspace when Click-to-Dial functionality is used within
Salesforce. This causes an outgoing call to be initiated.
https://127.0.0.1:5050/?callback=jQuery1102019485390395857394_1457294838455&/request={"action":
"Dial","CI":"1457294838170a","actionData":{"number":"5115","sfdcObjectId":"00QF000000aCp65"}}&_=14
57294838875

Response from Workspace is:


jQuery1102019485390395857394_1457294838455({"action":"Complete"})

3.3.1.2.4 GetData
Request message from Salesforce to Workspace to retrieve specific Genesys Configuration data as
specified by “data”. This message is sent after a ConnectionAccepted message is received from
Workspace.
https://127.0.0.1:5050/?callback=jQuery1102019485390395857394_1457294838164&/request={"action":
"GetData","CI":"1457294838170a","actionData":{"data":"data-display-attribute"}}&_=1457294838166

Response from Workspace is:


jQuery110205944839925505221_1413475948820({"action":"DataRetrieved","CI":"1413475948740a","acti
onData":{"autoOpen":"true","data-display-attribute": [{"Name":"CONTACT_ID","DisplayName":"CONTACT
ID","order":"1"},{"Name":"FirstName","DisplayName":"First Name","order":"1"}]}})

3.3.1.2.5 RequestAttachment
Request message from Salesforce to Workspace to get email attachment(s) as specified in the
CreateActivity request from Workspace. For each attachment, a separate RequestAttachment is sent.

https://127.0.0.1:5050/?callback=jQuery1102019485390395857394_1457294838455&/request={"action":
"AttachData","CI":"1457294838170a","actionData":{"sfdcObjectId":"500F000000YwTd4IAF","id":"010A027
D61D4A004"}}&_=1457294838456

Response from Workspace is the actual data of the attachment.

3.3.1.2.6 FocusChanged
Request message from Salesforce to Workspace to on focus change. Response from Workspace is the
actual data of the attachment.
{"action":"FocusChanged","CI":"1497629959403a","actionData":{"sfdcObjectId":"00T6A000004mrJr"}}

3.3.2 Messages from WDE to Salesforce


Messages going from Workspace to Salesforce will contain the following:
• action = request to Salesforce
o Complete
o ConnectionAccepted
o ConnectionDenied
o CreateActivity
o DataRetrieved
o NoWork
o OpenObject

WORKSPACE PLUG-IN FOR SALESFORCE DEVELOPERS GUIDE PAGE 14 OF 36


GENESYS PROFESSIONAL SERVICES

o PerformSFDCRequest

Sections below discuss each scenario and their usage.

3.3.2.1 Complete
Response Message from WDE to Salesforce at the completion of actions such as AttachData or Dial from
Salesforce,
jQuery110205944839925505221_1413475948820({"action":"Complete"})

3.3.2.2 ConnectionAccepted
Response Message from WDE to Salesforce for ConnectionRequest action if connection is established.
jQuery1102019485390395857394_1457294838164
({"action":"ConnectionAccepted","CI":"1457294838170a","monitorSFDCSession":"true"})

3.3.2.3 ConnectionDenied
Response Message from WDE to Salesforce for ConnectionRequest action if connection request fails.
jQuery1102019485390395857394_1457294838164
({"action":"ConnectionDenied","CI":"1457294838170a"})

3.3.2.4 CreateActivity
Message from Workspace to Salesforce sent to create an activity of type Task when the Interaction is
accepted or marked done. If the activity is created at accept, a second CreateActivity request will be sent
at marked done to update the existing activity with the latest information. All user data is sent in
“userData”.
jQuery110205944839925505221_1413475948820({"action":"CreateActivity","id":"010A02535DC79007","
source":"5115","destination":"8207","OtherDN":"5115","type":"Voice","Media_Type":"Voice","calltype":"Inb
ound","notes":"","epochTime":0,"reason":"MarkedDone","dispositionCode":"","duration":"00:07:04.326000
0","userData":{"ServiceType":"default","ServiceObjective":"","PegAG?:Customer_Service
>10":1,"ContactId":"0008Va76MGEC000Q","sfdcObjectId":"003o0000005iPGuAAM","id":"010A02535DC7
9007"}})

All attribute data is sent in “attributeData”.


"attributeData":{"IDataSupport.ConnID":{},"IDataSupport.CustomerID":"Environment","IDataSupport.Event
SequenceNumber":58588,"IDataSupport.ReferenceID":7,"IDataSupport.ThisDN":"7001","IDataSupport.Th
isQueue":"9998",
"IDataSupport.UserData":{"RTargetAgentSelected":"KSippola","RTargetPlaceSelected":"SIP_Server_Plac
e1","RTenant":"Environment","RStrategyName":"ConnectorToCustomerService","ServiceType":"default","
ServiceObjective":"","PegAGCustomer_Service":1},"IDataSupport.CallType":2,"IDataSupport.Propagated
CallType":2,"IDataSupport.OtherDNRole":1,"IDataSupport.AgentID":"SIP1","IDataSupport.Time":{"IDataS
upport.TimeinuSecs":786000,"IDataSupport.TimeinSecs":1470330225},"IDataSupport.DNIS":"9998","IDat
aSupport.CallUuid":"ROUIO07VEP4IRCNFTCE2EP0IBG00002D","IDataSupport.ANI":"5125","IDataSupp
ort.CallID":77,"IDataSupport.CallState":0,"IDataSupport.Extensions":{"BusinessCall":1,"WrapUpTime":15}
,"IDataSupport.ThisDNRole":2,"IDataSupport.OtherDN":"5125","EndpointValue":{"IsUndefined":false,"Na
me":"SIP_Server","Uri":"tcp://demosrv.genesyslab.com:7004/","Host":"demosrv.genesyslab.com","Port":7
004,"IsWildCard":false,"ServicePrincipalName":null}},

3.3.2.5 DataRetrieved
Response Message from WDE to Salesforce for GetData action:
Response from Workspace is:
jQuery110205944839925505221_1413475948820({"action":"DataRetrieved","CI":"1413475948740a","acti
onData":{"autoOpen":"true","data-display-attribute": [{"Name":"CONTACT_ID","DisplayName":"CONTACT
ID","order":"1"},{"Name":"FirstName","DisplayName":"First Name","order":"1"}]}})

WORKSPACE PLUG-IN FOR SALESFORCE DEVELOPERS GUIDE PAGE 15 OF 36


GENESYS PROFESSIONAL SERVICES

3.3.2.6 NoWork
Message from Workspace to Salesforce when there is no message in the queue:
jQuery1102019485390395857394_1457294838164({"action":"NoWork"})

3.3.2.7 OpenObject
Message from Workspace to Salesforce sent when the Interaction is accepted. All user data is sent in
“userData”.
jQuery110205944839925505221_1413475948736({"action":"OpenObject","id":"010A02535DC79007","so
urce":"5115","destination":"8207","OtherDN":"5115","type":"Voice","calltype":"Inbound","role":"RoleDestina
tion","epochTime":0,"reason":"Established","userData":{"ServiceType":"default","ServiceObjective":"","Peg
AG?:Customer_Service >10":1,"ContactId":"0008Va76MGEC000Q"}})

All attribute data is sent in “attributeData”.


"attributeData":{"IDataSupport.ConnID":{},"IDataSupport.CustomerID":"Environment","IDataSupport.Event
SequenceNumber":58588,"IDataSupport.ReferenceID":7,"IDataSupport.ThisDN":"7001","IDataSupport.Th
isQueue":"9998",
"IDataSupport.UserData":{"RTargetAgentSelected":"KSippola","RTargetPlaceSelected":"SIP_Server_Plac
e1","RTenant":"Environment","RStrategyName":"ConnectorToCustomerService","ServiceType":"default","
ServiceObjective":"","PegAGCustomer_Service":1},"IDataSupport.CallType":2,"IDataSupport.Propagated
CallType":2,"IDataSupport.OtherDNRole":1,"IDataSupport.AgentID":"SIP1","IDataSupport.Time":{"IDataS
upport.TimeinuSecs":786000,"IDataSupport.TimeinSecs":1470330225},"IDataSupport.DNIS":"9998","IDat
aSupport.CallUuid":"ROUIO07VEP4IRCNFTCE2EP0IBG00002D","IDataSupport.ANI":"5125","IDataSupp
ort.CallID":77,"IDataSupport.CallState":0,"IDataSupport.Extensions":{"BusinessCall":1,"WrapUpTime":15}
,"IDataSupport.ThisDNRole":2,"IDataSupport.OtherDN":"5125","EndpointValue":{"IsUndefined":false,"Na
me":"SIP_Server","Uri":"tcp://demosrv.genesyslab.com:7004/","Host":"demosrv.genesyslab.com","Port":7
004,"IsWildCard":false,"ServicePrincipalName":null}},

3.3.2.8 PerformSFDCRequest
Message from Workspace to Salesforce sent when a custom request needs to be sent. This method
takes one parameter that must be in a JSON format. Workspace will take that parameter and construct a
request to send to the Salesforce Plug-in.
See Section “Custom Message from Workspace to Salesforce” for details.

WORKSPACE PLUG-IN FOR SALESFORCE DEVELOPERS GUIDE PAGE 16 OF 36


GENESYS PROFESSIONAL SERVICES

3.4 Messaging Sequence

3.4.1 Login
The diagram below displays the login sequence. Request messages are shown in green.

Login to workspace
Create HTTP(S) listener
ConnectionRequest Login to Salesforce
ConnectionAccepted

GetData
DataRetrieved

poll
If msg queue is empty respond
with NoWork msg after sfdc- NoWork
connector.poll-queue-timeout Send next poll after Poll Queue
Timeout (in Call Center definition)
poll
NoWork
:
: Repeat “poll”/”NoWork” cycle

WORKSPACE PLUG-IN FOR SALESFORCE DEVELOPERS GUIDE PAGE 17 OF 36


GENESYS PROFESSIONAL SERVICES

3.4.2 Interaction Handling

The diagram below shows an interaction handling sequence. Request messages are shown in green.

Workspace Salesforce

:
:
poll
Interaction arrives and is accepted
OpenObject msg put in queue and OpenObject
sent Perform Screen pop
Request to attach salesforce
AttachData object Id

Attach data to interaction Complete

poll
NoWork
:
:
poll
Interaction mark done
CreateActivity msg put in queue
and sent CreateActivity
Perform Activity Creation

poll

NoWork
:
:

WORKSPACE PLUG-IN FOR SALESFORCE DEVELOPERS GUIDE PAGE 18 OF 36


GENESYS PROFESSIONAL SERVICES

4 Features

4.1 Screen Pop


When an Interaction is accepted, Workspace sends an OpenObject message to Salesforce. Screen pop
processing is then based on the type of interaction and the data associated with the interaction.

4.1.1 Voice Inbound


1. Case search – executed when “MainMenu” attached data is present
2. Case search – executed when “CaseNumber” attached data is present
3. Salesforce object id – executed when “sfdcObjectId” attached data is present (usually used
for consult/transfer/conference)
4. Custom search of Account, Contact, Lead – executed when “sfdc-connector.voice-sfdc-field”
and “sfdc-connector.voice-sfdc-field-value” attached data is present
5. ANI search of Account, Contact, Lead

If steps 1 or 2 fail to provide a match, then the custom Case Search Visualforce page is screen popped. If
steps 3, 4 or 5 fail to provide a match or provides multiple matches, then the custom Search Visualforce
page is screen popped.

4.1.2 Voice Outbound


1. Salesforce object id – executed when “sfdcObjectId” attached data is present (usually used
for consult/transfer/conference)
2. DNIS search of Account, Contact, Lead

If steps 1 or 2 fail to provide a match or provides multiple matches, then the custom Search Visualforce
page is screen popped.

4.1.3 Email
1. Salesforce object id – executed when “sfdcObjectId” attached data is present (usually used
for consult/transfer/conference)
2. Custom search of Account, Contact, Lead – executed when “sfdc-connector.email-sfdc-field”
and “sfdc-connector.email-sfdc-field-value” attached data is present

If steps 1 or 2 fail to provide a match or provides multiple matches, then the custom Search Visualforce
page is screen popped.

4.1.4 Chat
1. Salesforce object id – executed when “sfdcObjectId” attached data is present (usually used
for consult/transfer/conference)
2. Custom search of Account, Contact, Lead – executed when “sfdc-connector.chat-sfdc-field”
and “sfdc-connector.chat-sfdc-field-value” attached data is present

If steps 1 or 2 fail to provide a match or provides multiple matches, then the custom Search Visualforce
page is screen popped.

4.1.5 Work Item


1. Salesforce object id – executed when “sfdcObjectId” attached data is present (usually used
for consult/transfer/conference)
2. Custom search of Account, Contact, Lead – executed when “sfdc-connector.mediaType-sfdc-
field” and “sfdc-connector.mediaType-sfdc-field-value” attached data is present

WORKSPACE PLUG-IN FOR SALESFORCE DEVELOPERS GUIDE PAGE 19 OF 36


GENESYS PROFESSIONAL SERVICES

If steps 1 or 2 fail to provide a match or provides multiple matches, then the custom Search Visualforce
page is screen popped.

4.1.6 SMS
1. Salesforce object id – executed when “sfdcObjectId” attached data is present (usually used
for consult/transfer/conference)
2. Custom search of Account, Contact, Lead – executed when “sfdc-connector.sms-sfdc-field”
and “sfdc-connector.sns-sfdc-field-value” attached data is present

If steps 1 or 2 fail to provide a match or provides multiple matches, then the custom Search Visualforce
page is screen popped.

4.1.7 Web Callback


1. Salesforce object id – executed when “sfdcObjectId” attached data is present (usually used
for consult/transfer/conference)
2. Custom search of Account, Contact, Lead – executed when “sfdc-connector.webCallback-
sfdc-field” and “sfdc-connector.webcallback-sfdc-field-value” attached data is present

If steps 1 or 2 fail to provide a match or provides multiple matches, then the custom Search Visualforce
page is screen popped.

4.1.8 Open Media


No longer used.

4.1.9 Social
This is not yet supported.

WORKSPACE PLUG-IN FOR SALESFORCE DEVELOPERS GUIDE PAGE 20 OF 36


GENESYS PROFESSIONAL SERVICES

4.2 Data Display


On screen pop of an interaction within Salesforce, the Plug-in can be configured to display specific
attached data. To remove the displayed Attached Data, select the Dismiss button. Once the button is
selected, the display cannot be displayed again. Otherwise, the Attached Data display remains in the
Console app until the next screen pop. This feature is supported for Classic, Console and Lightning
Experience modes.

4.3 Search Capability

WORKSPACE PLUG-IN FOR SALESFORCE DEVELOPERS GUIDE PAGE 21 OF 36


GENESYS PROFESSIONAL SERVICES

There are two custom Visual Force “lookup” pages that perform a search within Salesforce. They are
invoked with the following URLs:

Classic/Console:
apex/g_CustomLookup?lksrch=searchField&ixnId=ixnId&inServiceCloudConsole=value
apex/g_CustomCaseLookup?lksrch=searchField&ixnId=ixnId&inServiceCloudConsole=value

Lightning Experience:
apex/gl_CustomLookup?lksrch=searchField&ixnId=ixnId
apex/gl_CustomCaseLookup?lksrch=searchField&ixnId=ixnId

Where searchField = value to search for


ixnId = Genesys interaction Id
value = either true or false

In each case, once the User selects an object from the “lookup” page, a message is sent to the Plug-in
using sforce.console.fireEvent with ‘CTIEvent’. The message is a JSON string as follows:

{"action":" ObjectSelected ", "id":"salesforceId ","interactionId":"GenesysId }

Where id = object Id of the Salesforce object selected


interactionId = Genesys interaction Id

The Plug-in will take the above message and send this message to Workspace:

{"sfdcObjectId":"salesforceId","id":"interactionId"}

Where sfdcObjectId = object Id of the Salesforce object selected


interactionId = Genesys interaction Id

Here is an example of the final message that would be sent:

{"action":"AttachData","CI":"1457294838170a","actionData":{"sfdcObjectId":"500F000000YwTd4IAF","id":"
010A027D61D4A004"}}

4.4 Activity Creation


Depending on the configuration for each supported media channels, when an Interaction is accepted or
marked done, a Salesforce Activity of type Task is created. Currently these types of interactions create an
Activity:

• Voice
• Email
• Chat
• InteractionWorkItem
• Sms
• Webcallback

WORKSPACE PLUG-IN FOR SALESFORCE DEVELOPERS GUIDE PAGE 22 OF 36


GENESYS PROFESSIONAL SERVICES

4.5 Logging
The Plug-in provides logging functionality within the display. The log file can also be downloaded.

WORKSPACE PLUG-IN FOR SALESFORCE DEVELOPERS GUIDE PAGE 23 OF 36


GENESYS PROFESSIONAL SERVICES

4.6 Mark Done from Salesforce


Code is included to process a Mark Done message from Salesforce to Workspace. Instead of selecting
the Done from Workspace, a message can be sent from Salesforce to initiate the Done processing. In
addition, Call Disposition and Notes from Salesforce could be included in the Mark Done message.

4.6.1 WDE Configuration

To enable Mark Done we need to do configuration changes for Activity to be created at time of voice
release instead of at Mark Done. The following WDE configuration is provided to do this:

sfdc-connector.voice- If value is true, an Activity true or false


create-activity-on-release will be created at release
instead of Mark Done. Default value false
sfdc-connector.use-sf- If sfdc-connector.voice- true or false
disposition-on-release create-activity-on-release is
true and sfdc- Default value false
connector.use-sf-disposition-
on-release is true, then use
“reason” from Saleforce
message to set interaction
Disposition
sfdc-connector.use-sf- If sfdc-connector.voice- true or false
notes-on-release create-activity-on-release is
true and sfdc- Default value false
connector.use-sf-notes-on-
release is true, then use
“description” from Saleforce
message to set interaction
Notes

The following code behind the custom Mark Done button is required. “reason” is only processed by
Workspace if the above configuration sfdc-connector.use-sf-disposition-on-release is set to true.

WORKSPACE PLUG-IN FOR SALESFORCE DEVELOPERS GUIDE PAGE 24 OF 36


GENESYS PROFESSIONAL SERVICES

“description” is only processed by Workspace if the above configuration sfdc-connector.use-sf-notes-on-


release is set to true. sfdc-connector.voice-create-activity-on-release must also be set to true.

4.6.2 Salesforce Configuration

4.6.2.1 Classic
This feature is currently not available in Classic

4.6.2.2 Console
The JSON string to use is:
{"action":"MarkDone","actionData": { reason":"disposition,"description":"notes"}}

Where disposition= text of desired disposition; this is optional


notes = text of desired notes; this is optional

An example of using this message would be to put a custom button on the Activity page.

Note: After Salesforce Spring 17 release, With Classic, Salesforce have not applied an ID to the iframe
and therefore it cannot be found under usual JavaScript element location techniques. As the iframe
cannot be located, it is not possible to use postMessage() javascript inter-frame messaging techniques to
communicate from a Salesforce record page to the plug-in. This document will be updated as new
solution provided by Salesforce. Therefore, this feature is currently not provided for Classic.

var message = {
action: 'MarkDone',
actionData: {
sfdcObjectType:"Task",
id:"{!Task.CallObject}",
reason:"{!Task.CallDisposition}",
description:"{!Task.Description}"
}

};

var ctiMessageAsJSON = JSON.stringify(message);

if (sforce.console.isInConsole()) {
sforce.console.fireEvent('CTIEvent', ctiMessageAsJSON);
}

WORKSPACE PLUG-IN FOR SALESFORCE DEVELOPERS GUIDE PAGE 25 OF 36


GENESYS PROFESSIONAL SERVICES

4.6.2.3 Lightning

An example of using this message would be to put an Action Link on the Activity page.

An example of How to create Action link in lightening using the Lightning Mark Done Component.

1. Need to select the Button, links, and Action of Task object from Object Manager and create New
Action as below mentioned.

WORKSPACE PLUG-IN FOR SALESFORCE DEVELOPERS GUIDE PAGE 26 OF 36


GENESYS PROFESSIONAL SERVICES

Update the page layout of Task and add the Mark Done button from the salesforce1 & Lightning
Experience and drag and drop into Lightning section and save the layout.

Lightning Aura Component Bundle Development

Using Eclipse Force IDE


Note: Modifying aura component through Eclipse Force IDE requires to install the Lightning
Support plug in.

You can create Lightning component using new Lightning Bundle option and follow the wizard as
below.

WORKSPACE PLUG-IN FOR SALESFORCE DEVELOPERS GUIDE PAGE 27 OF 36


GENESYS PROFESSIONAL SERVICES

In the project explorer, you can see the tree structure of the resources as below.

Using Salesforce Developer Console

To Get started with lightning component development using developer console, need to select the New
Lightning Bundle from File menu as below.

WORKSPACE PLUG-IN FOR SALESFORCE DEVELOPERS GUIDE PAGE 28 OF 36


GENESYS PROFESSIONAL SERVICES

Lightning component bundle contains all its related resources as mentioned.

Steps to Enable My Domain to Use Lightning Components

For security purposes, Lightning components now require you to define a custom Salesforce domain
name for your organization.
And if you don’t have My Domain enabled for your organization, your Lightning components will be
disabled when your organization is upgraded to Winter ’16.

Reference :
https://releasenotes.docs.salesforce.com/en-us/winter16/release-notes/rn_lightning_cruc.htm

WORKSPACE PLUG-IN FOR SALESFORCE DEVELOPERS GUIDE PAGE 29 OF 36


GENESYS PROFESSIONAL SERVICES

Search for My Domain in quick search and click on My Domain.

Provide unique domain name and check for availability then register the domain.

After registration, you will get an email for notification to verify the registration process.

WORKSPACE PLUG-IN FOR SALESFORCE DEVELOPERS GUIDE PAGE 30 OF 36


GENESYS PROFESSIONAL SERVICES

Close existing salesforce session and login with the new domain specific salesforce URL and navigate to
My Domain for further action where we need to deploy the domain to all user by click of Deploy to Users.

Now with this screen we are ready to go with the lightning component of My Domain enablement.

WORKSPACE PLUG-IN FOR SALESFORCE DEVELOPERS GUIDE PAGE 31 OF 36


GENESYS PROFESSIONAL SERVICES

4.7 Browser Storage


When running the Plug-in in Classic mode, any time a new tab is selected, or a new Salesforce object is
displayed, a refresh of the browser is automatically done by Salesforce. This causes a restart of the Plug-
in and local data is lost. Therefore, the Plug-in uses window.sessionStorage to store data to be
available when the Plug-in restarts. This data is available until the browser is closed. The following data is
saved:
• Genesys_sfdc_CI
• Genesys_sfdc_interactionId
• Gensesys_sfdc_objecIt
• Genesys_sfdc_Banned
• Genesys_activeInteracton

Also available is window.localStorage although the Plug-in currently does not use it.

There are two cookies that are created by the Plug-in.


• wsc_serviceCloudConsoleOnly
• wsc_pollPort

5 Customizing Salesforce

The Salesforce code is organized so that customizations can be performed easily.

5.1 Classic/Console Mode

The Salesforce javascript is divided as follows:


• g_connector_js
Contains initialization code
• g_datapanel_css and g_datapanel_js
Contains code for the data display
• g_default_js
Framework for the Screen Pop and Activity Creation processing
• g_globals_js
localStorage for data
• g_log_js
Controls logging functions
• g_misc_js
Miscellaneous
• g_salesforce_js
Salesforce API calls
• g_version_js
Contains the version number
• g_workspace_js
Communication to/from workspace
• g_wsc_icons
Zip file of icons used by the Plug-in

Most customizations will just require the user to update the code in g_default_js to perform specific tasks.
It may be desirable to rename g_default_js from its generic name to a more specialized name.
g_version_js should be updated to include the specific version for the customization.

WORKSPACE PLUG-IN FOR SALESFORCE DEVELOPERS GUIDE PAGE 32 OF 36


GENESYS PROFESSIONAL SERVICES

5.2 Lightning Mode


The Salesforce javascript is divided as follows:
• gl_connector_js
Contains initialization code
• gl_datapanel_css and gl_datapanel_js
Contains code for the data display
• gl_default_js
Framework for the Screen Pop and Activity Creation processing
• gl_globals_js
localStorage for data
• gl_log_js
Controls logging functions
• gl_misc_js
Miscellaneous
• gl_salesforce_js
Salesforce API calls
• gl_version_js
Contains the version number
• gl_workspace_js
Communication to/from workspace
• gl_wsc_icons
Zip file of icons used by the Plug-in

Most customizations will just require the user to update the code in gl_default_js to perform specific tasks.
It may be desirable to rename gl_default_js from its generic name to a more specialized name.
gl_version_js should be updated to include the specific version for the customization.

5.3 Custom Message from Workspace to Salesforce


There is an API available within Workspace that sends any custom request from Workspace to
Salesforce. Details of the API are as follows:
processSFDCRequest(String request)
request parameter must be in JSON format
The method will take the request parameter and append it to the message that will be sent to Salesforce.
For example, if
request = "agentEvent":"NotReady"
then this message will be sent to Salesforce:
{"action":"PerformSFDCRequest"," agentEvent ":" NotReady "}
Salesforce will receive the request and process it in g_default_s javascript file.
if (obj.action == 'PerformSFDCRequest') {
_log("PerformSFDCRequest");
}

The user must then add code to the g_default_s javascript file in Classic/Console or gl_default_s
javascript in Lightning mode to process the request.

6 Debugging in a Browser

To view logs from the Apex classes in Salesforce (Browser Independent):


• Click on “Setup”

WORKSPACE PLUG-IN FOR SALESFORCE DEVELOPERS GUIDE PAGE 33 OF 36


GENESYS PROFESSIONAL SERVICES

• Under “Monitor”, expand “Logs”


• Click on “Debug Logs”
• choose your Salesforce User and select “Save”
New Logs will show up under the “Debug Logs” section below

To view logs from the Apex classes in Developer Console (Browser Independent):
• Click the drop down under your user name
• Click on “Developer Console”
• Click on the log you wish to view from the “Logs” tab

To debug static resources in IE:


• Open Developer Tools in your browser(F12)
• Under Debugger (Ctrl+3) select g_WorkspaceConnector or gl_WorkspaceConnector and open
the resource file
• Place breakpoints( F9)

To debug static resources in Chrome:


• Open Developer Tools in your browser(Shift+Ctrl+I)
• Under Sources expand c.***.visual.force.com
• Expand resource and choose the static resource file to open
• Place breakpoints

7 Packaging

If a Salesforce package is used for load delivery, keep in mind that Salesforce automatically pulls in all
custom data that is referenced by the APEX classes. This may cause an error when trying to import this
package because.

There are a couple of alternatives to importing the Salesforce package.

7.1 Using Change Sets to Deploy Code


Salesforce provides a procedure using Change Sets to deploy code. The package needs to be installed in
a Salesforce org that does not already have the custom data definitions. Then follow the procedure
outlined by Salesforce for creating the Change Sets and then moving only those components into the
target Salesforce org.

7.2 Using Ant to Deploy Code

If not using ForceIDE, it may be preferred to use ANT to deploy code, the following describes the steps to
perform this process.

1. Download version 1.6 of ant from the apache website


(http://archive.apache.org/dist/ant/binaries/apache-ant-1.6.0-bin.zip)
2. Unzip the zip from step #1 onto your computer.
3. Set the following environment variables
a. ANT_HOME - this should point to the location from step #2

WORKSPACE PLUG-IN FOR SALESFORCE DEVELOPERS GUIDE PAGE 34 OF 36


GENESYS PROFESSIONAL SERVICES

b. Path - add ;%ANT_HOME%/bin to the end of your Path


c. JAVA_HOME - ensure that this is configured to point to your JDK
4. Edit the Package Alternative/build.properties file to set the following parameters
a. sf.username - your Salesforce user name
b. sf.password – your password, or if you are using a security token this is your password
followed by your security token
c. sf.serverurl – the url to use for login to salesforce
5. Open a command window in the Package Alternative folder
6. Run the command “ant deployZip”

<End of steps for customer>

The zip file that is used in the above package is created by running the command “ant build” from the src
directory of the project and would use a simple build.xml like the one below to copy the contents of the src
directory to a zip file.

<?xml version="1.0" encoding="UTF-8"?>


<project name="package-alternative" default="zip" basedir=".">

<target name="build">
<delete file="..\..\Package\Salesforce Components\Package
Alternative\${ant.project.name}.zip" />
<zip destfile="..\..\Package\Salesforce Components\Package
Alternative\${ant.project.name}.zip"
update="true"
basedir="."
excludes="build.xml"
/>
</target>
</project>

The above package requires that the customer already have all the custom objects and fields that are
referenced by the code. You can either modify the above build.xml file to produce that information for
clean test environments, or create a very simple script to collect this information from an existing
environment and build a package to add any missing custom objects/fields.
Using the command “ant retrievePkg” and following build.xml file you can retrieve the contents of a
package, edit the package.xml and use it to deploy any custom objects you need for a clean environment.

<project name="Sample usage of Salesforce Ant tasks" default="test" basedir="."


xmlns:sf="antlib:com.salesforce">
<property file="build.properties"/>
<property environment="env"/>
<!-- Setting default value for username, password and session id properties to empty string
so unset values are treated as empty. Without this, ant expressions such as ${sf.username}
will be treated literally.
-->
<condition property="sf.username" value=""> <not> <isset property="sf.username"/> </not>
</condition>
<condition property="sf.password" value=""> <not> <isset property="sf.password"/> </not>
</condition>
<condition property="sf.sessionId" value=""> <not> <isset property="sf.sessionId"/> </not>
</condition>
<taskdef resource="com/salesforce/antlib.xml" uri="antlib:com.salesforce">
<classpath>
<pathelement location="../ant-salesforce.jar" />
</classpath>
</taskdef>

WORKSPACE PLUG-IN FOR SALESFORCE DEVELOPERS GUIDE PAGE 35 OF 36


GENESYS PROFESSIONAL SERVICES

<target name="retrievePkg">
<mkdir dir="retrieveOutput"/>
<sf:retrieve username="${sf.username}" password="${sf.password}"
serverurl="${sf.serverurl}" maxPoll="${sf.maxPoll}" retrieveTarget="retrieveOutput"
packageNames="${sf.pkgName}"/>
</target>
</project>

WORKSPACE PLUG-IN FOR SALESFORCE DEVELOPERS GUIDE PAGE 36 OF 36

You might also like