...
SUBSCRIPTION | ||||
---|---|---|---|---|
A Subscription is a relationship from a Subscriber to a Publisher that allows the Subscriber to receive the Publisher’s data. | ||||
Field | Type | Notes | ||
| string (25 char) | The identifier of the Subscriber | ||
| string (25 char) | The identifier of the Publisher | ||
| UTC date/time | UTC timestamp of the last time the Subscriber pulled data from this Publisher | ||
| boolean | Whether or not the subscription supports the nightly sync process. (Applies to LearningBuilder subscribers Subscribers only)
| ||
| JSON | JSON structure mapping different See below for detailed explanation |
...
This section applies specifically to subscribers Subscribers using LearningBuilder. Other systems will need to implement their own mechanism for processing data from the Hub.
Publishers and Subscribers think about and model their data differently, so the publisher’s Publisher’s data typically needs modified or converted before it can be imported into LearningBuilder.
...
Which
PublisherEventCategory
values it cares aboutA Handlebars template that specifies how to convert
Events
of that category into a JSON format that can be imported through the Subscriber’s API/WorkflowImportQueue/CreateBatch API.For more information about Handlebars Templates https://handlebarsjs.com/guide/#what-is-handlebars
For more info on the data manipulation Helpers available, please refer https://github.com/Handlebars-Net/Handlebars.Net.Helpers
Those templates are stored as the batchRowTemplate
property in the LbApiPayloadTemplate
property of f an EventSubsription
:
Code Block | ||
---|---|---|
| ||
"LbApiPayloadTemplate": { "{EventCategory1}": { "action": "import (default) | ignore", "label": "human readable note", "importProcessId": {WIQ Process Id}, "batchRowTemplate": "{handlebars template}" }, // ... additional category mappings as needed ... "_default": { "action": "import (default) | ignore", "label": "human readable note", "importProcessId": {WIQ Process Id}, "batchRowTemplate": "{handlebars template}" } } |
...
To import it into the Subscriber, using the specified
batchRowTemplate
To ignore it, because the Subscriber isn’t interested in that category of publisher Publisher data
Syntax examples
Example / scenario | Sample | |||||
---|---|---|---|---|---|---|
Subscribe to all publisher Publisher event categories, using the same template for everything |
| |||||
Subscribe to all publisher Publisher event data, with special handling for a specific category |
| |||||
Subscribe to a specific category only, ignoring everything else |
| |||||
Ignore a specific category, process everything else using a common template |
|
...
When Publishers push data into the Hub, they specify a
PublisherEventCategory
value. (For example, this might differentiate between data representing a completed course and data representing work history)A Subscriber’s
EventSubscription
contain contain one or more templates, each one mapped to a specificPublisherEventCategory
value. (This allows the subscriber Subscriber to convert those courses and work history entries in different ways)Each template converts a single
PublisherEventData
JSON object into a different JSON schema that can be passed to the Subscriber’s API/WorkflowImportQueue/CreateBatch API endpoint.When LearningBuilder synchronizes data, it loops through each
PublisherEventData
item, converts it using the relevant template, and then makes a single call to API/WorkflowImportQueue/CreateBatch to import the data.
...