Create Routine
Primary Actor: Standard User
Trigger
The user wants to create a new Routine.
Preconditions
- The user is logged in.
 - The user added one or more Functions and one or more APIs to the platform.
 - The user has an user account.
 
Main success scenarion
- The user clicks on “Add routine”.
 - The user enters a routine name and confirms.
 - The user clicks on “Add a new condition”.
 - The user selects the “timer” category and the “routine start time” condition.
 - The user specifies a start time, the weekdays and timezone.
 - The user adds a combination of custom conditions and operations.
 - The user confirms and finishes the routine creation process.
 
Evaluation
Task
Create a routine that holds the following components:
- Timer condition
 

- A stock price search of “Apple”
 

- An email containing the stockprice search result, a subject and a recipient
 

Further Tasks
Navigate to the next task (Create Function).
Control criteria for current task
Show solution
A routine is saved correctly at the users account. The first component is a timer condition. The second component is the Finance operation "Stockprice by Company Name" with "Apple" in the field "Company Name" and a result variable starting with a "$". The third component is a messaging operation "Send Email" with a valid email address and an arbitrary subject and message text with at least on containing the stock price result variable starting with a "$". The routine JSON of one possible solution would look like this:
{
    "url": "http://master.gsq.ro/api/routine//",
    "id": "",
    "components": [
        {
            "category_name": "timer",
            "function_name": "start_at",
            "type": "condition",
            "parameters": {
                "weekday": [
                    "monday"
                ],
                "timezone": "Europe/Berlin",
                "time": "12:00"
            }
        },
        {
            "category_name": "Finance",
            "function_name": "stock_price_by_name",
            "type": "operation",
            "parameters": {
                "company_name": "Apple"
            },
            "result": "$"
        },
        {
            "category_name": "Messaging",
            "function_name": "send_email",
            "type": "operation",
            "parameters": {
                "recipient": "test@email.com",
                "subject": "Current Apple Stock price",
                "content": "This is the current stock price of Apple: $result_variable"
            },
            "result": "$"
        }
    ],
    "routine_name": "test",
    "state": "standby",
    "created_at": "2020-08-T::<sec,ns>Z",
    "updated_at": "2020-08-T::<sec,ns>Z"
}
</pre></p>
</details>