Scripts, Services and APIs
The DataSapien platform allows you to author scripts on the Orchestrator and deploy them to be executed on-edge by the Mobile SDK. Scripts can be executed in various contexts by the Mobile SDK and can implement virtually any logic you can think of.
The DataSapien Mobile SDK exposes its functionality via well-defined services. These services are available to your host application and can be used directly from there. In addition to providing the underlying functionality, these services also provide the interfaces for scripts to interact with the SDK. Scripts can call all the functionality offered by these services. This, in turn, allow scripts to implement powerful and flexible business logic.
Managed APIs
A Managed API specifies the credentials and access details for an external API. Managed APIs are defined on the Orchestrator and handled by the ManagedAPI Service in the Mobile SDK. Scripts can use ManagedAPI Service to connect, authenticate to, and consume any defined Managed API. This makes the entire digital infrastructure accessible to you in a secure and controlled manner. You can consume any public or private (including your own proprietary) API and process the fetched response as required inside scripts.
On-device Intelligence
One notable service that scripts have access to is the Intelligence Service. The Intelligence Service provides a generic interface to download and invoke ML/AI models provisioned on the Orchestrator. This enables you to call ML/AI functionality at any place where a script can be executed. You can implement a statefull chat bot, one-shot image-based or text-based recommendations, or any other intelligence-driven feature your business requires.
Script execution contexts
The DataSapien Mobile SDK can execute scripts in the following places:
-
Scripts in MeData Definitions: One powerful feature of the DataSapien Platform is its ability to create your own MeData Definitions aligned with your business needs. Among others,
Script-SourcedMeData Definitions allow you to execute scripts to collect MeData. Script based MeData Definitions allow you to collect data from virtually any source: if it has an API and is accessible via a network, you can use it as a MeData source thanks to the DataSapien Platform. -
Scripts in Journeys: Journeys allow you to design end-to-end flows within your application, complete with custom screens and logic. Using
Script Stepsin Journeys, you can access Journey-scoped variables (such as an answer collected from a custom screen), call an API or change the order of flow. Scripts enable you to implement any business idea and end-user interaction, since they let you implement the logic in whichever way you require. -
Scripts in Rule Actions: MeData-based Rules can trigger actions when they are evaluated and their condition are met. Among other action types,
Script Actionscan execute your authored logic.