The Client Services Designer is used to create client-side services for your application. In this app, you will be creating a Client Service to call the Modeler flow that you created in the previous step. The Modelr will get the data from the weather API provider and sends it back to the Client Service flow.
Perform the following steps:
Double click the node to open its Attributes window. Add the following details:
Property | Value | Action |
Name | get weather modelr |
|
Function Name | getWeatherModelr | |
Input Properties -> Key | cityName | Click + to add the property to the list. |
Local Properties -> Key | currentWeather | Toggle Output to true. Click + to add the property to the list. |
Local properties -> Key |
modelrApiUrl |
Click + to add the property to the list. |
The currentWeather property is used to capture the result returned by the Modeler flow. It is set as an output property and can be accessed outside the flow.
Property | Value |
Name | cityNameNullCheck |
Property -> bh.input | cityName |
Condition | Value |
is of type | undefined |
is null |
|
is empty |
|
is of type | string |
Property | Value |
Name | log bh |
Log | bh.
|
Property | Value |
Name | construct api url |
Code Editor |
bh.local.modelrApiUrl = `http://localhost:24483/api/weather?cityName=${bh.input.cityName}`;
|
Property | Value |
Name | call modelr flow |
Method |
Get
|
URL | Select the bh.local property, and enter modelrApiUrl as the value. |
Return Type | JSON |
Body | bh.input. |
Result Mapping | bh.local.currentWeather |
Property | Value |
Name | log modelrApi |
Log | Select bh.local property, enter modelrApiUrl as the value |