Journeys

Please note: Journeys are only available in our Enterprise hosted version of Learning Locker. For more information about the differences, please see this page.

A visualisation of an actor/person’s progress through a journey.

It is accessible through the following HTTP interfaces:

SCHEMA

Name

Type

Description

Name

Type

Description

_id

Mongo ID

The id of this journey (autogenerated)

organisation

Organisation Mongo ID

The id of the organisation this journey belongs to (autogenerated)

owner

User Mongo ID

The id of the user who created this journey (autogenerated)

createdAt

Timestamp

When this journey was created (autogenerated)

updatedAt

Timestamp

When this journey was last updated (autogenerated)

description

String

The name of the journey

isActive

Boolean

If this journey is active

sources

Array [Store Mongo IDs]

An array of stores that this journey applies to

waypoints

Array [Waypoints]

An array of waypoints for this journey. See waypoints

outcomes

Array [Outcomes]

An array of outcomes for this journey

isSequential

Boolean

If this journey is sequential

isRepeatable

Boolean

If this journey is repeatable

trackBy

String

Only "actor" currently supported, "persona" tracking coming soon

recalculateStatus

JSON {Recalculate Status}

Progress in calculating this journey

isPublic

Boolean

If false then this visualisation is only available to the owner and users with org/all/journey/view scope, otherwise it’s available to everyone in the organisation with permission

queryHint

String

Specifies a Mongo collection index to use instead of the chosen index selected during the query planner stage, e.g. org_1_lrs_1__id_1 (see )

WAYPOINTS

An array of points with properties:

Name

Type

Description

Name

Type

Description

_id

Mongo ID

the id of this waypoint (autogenerated)

description

String

Name of this waypoint

isActive

Boolean

If this waypoint is active. Inactive waypoints will not be processed by the journey handler

conditions

String

A stringified JSON mongo query of when this waypoint has been reached.

count

Number

The number of times that the condition must be met

order

Number

The order of this waypoint in the journey

OUTCOMES

An array of outcomes with properties:

Name

Type

Description

Name

Type

Description

description

String

The name of this outcome.

isActive

Boolean

If this outcome is active.

type

String

Only 'callback' currently supported, 'statement' outcomes coming soon

callback

String (URL)

URL to POST completion data on a journey being completed. See callback example

tripCount

Number

Load control counter. The variable MAX_TRIP_COUNT in .env is responsible for this counter.

deactivatedAt

Date

Deactivation date if tripCount has peaked.

CALLBACK EXAMPLE

When a persona/actor completes a journey, the callback url will receive a POST with JSON body. Example body:

