Skip to main content
Kinetic Community

Salesforce Task Source

Salesforce allows the creation of custom work flow rules. One workflow action type is the outbound message. We can use these outbound messages to call the Kinetic Task API to run Task Trees.

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.

salesforce_source.png

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.

create_link.png

Then expand the Workflow & Approvals link.

workflow_link.png

Finally, click the Workflow Rules link.

workflow_rules.png

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.

new_rule.png

Click Continue.

continue.png

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.

object_type.png

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.

rule_configuration.png

Now we can add the workflow action. In the dropdown highlighted below select the Outbound Message action.

workflow_actions.png

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.

https://mytaskserver.mycompany.com/kinetic-task/app/api/v1/run-tree/SOURCE/GROUP/TREE

Given the source "Salesforce Task", the source group "Test", and the tree name "Create" we would use the following API route. 

https://mytaskServer.mycompany.com/kinetic-task/app/api/v1/run-tree/Salesforce Task/Test/Create

For Task fields to send simply add all of the fields. Then click the Save button in the top right corner.

outbound_message.png

Then save the workflow rule by clicking Done in the top right corner.

save_rule.png

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.

Source Data

predefined_values.png

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.

Pre-defined Values

Salesforce Task

Organization Id
Task Id
Account Id
Created By Id
Created Date
Is Archived
Is Closed
Is Deleted
Last Modified By Id
Last Modified Date
Owner Id
Priority
Reminder Date Time
Status
Subject
Type
Who Id

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>