Вы находитесь на странице: 1из 34

Salesforce IoT

Salesforce, Winter ’19

@salesforcedocs
Last updated: January 15, 2019
© Copyright 2000–2018 salesforce.com, inc. All rights reserved. Salesforce is a registered trademark of salesforce.com, inc.,

as are other names and marks. Other marks appearing herein may be trademarks of their respective owners.
CONTENTS

Salesforce IoT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Key Concepts in Salesforce IoT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Enable Salesforce IoT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Create a Context in Salesforce IoT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Create an Orchestration in Salesforce IoT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Define States in Salesforce IoT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Create a Rule in Salesforce IoT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Activate an Orchestration in Salesforce IoT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Troubleshoot New Orchestrations in Salesforce IoT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Send Event Messages from Inside Salesforce IoT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Verify That Event Messages Are Received in Salesforce IoT . . . . . . . . . . . . . . . . . . . . . . . . . 21
Show Your Data Anywhere in Salesforce with IoT Insights . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Monitor Orchestration Activity in Salesforce IoT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Allocations in Salesforce IoT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Monitor Usage in Salesforce IoT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27

Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
SALESFORCE IOT

Use Salesforce IoT to process event messages and integrate them with Salesforce records.
EDITIONS

Key Concepts in Salesforce IoT Available in: Lightning


These concepts and terms are referred to frequently as you interact with Salesforce IoT. Experience

Enable Salesforce IoT Available in: Developer


Before creating contexts and orchestrations, enable Salesforce IoT. Edition

Create a Context in Salesforce IoT Available for an extra cost


A context specifies the data that an orchestration can access: one or more platform events, and in: Enterprise, Performance,
optionally, data from an associated Salesforce object. and Unlimited Editions

Create an Orchestration in Salesforce IoT


An orchestration holds the business logic that processes incoming events.
Define States in Salesforce IoT
You have two options to define states in an orchestration. One is visual and simple, and the other is detailed. You can combine the
options to add and fine-tune your states. Simply switch between the States tab and the Rules tab as you set up your states, and save
your orchestration when you’re done.
Create a Rule in Salesforce IoT
You add rules to define the business logic that is carried out for incoming events. A rule includes conditions and actions, and drives
transitions to other states. Each state can contain one or more rules.
Activate an Orchestration in Salesforce IoT
After you build your orchestration and save it without errors, activate it so that it can execute on incoming platform events and
generate output.
Troubleshoot New Orchestrations in Salesforce IoT
Use trackers to identify and troubleshoot orchestration issues before you activate an orchestration in production. You can debug
your processing logic and workflows and validate that your orchestration works as you planned. A tracker provides a detailed history
of orchestration activities and events.
Send Event Messages from Inside Salesforce IoT
Send event messages to test your orchestrations. The event message is sent to all orchestrations attached to a context, not just the
orchestration you’re viewing.
Verify That Event Messages Are Received in Salesforce IoT
Use Event Viewer to verify that your event messages are being sent to the right context and to troubleshoot problems. You can also
check that all the required event data is coming through before you start creating orchestrations.
Show Your Data Anywhere in Salesforce with IoT Insights
With the IoT Insights Lightning component, you can make your data available to your users throughout Salesforce. You can include
the IoT Insights component on Salesforce Lightning record pages, such as cases, work orders, and assets.
Monitor Orchestration Activity in Salesforce IoT
To help you monitor orchestrations and solve problems in production, the Activity Log provides detailed listings of orchestration
actions and events over the past seven days. You can see log events, such as an orchestration instance going into an error state. You
can also monitor routine actions, such as when an orchestration was activated or deactivated.

1
Salesforce IoT Key Concepts in Salesforce IoT

Allocations in Salesforce IoT


Be aware of the default allocations when defining and running orchestrations in Salesforce IoT. Your contract lists your specific
allocations. You can increase your instance and event allocations for an additional cost. Contact your Salesforce representative to
understand how the product can scale to meet your needs or to purchase add-ons.
Monitor Usage in Salesforce IoT
You can monitor your event and orchestration usage against total Salesforce IoT allocations. You can also get email alerts to warn
you when you’re approaching allocations.
Salesforce IoT Scale Edition

Key Concepts in Salesforce IoT


These concepts and terms are referred to frequently as you interact with Salesforce IoT.

Orchestrations in Salesforce IoT


An orchestration contains the business logic that transforms your streaming event data from connected devices into engaging
customer experiences. With an orchestration, you can specify the states that the devices, services, or people can be in.

Orchestrations in Salesforce IoT


An orchestration contains the business logic that transforms your streaming event data from connected devices into engaging customer
experiences. With an orchestration, you can specify the states that the devices, services, or people can be in.
An orchestration is a nonlinear workflow engine that manages the transitions of things from one defined state to another. You define
the states and the rules and actions within each state. Defining states and the logic within them is simpler than defining all possible
logical paths and combinations of conditions and outcomes that a workflow can have.

Platform Event and Salesforce Object Association in a Context


An orchestration receives incoming streaming event messages. The event data types of the event messages correspond to one or more
platform events that are associated in the orchestration context. You can also enrich event data with data from records of one Salesforce
object. You associate the Salesforce object in the context.

