Journey Service
Journey Service is the main entry point for extending your applications's capabilities with Journeys.
Journey Execution
Journey Service lets querying available Journeys that the Mobile SDK instance was targeted by (via their Audience selection) published Journeys.
Execution of a Journey requires running the steps in its flow. Eeach step can be one of:
- Screen Step: Screens are defined by a JSON structure that contains array of UI elements inside. There are two main types of UI components: view and input oriented.
- View oriented UI elements support
Markdownfor rich text format and allow displayingvariables from Journey Contextthat were produced by previous steps in the Journey. - Input oriented UI elements are various and standard set of inputs including single / multiline text input, radio / check boxes, buttons etc are available. Input from these UI elements can be bind to
variables inside Journey Contextto be consumed by following steps in the Journey.
- View oriented UI elements support
- Question Step: Displays an answer screen for a question. Answer to the question will be available in the Journey Context.
- Script Step: Contains a script authored in JavaScript. Scripts have access to
Journey Context, Mobile SDK Services and external web APIs via Managed APIs. - MeData Step: This step allows accesing / collecting MeData via MeData Service and set their value to
Journey Contextto be available for rest of the Journey.
Mobile SDK Provided UI
When Journey / Exchange execution is fully delegated to Mobile SDK; whole UI of the Journey is displayed using a WebView. Screens displayed by Screen Steps are fully stylable to match your native screens and design system inplace perfectly.
With Mobile SDK provided UI it is enough for your host application to start the execution with a single function call.
We recommend using Mobile SDK Provided UI and styling screens on DataSapien Orchestrator to match your host application.
Host App Provided UI
If you do not wish to use WebView based UI provided by Mobile SDK, you can choose to do all UI display in your host application. The data underlying a Journey is an XML document that describes its steps and step contents in BPMN format.
In case you want to provide your own UI in your host app:
- You must request the
Executionobject from Journey Service which provides access to underlying BPMN XML. - Parse XML according to BPMN spec considering DataSapien extensions, one of those extensions are
JSON based screen definitions. - For Screen Steps you should develop a mechanism to display UI elements according to JSON screen definition and provide their interactions with
Journey Context. - Drive execution steps using the
Executionobject functions.
Journey Service Functions
To access JourneyService functions; get its instance from DataSapien object: DataSapien.getJourneyService().