Skip to main content
Version: LOC v0.10 (legacy)

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.

tip

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

See: Create a Configuration

First create an HTTP agent configuration for your LOC instance itself:

ParameterValue
Agent Configuration NameName of the config (for example, LOC)
TypeHTTP Agent
SchemeHttps
HostYour LOC base URL (for example: api.******.fst.network)
Port443
AuthorizationNo Auth

Create Logic

See: Create a Generic Logic

Create all logic described in the previous page.

Create Project, Scenario and Data Processes

See: Build the Data Process

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

See: Add a Configuration to a Linked Logic

While adding the loc-cafe-invoke-deliver-order-dp logic (#4 of placeOrderDP), add the HTTP agent configuration from above:

ParameterValue
Agent Configuration Referenceloc
Agent Configuration NameName 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:

ParameterValue
Nameloc-cafe-deliver-order-api-route
Valueloc-cafe/deliver-order
note

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

ParameterValue
API Route NameName of the API route (for example, loc-cafe-place-order)
HTTP MethodPOST
URL/loc-cafe/place-order
Response Content TypeJSON
Linked Data ProcessesplaceOrderDP

API Route #2

ParameterValue
API Route NameName of the API route (for example, loc-cafe-deliver-order)
HTTP MethodPOST
URL/loc-cafe/deliver-order
Response Content TypeJSON
Linked Data ProcessesdeliverOrderDP

Test Execution

See: Invoke a Data Process with API Route

With all the assets in place, you can invoke the data processes with one of the following approaches:

  1. Invoke API route loc-cafe-place-order with a HTTP POST request and the JSON payload using a HTTP client.
  2. Use manual trigger to run the data process placeOrderDP.
warning

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):

event-filter

Now you can drag all relevant events around and inspect their lineage:

View full size image

loc-cafe-lineage

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é.