Orchestration States
Each orchestration state is a set of rules that are evaluated for an event message. A rule is a combination of conditions and actions, and
drives transitions to a new state. A rule can trigger actions to create or manipulate records in Salesforce. For example, an orchestration
for a solar panel can have one state for low-power generation and another state for damaged cells. An action in the low-power output
state creates a case to request maintenance for the solar panel. The damaged cell state creates an opportunity to sell a new solar panel.
This image shows the traffic view for an orchestration that receives and processes solar panel events.

2
Salesforce IoT Orchestrations in Salesforce IoT

A rule can use custom variables that you define to persist values. Actions within a rule can set variable values.
This image shows the rules view of the solar panel orchestration. Even though the rules view appears linear, remember that an orchestration
is a nonlinear state machine.

3
Salesforce IoT Orchestrations in Salesforce IoT

You can also define global rules. A global rule applies at all times, regardless of state. Both state rules and global rules can be time-based.
Specify a time in hours or days to delay the evaluation of a rule after a state has been entered.
For each incoming event, the system uses a key field to identify and execute the associated orchestration instance. If an orchestration
instance isn’t running for that key, the system creates an orchestration instance that starts in the default state. An orchestration instance
can be in only one state at one time. A rule can transition the orchestration instance to another state. If a transition doesn’t occur, the
orchestration instance remains in the default state.

How Orchestrations Are Executed in Salesforce IoT


In a running instance, orchestration components are executed in a specific order.

SEE ALSO:
Create a Context in Salesforce IoT
Create an Orchestration in Salesforce IoT

4
Salesforce IoT Orchestrations in Salesforce IoT

How Orchestrations Are Executed in Salesforce IoT


In a running instance, orchestration components are executed in a specific order.
EDITIONS
For each incoming event message, the key value is used to identify and execute the associated
orchestration instance. If no orchestration instance is running for that key, an orchestration instance Available in: Lightning
starts in the default state. The orchestration then executes in the following order. Experience
1. If the orchestration instance is newly created, the system does the following. Available in: Developer
a. Sets the variables to the initial values on the Variables tab. Edition

b. Evaluates global rules for which the When column is set to Instance Created. Available for an extra cost
in: Enterprise, Performance,
c. Starts the timers for the time-based global rules.
and Unlimited Editions
2. Updates the variables that have defined values on the Variables tab.
3. Evaluates the global rules from the top down until the orchestration instance transitions to a new state. Time-based global rules and
global rules for which the When column is set to Instance Created are skipped.
4. If a global rule doesn’t cause a transition to a new state, the current state’s rules are evaluated in this order.
a. From the top down until the orchestration instance transitions to a new state, time-based rules and rules for which the When
column is set to State Entered are skipped.
b. If the evaluated rules transition the orchestration instance to a new state, all timers for this state are stopped.

5. Upon transitioning to a new state, the system does the following.


a. Evaluates the state’s rules for which the When column is set to State Entered.
b. Starts the timers for the state’s time-based rules.
c. If the evaluated rules transition the orchestration instance to a new state, the timers for this state are stopped, and this step is
repeated.

6. Waits in the current state until the next event.


Timers can finish counting down while an orchestration instance is being executed for an incoming event message. Those timers’ rules
are evaluated after the orchestration instance completes the run for the event message.
After an orchestration instance exits, an incoming event message with a matching key creates an orchestration instance in the default
state with reset variables. If you want to ignore incoming event messages for exited orchestration instances, on the Properties tab, set
the orchestration to run only once per key.

SEE ALSO:
Key Concepts in Salesforce IoT
Create an Orchestration in Salesforce IoT

5
Salesforce IoT Enable Salesforce IoT

Enable Salesforce IoT


Before creating contexts and orchestrations, enable Salesforce IoT.
EDITIONS
1. From Setup, enter IoT in the Quick Find box, then select Get Started.
Available in: Lightning
2. In Enable Salesforce IoT, click Enable.
Experience

SEE ALSO: Available in: Developer


Edition
Salesforce IoT
Available for an extra cost
in: Enterprise, Performance,
and Unlimited Editions

USER PERMISSIONS

To use Salesforce IoT:


• API Enabled AND
Customize Application
AND Manage Flow

Create a Context in Salesforce IoT


A context specifies the data that an orchestration can access: one or more platform events, and
EDITIONS
optionally, data from an associated Salesforce object.

Note: If you want to associate your event data with data in Salesforce records, the Salesforce Available in: Lightning
object must contain a field that you can use as a key. The key field must be unique so that Experience
only one record matches an orchestration instance. The key field can be one of the following: Available in: Developer
• Salesforce ID field Edition
• Text or number field with the Unique attribute enabled Available for an extra cost
in: Enterprise, Performance,
Note: Before you add platform events to the context, you must define them. For more and Unlimited Editions
information, see Platform Event Fields in the Platform Events Developer Guide.
1. From Setup, enter IoT in the Quick Find box, then select Contexts. USER PERMISSIONS
2. Click New Context.
To use Salesforce IoT:
3. Enter a context name. • API Enabled AND
4. To distinguish this context from others, enter a description and click Create. The description Customize Application
AND Manage Flow
appears on the context detail page.
5. Click Edit, and add event data and reference data.
6. Click Add Event Data, and select a platform event from the list.
A preview of the selected event fields is displayed.

7. Click Next.
8. Select a key field, and click Apply.
The key associates each incoming event with an orchestration instance.

6
Salesforce IoT Create an Orchestration in Salesforce IoT

9. If you want to add more platform events, repeat the steps.


