Create A Function
Primary Actor: Advanced User
Trigger
The user wants to use a specific, not included function to solve a given task.
Preconditions
- The user is logged in.
Main success scenarion
- The user clicks on “Switch to Developer Suite”.
- The user confirms the warning pop-up to enter the advanced section Developer Suite.
- The user switches to the second tab “Manage Functions”.
- The user switches to the second sub-tab “Create a new Function”.
- The user unlocks the protection mode to enter the edit mode.
- The user specifies general information about the function, information about the result of the function and specifies fields.
- The user saves and finishes the Function creation process.
Postconditions
- The Function is added to the database.
- APIs can be added for the function which allows the user to use the Function in the Routine building process.
Evaluation
Task
You, as an advanced user, want to add a function for retrieving the temperature of your Smart Home thermometer to your account. The new function should have the following characteristics:
Function name: thermometer_temperature
Category: IoT
Function label: Thermometer Temperature
The result is a floating point number.
The result should have some arbitrary result ID, be labeled as Temperature
and have the help text This result contains the temperature of the choosen thermometer.
.
The function should have the following fields:
- A field should specify the exact thermometer by its number with the label
Thermometer Number
and the helptextSpecify the thermometer by its numeric id.
. - A field should specify whether the temperature should be in Celcius or Fahrenheit by a boolean value with the label
Temperature Unit
and the helptextSpecify the unit of the temperature. Checked means Celcius and Unchecked means Fahrenheit.
.
Further Tasks
Navigate to the next task (Edit Function) or go back to the previous task (Create Routine).
Control criteria for current task
Show solution
A new Function is created correctly at the users account. The saved Function will look like this in the database after a succesful save (in JSON form):
{ "category": "IoT", "function_name": "thermometer_temperature", "function_label": "Thermometer Temperature", "result": { "name": "result", "label": "Temperature", "type": "number", "help_text": "This result contains the temperature of the choosen thermometer." }, "fields": [ { "name": "1", "type": "number", "label": "Thermometer Number", "required": true, "help_text": "Specify the thermometer by its numeric id." }, { "name": "2", "type": "text", "label": "Temperature Unit", "required": true, "help_text": "Specify the unit of the temperature. Checked means Celcius and Unchecked means Fahrenheit." } ] }