The following tutorial will walk you through how to use the Axeda Platform to create Chatter on Salesforce's (SFDC) Chatter Application.
In the following steps, you will:
- Create a SFDC Developer account and enable the SFDC API Access
- Create a Groovy script
- Create Expression Rule on the Axeda Platform
- Use the Axeda Rules Debugger to test the expression rule and create a Chatter entry in your SFDC account.
Step-1: Register on Force.com here and follow the diagrammatical instructions below.
- Check your email and click on the link provided
- Login to Force.com
Step-2: Configure your user profile to work with Axeda Platform
This section explains how to get the API specific parameters you will need for your Axeda Groovy Script. As a reminder, you will need to know your login information. Specifically:
- Username - Your username you logged into Force.com
- Password - Your password you created when registering with Force.com
- ApiToken (Security Token)
Now, to enable a SalesForce account for API access, go into the Setup menu for the account.
- Click on Setup -> My Personal Information -> Reset Security Token
- Reset your token
You will receive an email containing your Security Token. Please keep it handy as you'll need it later.
- On the left menu, under "App Setup", open up "Develop" and click on "Remote Access". We're going to create a new Remote Application.
Salesforce applications often use a callback URL to the application. For our purposes, we don’t need one. However, the Remote Access page on Salesforce requires something to be populated in this field, so we will use https://dev6.axeda.com to complete the input form. Here's my sample remote application setup:
- Click "Save"
SalesForce will provide you with a consumer key and a consumer Secret, used in the HMAC-SHA1 signature for the OAuth dance. Please keep your Consumer Key and Secret handy as you will need them later. Now let's move to the Groovy script...
Step-3: Create the Groovy script (Custom Object)
Build and compile your Custom object as follows:
Name = "cxnSFDCChatter"
Type = "Action"
Description = Optional
Copy Source (replace parameters in code - Do not use the brackets)
- Create a parameter "message":
Step-4: Creating the Expression Rule to Execute your cxnSFDCChatter groovy script
- Click on the Configuration tab
- Select New Expression Rule
- Enter the Expression Rule information shown below:
Enabled: Leave checked
IF : severity > 100
THEN: ExecuteCustomObject ("cxnSFDCChatter", description)
- Next, click on the to associate the Expression Rule to your Assets
- Click on the search button, select both models or one and click the Add button so it looks like the image below. The following dialog will load.
- Click "OK".
In simple terms, if the Alarm severity is greater than 100, and it is associated with your model, the Custom Object "cxnSFDCChatter" will be executed.
Step-5: Debugging your Script with the Expression Rule Debugger
- Return to the Expression Rule you created in Step-4 and select the ChatterAlarm Rule
- Change the THEN statement to appear as shown below.
NOTE: (Remember to change it back to "description" after the test)
- Click on the Test tab on the left hand side
- Now, click on the "New Test" button
Now, let's test the alarm:
- Select "Alarm" from Type list.
- Enter a Test name for example "TestChatter"
- Click on the "Search Button" and select an Asset
- Enter ChatterAlarm for Alarm name
- Enter 150 for severity
- Click "Save"
A dialog will open and it should appear as shown below:
Note that, after Saving the configuration, you will see that a new Test has been created.
- Now click on the test button
- Check your Chatter page in SFDC and you will see the test Chatter
Congratulations! You have just integrated the Axeda platform with a 3rd party CRM in five easy steps. You can now connect your assets and when an alarm or data item reaches a threshold, create a Chatter in SFDC which will be seen by a group of people you share it with.