10. (Optional) To add a Salesforce object, click Add Reference Data, and select an object from the list.
Associating a reference object in the context lets you combine Salesforce data with event data.

11. Click Next.


12. Select a key field, and click Apply.
The key associates each Salesforce record with an orchestration instance. Key values must match across event and reference data.
The key field can be one of the following:
• A Salesforce ID field
• A text or number field with the Unique attribute enabled

13. Click Save, and then click Done to exit.

Create an Orchestration in Salesforce IoT


An orchestration holds the business logic that processes incoming events.
EDITIONS
Before you create an orchestration, define a context to specify the platform events that the
orchestration receives. The context can also specify the Salesforce object that the orchestration Available in: Lightning
accesses. Experience
1. From Setup, enter IoT in the Quick Find box, then select Orchestrations. Available in: Developer
2. Click New Orchestration. Edition

3. Enter a name for the orchestration. Available for an extra cost


in: Enterprise, Performance,
4. For Context, select a context that is defined in your org.
and Unlimited Editions
5. Click Create.

Note: You can associate a context with an orchestration only when creating an orchestration. USER PERMISSIONS
After the orchestration is created, you can’t associate it with another context.
To use Salesforce IoT:
• API Enabled AND
SEE ALSO: Customize Application
Create a Context in Salesforce IoT AND Manage Flow
Create a Rule in Salesforce IoT
Define States in Salesforce IoT

7
Salesforce IoT Define States in Salesforce IoT

Define States in Salesforce IoT


You have two options to define states in an orchestration. One is visual and simple, and the other
EDITIONS
is detailed. You can combine the options to add and fine-tune your states. Simply switch between
the States tab and the Rules tab as you set up your states, and save your orchestration when you’re Available in: Lightning
done. Experience

Available in: Developer


Visually Define States in Salesforce IoT Edition
The States tab of an orchestration shows a simple diagram of the orchestration states and
transitions. Available for an extra cost
in: Enterprise, Performance,
Define States on the Rules Tab in Salesforce IoT and Unlimited Editions
The Rules tab of an orchestration displays details that aren’t included on the States tab, such
as rule conditions. You can also change the order in which the states appear in the orchestration.
USER PERMISSIONS

To use Salesforce IoT:


• API Enabled AND
Customize Application
AND Manage Flow

Visually Define States in Salesforce IoT


The States tab of an orchestration shows a simple diagram of the orchestration states and transitions.
EDITIONS
As you complete these steps, notice the changes to the visually displayed orchestration on the
States tab. Available in: Lightning
Experience
1. Open the orchestration, and click the States tab.
2. Click Add State. Available in: Developer
Edition
3. Enter a name for the state, and click Add.
Available for an extra cost
4. Repeat the steps to add more states.
in: Enterprise, Performance,
5. To change a state’s name, click the state in the diagram and then double-click its name. and Unlimited Editions
6. To add state transitions, click Add Transition, select the states to transition from and to, and
then click Add. USER PERMISSIONS
7. Save your orchestration.
To use Salesforce IoT:
To define the rules for your states or change the order in which the states appear in the orchestration, • API Enabled AND
use the Rules tab. Customize Application
AND Manage Flow
SEE ALSO:
Create a Rule in Salesforce IoT
Define States on the Rules Tab in Salesforce IoT

8
Salesforce IoT Define States on the Rules Tab in Salesforce IoT

Define States on the Rules Tab in Salesforce IoT


The Rules tab of an orchestration displays details that aren’t included on the States tab, such as rule
EDITIONS
conditions. You can also change the order in which the states appear in the orchestration.
1. Open the orchestration, and click the Rules tab. Available in: Lightning
Experience
2. Click Add State.
3. Enter a name for the state, and click Add. Available in: Developer
Edition
The new state appears at the bottom of the page.
Available for an extra cost
4. Repeat the steps to add more states. in: Enterprise, Performance,
5. To change a state’s name, click the name at the top of the state. and Unlimited Editions
6. To move a state up or down, or to delete a state, click at the top of the state.
7. Save your orchestration. USER PERMISSIONS
Now you can add rules to your states. To use Salesforce IoT:
• API Enabled AND
Customize Application
SEE ALSO:
AND Manage Flow
Create a Rule in Salesforce IoT
Visually Define States in Salesforce IoT

Create a Rule in Salesforce IoT


You add rules to define the business logic that is carried out for incoming events. A rule includes
EDITIONS
conditions and actions, and drives transitions to other states. Each state can contain one or more
rules. Available in: Lightning
You can add a rule to a state in one of several ways. Experience
• Available in: Developer
If the state doesn’t have a row for a default empty rule, click in the state header and Edition
select Add rule.
Available for an extra cost
• in: Enterprise, Performance,
Click at the end of a rule. and Unlimited Editions

Clone an existing rule by clicking at the end of a rule and choosing Duplicate rule.
USER PERMISSIONS
A new rule is added as the last row in the state.
To use Salesforce IoT:
To change the order of a rule within a state, click at the end of the rule and select Move rule • API Enabled AND
down or Move rule up. Customize Application
AND Manage Flow

Specify When to Evaluate a Rule in Salesforce IoT


A rule can be evaluated when an event is received, when a state is entered, or at a specific date or time.
Define Conditions in Salesforce IoT
When a state is entered, the conditions are evaluated before an action or transition is executed.

