For the managed package runtime, call Apex classes from Omniscript using the Remote Action element.
This information is for Omnistudio for Managed Packages. For Omnistudio on standard runtime, see Omnistudio Help.
Before You Begin
Create an Apex class in Salesforce to call from Omniscript.
- Add a Remote Action before a Step, in a Step, or after a Step to load data or send data in the Omniscript. The Omniscript's data JSON is sent as the input.
-
In the Remote Class field, enter the name of the Apex class
that the action calls.
Note
The Apex Class must implement NS.VlocityOpenInterface. NS = the namespace of the Apex class.
-
In the Remote Method field, enter a method of the class
that the Action calls. For example—
validateAddress. - (Optional) In the Pre- and Post-Transform Data Mapper Interface—optionally select an Omnistudio Data Mapper Transform interface to run before or after the Remote Action.
-
(Optional) Change the amount of time before the Action times out using the Remote
Timeout property. In the element, click Edit Properties as
JSON, and in the
remoteTimeoutproperty, set a time in milliseconds. The default timeout is30,000, or 30 seconds. The maximum is120,000, or 120 seconds. - (Optional) Configure additional properties in the Remote Action.
-
(Optional) When Invoke Mode is set to non-blocking, elements using default values
will not receive the response because the element loads before the response returns.
You must configure these properties to map the response to an element:
-
Response JSON Node: VlocityNoRootNode
-
Response JSON Path: The name of the Omniscript Element receiving the value.
-
- Example (Managed Package)
For the managed package runtime, in the Troubleshooting Omniscript, the callOut1 Remote Action element calls an external system to check if the asset is still under warranty. - Remote Action Properties (Managed Package)
For the managed package runtime, this page contains information on Remote Action Properties.