Creating a Source
First download the consumer file and place it into the WEB-INF/consumers directory of your Task application and then restart the web server.
To use the consumer, navigate to the Sources page (underneath the Admin tab) and click Add New Source. When creating a source, the type field essentially tells Kinetic Task which consumer file to use for that source.
Now that we have created a Salesfroce source we will be able to develop trees that refer to Salesforce-specifc information like Salesforce task data.
Configuring an Outbound Message
To have Salesforce run our Task Trees we need to use workflow rules with outbound messages. Outbound messages can call the Task API whenever certain events occur (based on the workflow rules) and they will pass information about those events to Task as well.
Stat by expanding the Create link on the left navigation bar.
Then expand the Workflow & Approvals link.
Finally, click the Workflow Rules link.
Shown below is the workflow rules page. To add a new workflow rule click the New Rule button in the middle of the table header.
Here we select an Object for the rule. Select the Task object from the dropdown. This is the only Salesforce object that this source supports.
Fill out the Rule Name field and for the Rule Criteria choose whatever you would like. Keep in mind that this determines when the Salesforce application will call the Task API.
Now we can add the workflow action. In the dropdown highlighted below select the Outbound Message action.
The two important fields on this form are Endpoint URL and Task fields to send. Endpoint URL tells Salesforce where to send the data, which should be the API route of the Task Tree we wish to run. The API routes use the following format.
Given the source "Salesforce Task", the source group "Test", and the tree name "Create" we would use the following API route.
For Task fields to send simply add all of the fields. Then click the Save button in the top right corner.
Then save the workflow rule by clicking Done in the top right corner.
Now that we have configured a workflow rule with an outbound message, Salesforce will call the Task API to run a tree whenever the workflow criteria are met.
When the Salesforce outbound message calls the Task API it passes along a JSON string of data. In Task this is referred to as Source Data. The consumer then parses the source data and provides the menu of pre-defined values available within the Tree Builder. An example of the pre-defined values menu is shown on the right.
In the Pre-defined Values section below we describe each of the pre-defined values made available by the Salesforce source.
The Example Source Data section gives an example of real source data that was posted to Kinetic Task from Salesforce.
|Created By Id|
|Last Modified By Id|
|Last Modified Date|
|Reminder Date Time|
Example Source Data
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soapenv:Body> <notifications xmlns="http://soap.sforce.com/2005/09/outbound"> <OrganizationId>00Di0000000aUOyEAM</OrganizationId> <ActionId>04ki0000000CeGbAAK</ActionId> <SessionId xsi:nil="true" /> <EnterpriseUrl>https://na15.salesforce.com/services/Soap/c/30.0/00Di0000000aUOy</EnterpriseUrl> <PartnerUrl>https://na15.salesforce.com/services/Soap/u/30.0/00Di0000000aUOy</PartnerUrl> <Notification> <Id>04li00000095DLXAA2</Id> <sObject xmlns:sf="urn:sobject.enterprise.soap.sforce.com" xsi:type="sf:Task"> <sf:Id>00Ti000001KY9bHEAT</sf:Id> <sf:ActivityDate>2015-01-15</sf:ActivityDate> <sf:CreatedById>005i0000000ThFyAAK</sf:CreatedById> <sf:CreatedDate>2015-01-15T22:08:30.000Z</sf:CreatedDate> <sf:Description>Comments are here</sf:Description> <sf:IsArchived>false</sf:IsArchived> <sf:IsClosed>false</sf:IsClosed> <sf:IsDeleted>false</sf:IsDeleted> <sf:IsRecurrence>false</sf:IsRecurrence> <sf:IsReminderSet>true</sf:IsReminderSet> <sf:LastModifiedById>005i0000000ThFyAAK</sf:LastModifiedById> <sf:LastModifiedDate>2015-01-15T22:08:30.000Z</sf:LastModifiedDate> <sf:OwnerId>005i0000000ThFyAAK</sf:OwnerId> <sf:Priority>Normal</sf:Priority> <sf:ReminderDateTime>2015-01-15T14:00:00.000Z</sf:ReminderDateTime> <sf:Status>In Progress</sf:Status> <sf:Subject>Triggering Task</sf:Subject> <sf:SystemModstamp>2015-01-15T22:08:30.000Z</sf:SystemModstamp> <sf:Type>Call</sf:Type> </sObject> </Notification> </notifications> </soapenv:Body> </soapenv:Envelope>