9
Salesforce IoT Specify When to Evaluate a Rule in Salesforce IoT

Add an Action in Salesforce IoT


When a rule is evaluated and its conditions are met, the rule’s actions are executed from the top down. Each rule must have at least
one action or transition. When a rule has multiple actions, you can change their order by dragging them up and down.
Add a State Transition in Salesforce IoT
When a rule is evaluated and its conditions are met, the rule’s actions and then its transition are executed. Each rule and global rule
must have at least one action or transition.
How to Reference Event, Variable, and Salesforce Record Values from Orchestrations in Salesforce IoT
In fields that accept the Salesforce Expression Language, you can reference variables, objects, and events. Examples of such fields
are the condition of a rule or a record field value in an output action.

SEE ALSO:
Specify When to Evaluate a Rule in Salesforce IoT
Define Conditions in Salesforce IoT
Add an Action in Salesforce IoT
Add a State Transition in Salesforce IoT

Specify When to Evaluate a Rule in Salesforce IoT


A rule can be evaluated when an event is received, when a state is entered, or at a specific date or
EDITIONS
time.
In the When column, select when to evaluate the rule. Available in: Lightning
Experience
• For a specific platform event. Only platform events associated with the orchestration’s context
are listed. Available in: Developer
• Any Event—The rule is evaluated when a platform event that’s associated in the context or a Edition
response event is received. Available for an extra cost
• State Entered—The rule is evaluated whenever this state is entered from another state through in: Enterprise, Performance,
a transition. and Unlimited Editions
• Day—The rule is evaluated after the specified number of days. The timer starts when the state
is entered. Specify a whole number for the number of days. For example, to specify a timer of USER PERMISSIONS
5 days, enter 5 next to Day. To start the timer immediately, enter 0. Negative numbers are
treated as zero. To use Salesforce IoT:
• Hour—The rule is evaluated after the specified number of hours. The timer starts when the • API Enabled AND
Customize Application
state is entered. Specify a whole number for the number of hours. For example, to specify a
AND Manage Flow
timer of 2 hours, enter 2 next to Hour. To start the timer immediately, enter 0. Negative numbers
are treated as zero.

10
Salesforce IoT Define Conditions in Salesforce IoT

Define Conditions in Salesforce IoT


When a state is entered, the conditions are evaluated before an action or transition is executed.
EDITIONS
In the Condition column, enter the condition to evaluate. Build an expression with the Salesforce
Expression Language using logical operators and built-in functions. You can reference events Available in: Lightning
associated with the orchestration, fields of the associated Salesforce record, and custom variables. Experience

Example: This example uses the && logical operator to combine two conditions and the Available in: Developer
FLOOR function of the Salesforce Expression Language. The function is passed a value from Edition
a defined variable (CartridgePrice). Available for an extra cost
(MyEvent__e.Ink_Percentage__c < 25) && (FLOOR(CartridgePrice) in: Enterprise, Performance,
< 50) and Unlimited Editions

USER PERMISSIONS
SEE ALSO:
How to Reference Event, Variable, and Salesforce Record Values from Orchestrations in Salesforce To use Salesforce IoT:
IoT • API Enabled AND
Customize Application
Help: Salesforce Expression Language: Formula Operators and Functions AND Manage Flow

Add an Action in Salesforce IoT


When a rule is evaluated and its conditions are met, the rule’s actions are executed from the top
EDITIONS
down. Each rule must have at least one action or transition. When a rule has multiple actions, you
can change their order by dragging them up and down. Available in: Lightning
A subset of the actions that are available for rules can also be used for global rules. Experience

Available in: Developer


Create Salesforce Records from an Orchestration in Salesforce IoT Edition
To have your orchestration create records, add a Salesforce record output action to an
Available for an extra cost
orchestration rule. This action isn’t available for global rules. in: Enterprise, Performance,
Read Salesforce Records from an Orchestration in Salesforce IoT and Unlimited Editions
To have your orchestration obtain data that’s stored in your org, add a Salesforce record output
action to an orchestration rule. This action isn’t available for global rules. USER PERMISSIONS
Edit Salesforce Records from an Orchestration in Salesforce IoT
To use Salesforce IoT:
To have your orchestration edit records, add a Salesforce record output action to an orchestration
• API Enabled AND
rule. This action isn’t available for global rules.
Customize Application
Delete Salesforce Records from an Orchestration in Salesforce IoT AND Manage Flow
To have your orchestration delete records, add a Salesforce record output action to an
orchestration rule. This action isn’t available for global rules.

11
Salesforce IoT Add an Action in Salesforce IoT

Create Salesforce Records from an Orchestration in Salesforce IoT


To have your orchestration create records, add a Salesforce record output action to an orchestration
EDITIONS
rule. This action isn’t available for global rules.
You must have read and edit access to the object fields that the action sets. Available in: Lightning
Experience
1. Open the orchestration, and click the Rules tab.
2. In the rule, click Add an action. Available in: Developer
Edition
3. Select Salesforce Record.
Available for an extra cost
4. Enter the object.
in: Enterprise, Performance,
5. Select Create, and click Next. and Unlimited Editions
6. Set the values of the record fields.
• Required fields are listed, but you can add fields to the list. USER PERMISSIONS
• You can use formulas and reference values from variables, the context-specified object and To use Salesforce IoT:
platform events, and response events. • API Enabled AND
Customize Application
7. To make this action’s response events available to the orchestration: AND Manage Flow
• Select the checkbox.
• Enter a name that uniquely identifies this action’s response events.
Response events are often used to trigger rules, determine whether actions are successful, and make record IDs available in the
orchestration.

