Adding a New Branch
Scenario Objective
Enhance your scenario by adding a new branch that allows you to stop the music. In this branch, you will:
- Use a voice command (e.g., "Stop the alarm clock") to stop the scenario.
- Include a test to check if the alarm is already active and, if so, stop it.
- Update the scenario parameters so that the rule call can effectively stop the music.
Steps to Add the New Branch
-
Add a New Branch:
Click theStartbutton in the Actions tab to add a new branch to your scenario.
-
Configure the
CalendarNode:
Set theCalendarnode to use a voice rule and add the rule "Stop the alarm clock".
-
Add
JavascriptNodes:- Insert a
Javascriptnode between theCalendarscheduled node and theSpeaknode. - Add a
Javascriptnode into the new branch.

- Insert a
-
Configure the
JavascriptNode:
Set up theJavascriptnodes to test whether the alarm is active and stop it accordingly.
-
Close the New Branch:
Connect theJavascriptnode to theendnode to complete the branch.
With this new branch, your scenario can now be stopped via a voice command, effectively stopping the music and ending the alarm when required.