Use a Workflow to Update Learner Details
Note: Refer to Videos for a video describing the steps featured in this online documentation.
The following example describes how a workflow can be used with REST Services to update learner data.
Note: Refer to REST Services for further information and to ebs REST Documentation for descriptions of each service documented.
To update learner data with a workflow:
-
Open the relevant learner record using Learner Search and make a note of their Person Code.
-
Copy the Web service host URL institution setting (on the General (Cross System) screen).
Note: The URL of your REST Services documentation is stored in the Web service host URL setting on the General (Cross System) screen in Institution Settings.
-
Navigate to your REST services session by pasting the Web service host URL into a browser’s address bar, appending the URL with /docs (that is: http://<web service host URL>/docs).
Note: Refer to Use the Try It Out Functionality for further information about authorising your account.
-
Authorise your REST services session.
-
Click the Tribal Toolbox tab in the REST section of Workflow Builder.
-
Add an HttpGetRequest activity to the sequence to authorise REST Services
-
Drag and drop the HttpGetRequest activity, located in the REST section of the Tribal Toolbox, into the Sequence panel.
-
Enter values for the HttpGetRequest activity by clicking the ellipsis button adjacent to the relevant fields to open the Expression Editor.
Values to update:
-
Accept - the accept header string value (for example: "application/json")
-
Authorization - the authentication value found in the Responses body section of the Authentication REST Service (for example: "Basic 123456789ABCDEFG")
Note: Refer to Use the Try It Out Functionality for further information about authorising your account.
-
URL - the 'Web service host URL' institution setting (located on the General (Cross System) screen) with the authentication service appended (for example: "http://<web service host URL>/Rest/Authentication")
-
ResponseContent - the output response (for example: GetRest)
Note: This output value requires a variable to be set (for example: GetRest, with the variable type, String).
-
StatusCode - the HTTP response code that indicates the status of the call to the web service (for example: Status)
Note: This output value requires a variable to be set (for example: Status, with the variable type, HttpStatusCode).
-
-
-
Add TrackingMessageActivity activities to the sequence to view the output of the authorisation
-
Drag and drop a TrackingMessageActivity activity, located in the Tribal Generic section of the Tribal Toolbox, into the Sequence panel.
-
Enter values for TrackingMessageActivity fields, Key (for example: "Status") and TrackingMessage (for example: Status.toString()).
-
Drag and drop a second TrackingMessageActivity activity into the Sequence panel.
-
Repeat the process for the second TrackingMessageActivity, entering values for Key (for example: "Result GET") and TrackingMessage (for example: GetREST) fields.
-
Set variables for the output values specified in the HttpGetRequest activity.
For example:
-
StatusCode variable example:
-
Name - Status
-
Variable type - HttpStatusCode
-
-
ResponseContent variable example:
-
Name - GetREST
-
Variable type - String
-
-
-
-
Add a ConvertStrringtoJson activity to the sequence to convert the return message from the authentication output into the JSON format
-
Drag and drop the ConvertStringtoJson activity, located in the XML/Json section of the Tribal Toolbox, into the Sequence panel.
-
Enter values for the ConvertStringtoJson activity fields, InputString (for example: "GetREST") and OutputObject (for example: AuthorisationJsonResponse).
-
Set variables for the output value specified in the ConvertStringtoJson activity.
For example:
-
AuthorisationJsonResponse variable example:
-
Name - AuthorisationJsonResponse
-
Variable type - JObject
-
-
-
-
Add a GetJsonFieldValue activity to the sequence to retrieve the token from the ConvertStringtoJson activity in the JSON format
-
Drag and drop the GetJsonFieldValue activity, located in the XML/Json section of the Tribal Toolbox, into the Sequence panel.
-
Enter values for the GetJsonFieldValue activity fields, FieldName (for example: "Token"), SourceObject (for example: AuthorisationJsonResponse), and OutputValue (for example: token).
-
Set Variables for the output value specified in the GetJsonFieldValue activity.
For example:
-
Token variable example:
-
Name - Token
-
Variable type - String
-
-
-
-
Add an HttpPutRequest activity to the sequence to specify the relevant update criteria
-
Drag and drop the HttpPutRequest activity, located in the REST section of the Tribal Toolbox, into the Sequence panel.
-
Enter values for the HttpPutRequest activity.
Values to update:
-
Accept - the accept header string value (for example: "application/json")
-
Authorization - the output response value stored in the OutputValue field in the GetJsonFieldValue activity (for example: token)
-
ContentType - the content type header (for example "application/json")
-
Payload - the payload or content of the request (for example "{'ForeName': 'John'}")
-
URL - the 'Web service host URL' institution setting (located on the General (Cross System) screen) with the REST service and the learner's Person Code appended (for example: "http://<web service host URL>/Rest/People/{personCode}")
-
ResponseContent - the output response (for example: PostResponse)
Note: This output value requires a variable to be set (for example: PostResponse, with the variable type, String)
-
StatusCode - the HTTP response code that indicates the status of the call to the web service (for example: PostStatus)
Note: This output value requires a variable to be set (for example: PostStatus, with the variable type, HttpStatusCode)
-
-
-
Add TrackingMessageActivity activities to the sequence to view the output from the update
-
Drag and drop a third TrackingMessageActivity activity, located in the Tribal Generic section of the Tribal Toolbox, into the Sequence panel.
-
Enter values for TrackingMessageActivity fields, Key (for example: "Status") and TrackingMessage (for example: PostStatus.toString()).
-
Set variables for the output values specified in the HttpPutRequest activity.
-
Drag and drop a fourth TrackingMessageActivity activity into the Sequence panel.
-
Enter values for TrackingMessageActivity fields, Key (for example: "Response") and TrackingMessage (for example: PostResponse).
-
Set variables for the output values specified in the HttpPutRequest activity.
For example:
-
ResponseContent variable example:
-
Name - PostResponse
-
Variable type - String
-
-
StatusCode variable example:
-
Name - PostStatus
-
Variable type - HttpStatusCode
-
-
-
-
Click Save.
Your workflow sequence will now include the following activities in order:
-
HttpGetRequest - authenticates use of the REST Service
-
TrackingMessageActivity - the authenticated tracking activity status output
-
TrackingMessageActivity - the Result GET tracking activity output
-
ConvertStringtoJson - converts the return message from the authentication output into the JSON format
-
GetJsonFieldValue - retrieves the token from the ConvertStringtoJson activity in the JSON format
-
HttpPutRequest - specifies the relevant update criteria and REST Service
-
TrackingMessageActivity - the update people tracking activity status output
-
TrackingMessageActivity - the Response tracking activity output
Your sequence will now include the following variables:
-
PostStatus - HttpStatusCode
-
PostResponse - String
-
GetREST - String
-
Status - HttpStatusCode
-
token - String
-
AuthorisationJsonResponse - JObject
You can now trigger the workflow and use the User Tracking tab to ensure that the learner is updated.
Note: You can use Learner Search to verify that the update was successful.
-