8. Enter a unique, concise action name that describes what the action does.
A brief descriptive action name makes your orchestration rule easy to understand when viewing the Rules tab.

9. Click Finish.
10. Save your orchestration.

SEE ALSO:
Add an Action in Salesforce IoT
How to Reference Event, Variable, and Salesforce Record Values from Orchestrations in Salesforce IoT

12
Salesforce IoT Add an Action in Salesforce IoT

Read Salesforce Records from an Orchestration in Salesforce IoT


To have your orchestration obtain data that’s stored in your org, add a Salesforce record output
EDITIONS
action to an orchestration rule. This action isn’t available for global rules.
You must have read access to the object’s fields. Available in: Lightning
Experience
When the action is executed, the response event contains all field values from the specified record.
In a separate rule that’s triggered by the response event, assign field values from the response event Available in: Developer
to variables in the orchestration. Edition
1. Open the orchestration, and click the Rules tab. Available for an extra cost
2. In the rule, click Add an action. in: Enterprise, Performance,
and Unlimited Editions
3. Select Salesforce Record.
4. Enter the object.
USER PERMISSIONS
5. Select Read, and click Next.
To use Salesforce IoT:
6. Specify a field and value that uniquely identify a record.
• API Enabled AND
You can use formulas and reference values from variables, the context-specified object and Customize Application
platform events, and response events. AND Manage Flow

7. Enter a name that uniquely identifies this action’s response events.


8. Enter a unique, concise action name that describes what the action does.
A brief descriptive action name makes your orchestration rule easy to understand when viewing the Rules tab.

9. Click Finish.
10. Save your orchestration.
Choose or create orchestration variables to store the record’s field values. In a separate rule that’s triggered by the response event, add
an action that assigns the response event’s field values to orchestration variables.

SEE ALSO:
Add an Action in Salesforce IoT
How to Reference Event, Variable, and Salesforce Record Values from Orchestrations in Salesforce IoT

13
Salesforce IoT Add an Action in Salesforce IoT

Edit Salesforce Records from an Orchestration in Salesforce IoT


To have your orchestration edit records, add a Salesforce record output action to an orchestration
EDITIONS
rule. This action isn’t available for global rules.
You must have read and edit access to the object fields that the action sets. Available in: Lightning
Experience
1. Open the orchestration, and click the Rules tab.
2. In the rule, click Add an action. Available in: Developer
Edition
3. Select Salesforce Record.
Available for an extra cost
4. Enter the object.
in: Enterprise, Performance,
5. Select Edit, and click Next. and Unlimited Editions
6. Specify a field and value that uniquely identify a record.
You can use formulas and reference values from variables, the context-specified object and USER PERMISSIONS
platform events, and response events.
To use Salesforce IoT:
7. To make this action’s response events available to the orchestration: • API Enabled AND
Customize Application
• Select the checkbox.
AND Manage Flow
• Enter a name that uniquely identifies this action’s response events.

8. Enter a name that uniquely identifies this action’s response events.


9. Enter a unique, concise action name that describes what the action does.
A brief descriptive action name makes your orchestration rule easy to understand when viewing the Rules tab.

10. Click Finish.


11. Save your orchestration.

SEE ALSO:
Add an Action in Salesforce IoT
How to Reference Event, Variable, and Salesforce Record Values from Orchestrations in Salesforce IoT

14
Salesforce IoT Add an Action in Salesforce IoT

Delete Salesforce Records from an Orchestration in Salesforce IoT


To have your orchestration delete records, add a Salesforce record output action to an orchestration
EDITIONS
rule. This action isn’t available for global rules.
You must have read and edit access to the object fields that the action sets. Available in: Lightning
Experience
1. Open the orchestration, and click the Rules tab.
2. In the rule, click Add an action. Available in: Developer
Edition
3. Select Salesforce Record.
Available for an extra cost
4. Enter the object.
in: Enterprise, Performance,
5. Select Delete, and click Next. and Unlimited Editions
6. Specify a field and value that uniquely identify a record.
You can use formulas and reference values from variables, the context-specified object and USER PERMISSIONS
platform events, and response events.
To use Salesforce IoT:
7. To make this action’s response events available to the orchestration: • API Enabled AND
Customize Application
• Select the checkbox.
AND Manage Flow
• Enter a name that uniquely identifies this action’s response events.
To add an action that
8. Enter a name that uniquely identifies this action’s response events. deletes Salesforce records:
• Delete on the object
9. Enter a unique, concise action name that describes what the action does.
A brief descriptive action name makes your orchestration rule easy to understand when viewing
the Rules tab.

10. Click Finish.


11. Save your orchestration.

SEE ALSO:
Add an Action in Salesforce IoT
How to Reference Event, Variable, and Salesforce Record Values from Orchestrations in Salesforce IoT

15
Salesforce IoT Add a State Transition in Salesforce IoT

Add a State Transition in Salesforce IoT


When a rule is evaluated and its conditions are met, the rule’s actions and then its transition are
EDITIONS
executed. Each rule and global rule must have at least one action or transition.
Make sure that you’ve created the states that you’re adding transitions to and from. Available in: Lightning
Experience
1. Open the orchestration, and click the Rules tab.
2. In the Transition column, select the state to transition to. Available in: Developer
Edition

