Implement and Test
We will follow the steps of this article to create, implement and test all assets of the Lakeside Oasis Café use case.
We assume that you would be using Studio for the tutorial. See the CLI Handbook for how to create LOC assets in local editors like VS Code.
Create Agent Configuration
First create an HTTP agent configuration for your LOC instance itself:
Parameter | Value |
---|---|
Agent Configuration Name | Name of the config (for example, LOC ) |
Type | HTTP Agent |
Scheme | Https |
Host | Your LOC base URL (for example: api.******.fst.network ) |
Port | 443 |
Authorization | No Auth |
Create Logic
Create all logic described in the previous page.
Create Project, Scenario and Data Processes
Create a project and a scenario if you don't jave any, then create the two data processes described in the previous page from the logic above.
Set the Agent Configuration
While adding the loc-cafe-invoke-deliver-order-dp
logic (#4 of placeOrderDP
), add the HTTP agent configuration from above:
Parameter | Value |
---|---|
Agent Configuration Reference | loc |
Agent Configuration Name | Name of the config (for example, LOC ) |
Set the Logic Variable (Optional)
While setting up the agent configuration, you can also add a logic variable to specify the API route to invoke in the DP placeOrderDP
, which is handy if you wish to change the API route without modifying the logic and data processes:
Parameter | Value |
---|---|
Name | loc-cafe-deliver-order-api-route |
Value | loc-cafe/deliver-order |
The logic we provided in the previous page will set the API route to loc-cafe/deliver-order
if the logic variable loc-cafe-deliver-order-api-route
is not set (returns null
). So this step is entirely optional as long as the API route is correct.
Create API Routes
See: Create an API Route
Create the two API routes described in the previous page and link the corresponding data processes.
API Route #1
Parameter | Value |
---|---|
API Route Name | Name of the API route (for example, loc-cafe-place-order ) |
HTTP Method | POST |
URL | /loc-cafe/place-order |
Response Content Type | JSON |
Linked Data Processes | placeOrderDP |
API Route #2
Parameter | Value |
---|---|
API Route Name | Name of the API route (for example, loc-cafe-deliver-order ) |
HTTP Method | POST |
URL | /loc-cafe/deliver-order |
Response Content Type | JSON |
Linked Data Processes | deliverOrderDP |
Test Execution
With all the assets in place, you can invoke the data processes with one of the following approaches:
- Invoke API route
loc-cafe-place-order
with a HTTP POST request and the JSON payload using a HTTP client. - Use manual trigger to run the data process
placeOrderDP
.
By the current design of LOC, API routes have a default time out limit of 15 seconds and would return status code 202
even if the data processes are executed normally.
Which means in this use case you may very well see the API route not returning proper finalised results, since the chained data processes would take a bit more than 15 seconds to complete their tasks. But everything else - including the emitted events - would work like it should.
Inspect Data Lineage
After executing the use case, you can inspect the events in Data Discovery (by setting the time range filter to a few minutes ago):
Now you can drag all relevant events around and inspect their lineage:
View full size image
Notice that the item Salad
from order 202 was not assigned to any staff (a broken link). This should be a clear indication that either it's missing from the staff list, or the item information on the ordering page is outdated. Actions can be taken swiftly and you will get yourselve another satisfied customer. Five stars! ⭐⭐⭐⭐⭐
This concludes the use case tutorial of Lakeside Oasis Café.