{ "owner":{ "trackBy":"actor", "ident":{ "account":{ "homePage":"http://www.dave.com", "name":"Dave" }, "objectType":"Agent" } }, "attempt":{ "waypoints":[ { "completedAt":"2017-09-20T09:56:02.443Z", "isCompleted":true, "statements":[ { "timestamp":"2017-09-20T09:56:02.443Z", "statement":"59c23b32d138e44d720041a9" } ], "order":1, "waypoint":"59c237bebdf9ac67b2ab5ee9", "statement":[ { "_id":"59c23b32d138e44d720041a9", "lrs":{ "_id":"5943782ac3f34065c7b4132a" }, "lrs_id":"5943782ac3f34065c7b4132a", "organisation":"59198183d8ea540933227033", "client":"592433ebce79a40338e0d8c4", "client_id":"592433ebce79a40338e0d8c4", "statement":{ "id":"346cb0a8-368c-4f29-a4f8-ec3565f7a75a", "timestamp":"2017-09-20T09:56:02.443600+00:00", "stored":"2017-09-20T09:56:02.443600+00:00", "authority":{ "name":"New Client", "mbox":"mailto:hello@learninglocker.net", "objectType":"Agent" }, "object":{ "id":"https://acorncorp.com/training/Introduction", "definition":{ "name":{ "en-GB":"Introduction" }, "type":"http://adlnet.gov/expapi/activities/course" }, "objectType":"Activity" }, "verb":{ "id":"http://adlnet.gov/expapi/verbs/completed", "display":{ "en-GB":"completed" } }, "result":{ "score":{ "min":0, "max":100, "raw":67, "scaled":0.67 } }, "actor":{ "account":{ "homePage":"http://www.dave.com", "name":"Dave20" }, "objectType":"Agent" }, "version":"1.0.0" }, "active":true, "voided":false, "timestamp":"2017-09-20T09:56:02.443Z", "stored":"2017-09-20T09:56:02.443Z", "personaIdentifier":"59c23b27f6463f3569446bc5", "completedForwardingQueue":[ ], "pendingForwardingQueue":[ ], "failedForwardingLog":[ ], "deadForwardingQueue":[ ], "processingQueues":[ "STATEMENT_PERSON_QUEUE", "STATEMENT_FORWARDING_QUEUE", "STATEMENT_JOURNEY_QUEUE" ], "completedQueues":[ "STATEMENT_QUERYBUILDERCACHE_QUEUE" ], "person":{ "display":"Dave20 - http://www.dave.com (xAPI Account)", "_id":"59c23b2753631c67de0cd5b9" } } ] }, { "completedAt":"2017-09-20T09:55:53.799Z", "isCompleted":true, "statements":[ { "statement":"59c23b26d138e44a720041ad", "timestamp":"2017-09-20T09:55:50.310Z" }, { "timestamp":"2017-09-20T09:55:51.192Z", "statement":"59c23b27d138e44a720041ae" }, { "statement":"59c23b28d138e44a720041af", "timestamp":"2017-09-20T09:55:52.313Z" }, { "timestamp":"2017-09-20T09:55:52.880Z", "statement":"59c23b28d138e44a720041b0" }, { "statement":"59c23b29d138e44a720041b1", "timestamp":"2017-09-20T09:55:53.799Z" } ], "order":0, "waypoint":"59c237bebdf9ac67b2ab5eea", "statement":[ { "_id":"59c23b26d138e44a720041ad", "lrs":{ "_id":"5943782ac3f34065c7b4132a" }, "lrs_id":"5943782ac3f34065c7b4132a", "organisation":"59198183d8ea540933227033", "client":"592433ebce79a40338e0d8c4", "client_id":"592433ebce79a40338e0d8c4", "statement":{ "id":"d0d27c01-2185-4f81-81c2-99af3326b86b", "timestamp":"2017-09-20T09:55:50.310800+00:00", "stored":"2017-09-20T09:55:50.310800+00:00", "authority":{ "name":"New Client", "mbox":"mailto:hello@learninglocker.net", "objectType":"Agent" }, "object":{ "id":"https://acorncorp.com/training/Introduction", "definition":{ "name":{ "en-GB":"Introduction" }, "type":"http://adlnet.gov/expapi/activities/course" }, "objectType":"Activity" }, "verb":{ "id":"http://adlnet.gov/expapi/verbs/commented", "display":{ "en-GB":"commented" } }, "result":{ "score":{ "min":0, "max":100, "raw":67, "scaled":0.67 } }, "actor":{ "account":{ "homePage":"http://www.dave.com", "name":"Dave20" }, "objectType":"Agent" }, "version":"1.0.0" }, "active":true, "voided":false, "timestamp":"2017-09-20T09:55:50.310Z", "stored":"2017-09-20T09:55:50.310Z", "personaIdentifier":"59c23b27f6463f3569446bc5", "completedForwardingQueue":[ ], "pendingForwardingQueue":[ "59a8005292303c1af05ec970" ], "failedForwardingLog":[ { "message":"Error: Status code didn't return 200", "statementForwarding_id":"59a8005292303c1af05ec970", "timestamp":"2017-09-20T09:55:52.877Z", "_id":"59c23b2853631c67de0cd5d4" } ], "deadForwardingQueue":[ ], "processingQueues":[ ], "completedQueues":[ "STATEMENT_QUERYBUILDERCACHE_QUEUE", "STATEMENT_PERSON_QUEUE", "STATEMENT_JOURNEY_QUEUE", "STATEMENT_FORWARDING_QUEUE" ], "person":{ "_id":"59c23b2753631c67de0cd5b9", "display":"Dave20 - http://www.dave.com (xAPI Account)" } }, { "_id":"59c23b27d138e44a720041ae", "lrs":{ "_id":"5943782ac3f34065c7b4132a" }, "lrs_id":"5943782ac3f34065c7b4132a", "organisation":"59198183d8ea540933227033", "client":"592433ebce79a40338e0d8c4", "client_id":"592433ebce79a40338e0d8c4", "statement":{ "id":"e26db41d-e165-4b0f-bf83-7ffde3e7dd5a", "timestamp":"2017-09-20T09:55:51.192200+00:00", "stored":"2017-09-20T09:55:51.192200+00:00", "authority":{ "name":"New Client", "mbox":"mailto:hello@learninglocker.net", "objectType":"Agent" }, "object":{ "id":"https://acorncorp.com/training/Introduction", "definition":{ "name":{ "en-GB":"Introduction" }, "type":"http://adlnet.gov/expapi/activities/course" }, "objectType":"Activity" }, "verb":{ "id":"http://adlnet.gov/expapi/verbs/commented", "display":{ "en-GB":"commented" } }, "result":{ "score":{ "min":0, "max":100, "raw":67, "scaled":0.67 } }, "actor":{ "account":{ "homePage":"http://www.dave.com", "name":"Dave20" }, "objectType":"Agent" }, "version":"1.0.0" }, "active":true, "voided":false, "timestamp":"2017-09-20T09:55:51.192Z", "stored":"2017-09-20T09:55:51.192Z", "personaIdentifier":"59c23b27f6463f3569446bc5", "completedForwardingQueue":[ ], "pendingForwardingQueue":[ "59a8005292303c1af05ec970" ], "failedForwardingLog":[ { "message":"Error: Status code didn't return 200", "statementForwarding_id":"59a8005292303c1af05ec970", "timestamp":"2017-09-20T09:55:53.950Z", "_id":"59c23b2953631c67de0cd600" } ], "deadForwardingQueue":[ ], "processingQueues":[ ], "completedQueues":[ "STATEMENT_QUERYBUILDERCACHE_QUEUE", "STATEMENT_JOURNEY_QUEUE", "STATEMENT_PERSON_QUEUE", "STATEMENT_FORWARDING_QUEUE" ], "person":{ "display":"Dave20 - http://www.dave.com (xAPI Account)", "_id":"59c23b2753631c67de0cd5b9" } }, { "_id":"59c23b28d138e44a720041af", "lrs":{ "_id":"5943782ac3f34065c7b4132a" }, "lrs_id":"5943782ac3f34065c7b4132a", "organisation":"59198183d8ea540933227033", "client":"592433ebce79a40338e0d8c4", "client_id":"592433ebce79a40338e0d8c4", "statement":{ "id":"16035311-588b-4d00-8a2a-0d5675c0cc90", "timestamp":"2017-09-20T09:55:52.313800+00:00", "stored":"2017-09-20T09:55:52.313800+00:00", "authority":{ "name":"New Client", "mbox":"mailto:hello@learninglocker.net", "objectType":"Agent" }, "object":{ "id":"https://acorncorp.com/training/Introduction", "definition":{ "name":{ "en-GB":"Introduction" }, "type":"http://adlnet.gov/expapi/activities/course" }, "objectType":"Activity" }, "verb":{ "id":"http://adlnet.gov/expapi/verbs/commented", "display":{ "en-GB":"commented" } }, "result":{ "score":{ "min":0, "max":100, "raw":67, "scaled":0.67 } }, "actor":{ "account":{ "homePage":"http://www.dave.com", "name":"Dave20" }, "objectType":"Agent" }, "version":"1.0.0" }, "active":true, "voided":false, "timestamp":"2017-09-20T09:55:52.313Z", "stored":"2017-09-20T09:55:52.313Z", "personaIdentifier":"59c23b27f6463f3569446bc5", "completedForwardingQueue":[ ], "pendingForwardingQueue":[ "59a8005292303c1af05ec970" ], "failedForwardingLog":[ { "message":"Error: Status code didn't return 200", "statementForwarding_id":"59a8005292303c1af05ec970", "timestamp":"2017-09-20T09:55:55.139Z", "_id":"59c23b2b53631c67de0cd619" } ], "deadForwardingQueue":[ ], "processingQueues":[ ], "completedQueues":[ "STATEMENT_QUERYBUILDERCACHE_QUEUE", "STATEMENT_FORWARDING_QUEUE", "STATEMENT_PERSON_QUEUE", "STATEMENT_JOURNEY_QUEUE" ], "person":{ "display":"Dave20 - http://www.dave.com (xAPI Account)", "_id":"59c23b2753631c67de0cd5b9" } }, { "_id":"59c23b28d138e44a720041b0", "lrs":{ "_id":"5943782ac3f34065c7b4132a" }, "lrs_id":"5943782ac3f34065c7b4132a", "organisation":"59198183d8ea540933227033", "client":"592433ebce79a40338e0d8c4", "client_id":"592433ebce79a40338e0d8c4", "statement":{ "id":"05e8b081-ff5b-473a-96aa-a841d2823c24", "timestamp":"2017-09-20T09:55:52.880800+00:00", "stored":"2017-09-20T09:55:52.880800+00:00", "authority":{ "name":"New Client", "mbox":"mailto:hello@learninglocker.net", "objectType":"Agent" }, "object":{ "id":"https://acorncorp.com/training/Introduction", "definition":{ "name":{ "en-GB":"Introduction" }, "type":"http://adlnet.gov/expapi/activities/course" }, "objectType":"Activity" }, "verb":{ "id":"http://adlnet.gov/expapi/verbs/commented", "display":{ "en-GB":"commented" } }, "result":{ "score":{ "min":0, "max":100, "raw":67, "scaled":0.67 } }, "actor":{ "account":{ "homePage":"http://www.dave.com", "name":"Dave20" }, "objectType":"Agent" }, "version":"1.0.0" }, "active":true, "voided":false, "timestamp":"2017-09-20T09:55:52.880Z", "stored":"2017-09-20T09:55:52.880Z", "personaIdentifier":"59c23b27f6463f3569446bc5", "completedForwardingQueue":[ ], "pendingForwardingQueue":[ "59a8005292303c1af05ec970" ], "failedForwardingLog":[ { "message":"Error: Status code didn't return 200", "statementForwarding_id":"59a8005292303c1af05ec970", "timestamp":"2017-09-20T09:55:56.378Z", "_id":"59c23b2c53631c67de0cd622" } ], "deadForwardingQueue":[ ], "processingQueues":[ ], "completedQueues":[ "STATEMENT_QUERYBUILDERCACHE_QUEUE", "STATEMENT_PERSON_QUEUE", "STATEMENT_FORWARDING_QUEUE", "STATEMENT_JOURNEY_QUEUE" ], "person":{ "display":"Dave20 - http://www.dave.com (xAPI Account)", "_id":"59c23b2753631c67de0cd5b9" } }, { "_id":"59c23b29d138e44a720041b1", "lrs":{ "_id":"5943782ac3f34065c7b4132a" }, "lrs_id":"5943782ac3f34065c7b4132a", "organisation":"59198183d8ea540933227033", "client":"592433ebce79a40338e0d8c4", "client_id":"592433ebce79a40338e0d8c4", "statement":{ "id":"3cbc7fc4-a755-4eff-b2c4-a03c99f336d3", "timestamp":"2017-09-20T09:55:53.799200+00:00", "stored":"2017-09-20T09:55:53.799200+00:00", "authority":{ "name":"New Client", "mbox":"mailto:hello@learninglocker.net", "objectType":"Agent" }, "object":{ "id":"https://acorncorp.com/training/Introduction", "definition":{ "name":{ "en-GB":"Introduction" }, "type":"http://adlnet.gov/expapi/activities/course" }, "objectType":"Activity" }, "verb":{ "id":"http://adlnet.gov/expapi/verbs/commented", "display":{ "en-GB":"commented" } }, "result":{ "score":{ "min":0, "max":100, "raw":67, "scaled":0.67 } }, "actor":{ "account":{ "homePage":"http://www.dave.com", "name":"Dave20" }, "objectType":"Agent" }, "version":"1.0.0" }, "active":true, "voided":false, "timestamp":"2017-09-20T09:55:53.799Z", "stored":"2017-09-20T09:55:53.799Z", "personaIdentifier":"59c23b27f6463f3569446bc5", "completedForwardingQueue":[ ], "pendingForwardingQueue":[ "59a8005292303c1af05ec970" ], "failedForwardingLog":[ { "message":"Error: Status code didn't return 200", "statementForwarding_id":"59a8005292303c1af05ec970", "timestamp":"2017-09-20T09:55:57.674Z", "_id":"59c23b2d53631c67de0cd624" } ], "deadForwardingQueue":[ ], "processingQueues":[ ], "completedQueues":[ "STATEMENT_PERSON_QUEUE", "STATEMENT_QUERYBUILDERCACHE_QUEUE", "STATEMENT_JOURNEY_QUEUE", "STATEMENT_FORWARDING_QUEUE" ], "person":{ "display":"Dave20 - http://www.dave.com (xAPI Account)", "_id":"59c23b2753631c67de0cd5b9" } } ] } ], "completedAt":"2017-09-20T09:56:02.443Z", "isCompleted":true }, "journey":{ "_id":"59c23527bdf9ac67b2ab5ee6", "createdAt":"2017-01-01T00:00:00.000Z", "updatedAt":"2017-09-20T09:55:24.715Z", "description":"5 comments and 1 completion of a course", "owner":"59198183d8ea540933227030", "organisation":"59198183d8ea540933227033", "__v":2, "isPublic":true, "recalculateStatus":{ "remainingCount":0, "totalCount":0, "inProgress":false }, "trackBy":"actor", "isRepeatable":false, "isSequential":true, "outcomes":[ { "description":"POST to my endpoint", "callback":"https://requestb.in/t6lzcgt6", "_id":"59c237bebdf9ac67b2ab5ee8", "type":"callback", "isActive":true, "tripCount": 0, "deactivatedAt": null }, { "_id":"59c23b00bdf9ac67b2ab5eeb", "callback":"http://mockbin.org/bin/3bc290d4-9185-455f-8799-160aed03398e", "description":"Another post endpoint", "type":"callback", "isActive":true, "tripCount": 5, "deactivatedAt": null } ], "waypoints":[ { "conditions":{ "statement.verb.id":"http://adlnet.gov/expapi/verbs/commented" }, "order":0, "_id":"59c237bebdf9ac67b2ab5eea", "count":5, "isActive":true, "description":"5 comments", "id":"59c237bebdf9ac67b2ab5eea" }, { "conditions":{ "statement.verb.id":"http://adlnet.gov/expapi/verbs/completed", "statement.object.definition.type":"http://adlnet.gov/expapi/activities/course" }, "order":1, "_id":"59c237bebdf9ac67b2ab5ee9", "count":1, "isActive":true, "description":"1 course completion", "id":"59c237bebdf9ac67b2ab5ee9" } ], "sources":[ "111aaa1111a111111aa11111", "111aaa1111a111111aa11112", "5943782ac3f34065c7b4132a" ], "isActive":true }, "completedAt":"2017-09-20T09:56:02.443Z" }