Available for an extra cost


in: Enterprise, Performance,
and Unlimited Editions

Transition Option Description


USER PERMISSIONS
Default The default state is always the first option,
even if you rename it. To use Salesforce IoT:
• API Enabled AND
Your states The states that you create appear after the
Customize Application
default state in the list of transition options. AND Manage Flow

Exit: Success Causes orchestration instances to exit. All exit


options currently do the same thing. The
Exit: Failure displayed variations are reserved for future
Exit: Expired use.
Exit: Not Applicable

None Causes orchestration instances to remain in


the state. This option is selected by default.

3. Save your orchestration.

SEE ALSO:
Define States in Salesforce IoT

16
Salesforce IoT How to Reference Event, Variable, and Salesforce Record
Values from Orchestrations in Salesforce IoT

How to Reference Event, Variable, and Salesforce Record Values from


Orchestrations in Salesforce IoT
In fields that accept the Salesforce Expression Language, you can reference variables, objects, and
EDITIONS
events. Examples of such fields are the condition of a rule or a record field value in an output action.
The following table lists the formats you can use to reference various objects in your orchestration. Available in: Lightning
Experience
What to Reference Format Description Available in: Developer
Event field Event_Name.Field_Name References a field of a specific Edition
platform event associated with Available for an extra cost
the orchestration. in: Enterprise, Performance,
Variable Variable_Name References a variable that is and Unlimited Editions
defined in your orchestration
by using the variable name. USER PERMISSIONS
Salesforce record field Object_Name.Field_Name References a field of the To use Salesforce IoT:
Salesforce object that is • API Enabled AND
associated to the orchestration Customize Application
through the context. AND Manage Flow
Object_Name is the name
of the Salesforce object. In
addition to object fields, you
can also reference lookup
relationships to related objects.
For example, Object_Name.
Lookup_Object.
Field_Name. The lookup
relationship is restricted to one
level.

17
Salesforce IoT Activate an Orchestration in Salesforce IoT

Activate an Orchestration in Salesforce IoT


After you build your orchestration and save it without errors, activate it so that it can execute on
EDITIONS
incoming platform events and generate output.
Saving an orchestration preserves only the changes made, but it doesn’t make them available for Available in: Lightning
execution. To test an orchestration with test events, you must activate it first. An active orchestration Experience
also executes on real platform events and data. To deploy changes made to an orchestration,
Available in: Developer
reactivate it. Activating a new version of an orchestration replaces the previous active version. Only
Edition
one version of an orchestration is active at any time.
Available for an extra cost
If an orchestration has never been activated, the Traffic tab is not accessible. The Traffic tab shows
in: Enterprise, Performance,
the orchestration instances for the currently active orchestration. Incoming platform events are
and Unlimited Editions
ignored for an inactive orchestration.
1. On the orchestration’s page, click Activate.
USER PERMISSIONS
2. To remove prior running instances of the orchestration, select Delete all running instances
of this orchestration. To use Salesforce IoT:
• API Enabled AND
3. Click Activate.
Customize Application
AND Manage Flow
SEE ALSO:
Orchestrations in Salesforce IoT

Troubleshoot New Orchestrations in Salesforce IoT


Use trackers to identify and troubleshoot orchestration issues before you activate an orchestration
EDITIONS
in production. You can debug your processing logic and workflows and validate that your
orchestration works as you planned. A tracker provides a detailed history of orchestration activities Available in: Lightning
and events. Experience
For example, let’s say you’re building an orchestration to monitor the power output of solar panels.
Available in: Developer
You’ve set up the variables, created the rules, and determined the transitions and actions for the
Edition
different power states. You’re ready to test the orchestration, but you want to first make sure that
it’s set up correctly. Available for an extra cost
in: Enterprise, Performance,
Set up a tracker in your sandbox to take a detailed look at the orchestration activity, and then activate
and Unlimited Editions
the orchestration. You must activate an orchestration for a tracker to start logging activity. Activities
are logged in chronological order. As you make changes, you can send in new platform events and
check the results in the tracker. USER PERMISSIONS

To use Salesforce IoT:


• API Enabled AND
Customize Application
AND Manage Flow

18
Salesforce IoT Troubleshoot New Orchestrations in Salesforce IoT

1. From Setup, enter IoT in the Quick Find box, then select Orchestrations.
2. Select an orchestration, and click .
3. Enter a key value, and click Start Tracker.
The tracker monitors the orchestration for 30 days and expires automatically. If you want to track the same orchestration and key
value after it expires, you must set it up again.
Trackers show the following orchestration log types for the past 24 hours:
• Events
• Actions
• Errors
• Transitions
• Variables
• Timers

19
Salesforce IoT Send Event Messages from Inside Salesforce IoT

• Rules
• Throttles
You can delete a tracker before it expires. When you delete a tracker, the logs are removed from the UI. Logs for the past 24 hours of
activity are stored in the Apex debug logs.

SEE ALSO:
Activate an Orchestration in Salesforce IoT
Monitor Orchestration Activity in Salesforce IoT

Send Event Messages from Inside Salesforce IoT


Send event messages to test your orchestrations. The event message is sent to all orchestrations
EDITIONS
attached to a context, not just the orchestration you’re viewing.
1. From Setup, enter IoT in the Quick Find box, then select Orchestrations. Available in: Lightning
Experience
2.
Select the orchestration that you want to send an event message to, and click Available in: Developer
3. Edit the sample event body, and click Send Event. Edition

Available for an extra cost


SEE ALSO: in: Enterprise, Performance,
and Unlimited Editions
Verify That Event Messages Are Received in Salesforce IoT

USER PERMISSIONS

To use Salesforce IoT:


• API Enabled AND
Customize Application
AND Manage Flow

20
Salesforce IoT Verify That Event Messages Are Received in Salesforce IoT

Verify That Event Messages Are Received in Salesforce IoT


Use Event Viewer to verify that your event messages are being sent to the right context and to
EDITIONS
troubleshoot problems. You can also check that all the required event data is coming through
before you start creating orchestrations. Available in: Lightning
1. From Setup, enter IoT in the Quick Find box, then select Contexts. Experience
2. Available in: Developer
Select the context that you want to view event messages for, and click Edition

Available for an extra cost


SEE ALSO: in: Enterprise, Performance,
Send Event Messages from Inside Salesforce IoT and Unlimited Editions

USER PERMISSIONS

To use Salesforce IoT:


• API Enabled AND
Customize Application
AND Manage Flow

Show Your Data Anywhere in Salesforce with IoT Insights


With the IoT Insights Lightning component, you can make your data available to your users
EDITIONS
throughout Salesforce. You can include the IoT Insights component on Salesforce Lightning record
pages, such as cases, work orders, and assets. Available in: Lightning
Before you add the IoT Insights Lightning component to a record page, enable IoT Insights and Experience
create and activate an orchestration with your desired variables.
Available in: Developer
Enable IoT Insights Edition
1. From Setup, enter IoT in the Quick Find box, then select Get Started. Available for an extra cost
2. In Enable Salesforce IoT Insights, click Enable. in: Enterprise, Performance,
and Unlimited Editions
Configure the Display Settings for Your Variables
1. In orchestrations, select the variables tab, and click IoT Insights Settings.
USER PERMISSIONS
2. Select Show in IoT Insights to make your variables visible in the IoT Insights component.
To use Salesforce IoT:
3. Enter the label name and units for each variable.
• API Enabled AND
4. Click Apply, and then click Activate. Customize Application
AND Manage Flow

21
Salesforce IoT Show Your Data Anywhere in Salesforce with IoT Insights

Add the Lightning Component


1. From the Setup menu on a record page, select Edit Page.
2. Drag IoT Insights into the App Builder.
3. Click inside the IoT Insights panel and the Properties panel opens on the right.
4. Select the Parent Record for the record page you want the Salesforce IoT data to display in.
5. Choose the orchestration that contains the variables you want to show.
6. Select Add Variable and enter up to five variables.
7. Click Save.

22
Salesforce IoT Show Your Data Anywhere in Salesforce with IoT Insights

Add the Communities Component


An optional step is to add the IoT Insights Community component to your community so your customers and partners can access the
Salesforce IoT data.
1. Select the IoT Insights component under Records in the page that you’re editing.

23
Salesforce IoT Show Your Data Anywhere in Salesforce with IoT Insights

2. In the property editor, configure properties for the component:

Property Details
Orchestration Choose the orchestration that contains the variables you want to show.

Iot Variables Select the variables to display.

24
Salesforce IoT Show Your Data Anywhere in Salesforce with IoT Insights

Example: By adding Salesforce IoT data to record pages, IoT Insights gives service representatives diagnostic and operational
data about connected devices. This enhanced data can help your service team quickly and proactively solve customer issues.

25
Salesforce IoT Monitor Orchestration Activity in Salesforce IoT

Monitor Orchestration Activity in Salesforce IoT


To help you monitor orchestrations and solve problems in production, the Activity Log provides
EDITIONS
detailed listings of orchestration actions and events over the past seven days. You can see log
events, such as an orchestration instance going into an error state. You can also monitor routine Available in: Lightning
actions, such as when an orchestration was activated or deactivated. Experience
1. From Setup, enter IoT in the Quick Find box.
Available in: Developer
2. Select Activity Log. Edition
Activity Log shows the following log events for the last seven days. Available for an extra cost
• Orchestration activation in: Enterprise, Performance,
and Unlimited Editions
• Orchestration save
• Orchestration delete
USER PERMISSIONS
• Orchestration going into error state
• Context activation To use Salesforce IoT:
• Context save • API Enabled AND
Customize Application
• Context delete AND Manage Flow
• High-usage email alert sent

SEE ALSO:
Orchestrations in Salesforce IoT
Troubleshoot New Orchestrations in Salesforce IoT

Allocations in Salesforce IoT


Be aware of the default allocations when defining and running orchestrations in Salesforce IoT.
EDITIONS
Your contract lists your specific allocations. You can increase your instance and event allocations
for an additional cost. Contact your Salesforce representative to understand how the product can Available in: Lightning
scale to meet your needs or to purchase add-ons. Experience

Description Developer Edition Enterprise, Performance, Available in: Developer


(Salesforce IoT Trial) and Unlimited Editions Edition

Maximum number of 150 150 Available for an extra cost


orchestrations in: Enterprise, Performance,
and Unlimited Editions
Maximum number of instances 10 10,000
per orchestration (unique
devices)

Maximum number of event 15,000 500,000


messages processed by
orchestrations per a 24-hour
period1