RECALCULATE STATUS

Name

Type

Description

Name

Type

Description

inProgress

Boolean

Is the journey currently being recalculated

totalCount

Number

Total number of statements to process

remainingCount

Number

Total amount of statements left to process

EXAMPLE POST DATA

{ "createdAt": "2017-01-01T00:00:00Z", "updatedAt": "2017-01-02T02:00:00Z", "description": "5 comments and 1 completion of a course", "isActive": true, "sources": ["111aaa1111a111111aa11111", "111aaa1111a111111aa11112"] "waypoints": [ { "description": "5 comments" "isActive": true "conditions": "{\"statement.verb.id\": \"http://adlnet.gov/expapi/verbs/commented\"}" "count": 5 "order": 1 }, { "description": "1 course completion" "isActive": true "conditions": "{\"statement.verb.id\": \"http://adlnet.gov/expapi/verbs/completed\", \"statement.object.definition.type\": \"http://adlnet.gov/expapi/activities/course\"}" "count": 1 "order": 2 }, ], "outcomes": [ { "description": "POST to my endpoint", "isActive": true, "type": "callback", "callback": "http://example.org/myPOSTcallbackURL/", "tripCount": 0, "deactivatedAt": null } ] "isSequential": true, "isRepeatable": false, "trackBy": "actor", "isPublic": true, }

Journey Recalculation HTTP Interface

This interface provides API access to the function we use to recalculate the journey. Requests to this interface should look something like the request below.

POST http://www.example.org/api/recalculatejourney?journeyId=dfb7218c-0fc9-4dfc-9524-d497097de027 Content-Type: application/json Authorization: <YOUR_BASIC_AUTH_TOKEN>

The interface will respond with a response similar to the one below after the start of recalculation a matching journey.

Cancel Journey Recalculation HTTP Interface

This interface provides API access to the function we use to cancel the recalculation of the journey. Requests to this interface should look something like the request below.

The interface will respond with a response similar to the one below after the start of canceling recalculation a matching journey.

 

Learning Locker and the Squirrel logo are trademark of Learning Pool 2020 | Learning Locker is licensed under GPL 3.0.