26
Salesforce IoT Monitor Usage in Salesforce IoT

1
The maximum event message count can include non-unique event messages. For example, if three orchestrations process the same
event message, the count of event messages processed is increased by three, not one.
In addition, the following allocations apply for platform events.
• Maximum number of event notifications published per hour
• Maximum number of platform event definitions that can be created in an org

SEE ALSO:
Platform Events Developer Guide : Platform Event Allocations

Monitor Usage in Salesforce IoT


You can monitor your event and orchestration usage against total Salesforce IoT allocations. You
EDITIONS
can also get email alerts to warn you when you’re approaching allocations.
Available in: Lightning
Monitor Event and Orchestration Usage in Salesforce IoT Experience
Track the daily Salesforce IoT event and instance allocations for your org. You can see how many Available in: Developer
event messages each orchestration has processed and how many instances are active. Edition
Get Email Alerts for High Event Usage in Salesforce IoT
Available for an extra cost
If your org has at least one active orchestration, you can get email alerts to warn you when your in: Enterprise, Performance,
Salesforce IoT usage is high. and Unlimited Editions

USER PERMISSIONS

To use Salesforce IoT:


• API Enabled AND
Customize Application
AND Manage Flow

27
Salesforce IoT Monitor Event and Orchestration Usage in Salesforce IoT

Monitor Event and Orchestration Usage in Salesforce IoT


Track the daily Salesforce IoT event and instance allocations for your org. You can see how many
EDITIONS
event messages each orchestration has processed and how many instances are active.
1. From Setup, enter IoT in the Quick Find box. Available in: Lightning
Experience
2. Select Usage Data.
Available in: Developer
Example: Here’s a sample usage page for an org with many orchestrations. Only two
Edition
orchestrations are shown. The number of event messages processed for all the orchestrations
is below the allocation of 500,000 events per day. Available for an extra cost
in: Enterprise, Performance,
and Unlimited Editions

USER PERMISSIONS

To use Salesforce IoT:


• API Enabled AND
Customize Application
AND Manage Flow

SEE ALSO:
Allocations in Salesforce IoT

28
Salesforce IoT Get Email Alerts for High Event Usage in Salesforce IoT

Get Email Alerts for High Event Usage in Salesforce IoT


If your org has at least one active orchestration, you can get email alerts to warn you when your
EDITIONS
Salesforce IoT usage is high.
Email alerts are sent to orchestration owners when these criteria are met. An orchestration owner Available in: Lightning
is the user who last activated the orchestration. Experience
• An active orchestration instance usage nears its allocation. This email is sent when an Available in: Developer
orchestration instance exceeds 75% of its device allocation, either when it is first activated or Edition
when it is reactivated. An alert is also sent when the instance is over 90% of its device allocation.
Available for an extra cost
An alert is sent only once per day.
in: Enterprise, Performance,
• The event usage across all orchestrations nears the daily event message allocation. This email and Unlimited Editions
is sent when usage is above 75% and below 90% of your event allocation. An email alert is also
sent when your event usage is above 90% of your allocation. All users who own at least one
active orchestration receive this email. Each alert is sent only once per day. USER PERMISSIONS
• Event messages aren’t being processed because you went over either the orchestration instance To use Salesforce IoT:
allocation or the daily event allocation. Depending on the cause of the alert, the email is sent • API Enabled AND
to the orchestration owner or all users who own at least one active orchestration. This alert is Customize Application
sent once per hour. AND Manage Flow
To turn on high-usage email alerts:
1. From Setup, enter IoT in the Quick Find box, then select Get Started.
2. In Turn On High-Usage Email Alerts, click Enable.

SEE ALSO:
Allocations in Salesforce IoT

29
INDEX

A S
Action, Salesforce IoT Salesforce IoT 1
adding 11 Salesforce IoT action
create Salesforce records 12 adding 11
delete Salesforce records 15 create Salesforce records 12
edit Salesforce records 14 delete Salesforce records 15
read Salesforce records 13 edit Salesforce records 14
Activity Log 26 read Salesforce records 13
Salesforce IoT Activity Log 26
C Salesforce IoT conditions
Conditions, Salesforce IoT create a condition 11
create a condition 11 Salesforce IoT contexts
contexts, Salesforce IoT create a context 6
create a context 6 Salesforce IoT Insights 21
Salesforce IoT orchestrations
E create an orchestration 7
Event Sender 20 overview 2
Explorer limits 26 Salesforce IoT Orchestrations
activate an orchestration 18
H reference event and record fields, and variables 17
High-Usage Email 29 Salesforce IoT rules
create a rule 9–10
I Salesforce IoT state transition 16
IoT Event Sender 20 Salesforce IoT states
IoT Event Viewer 21 add in Rules tab 9
IoT Insights component 21 add in States tab 8
IoT Usage Email 29 add to an orchestration 8
Salesforce IoT Usage 27
O Salesforce IoT Usage Data 28
Orchestrations, Salesforce IoT Send IoT Events 20
activate an orchestration 18 State transition, Salesforce IoT 16
create an orchestration 7 States, Salesforce IoT
overview 2 add in Rules tab 9
reference event and record fields, and variables 17 add in States tab 8
Orchestrations, Troubleshoot 18 add to an orchestration 8

R T
Rules, Salesforce IoT Tracker 18
create a rule 9–10 Transition, Salesforce IoT 16

30

Вам также может понравиться