Configure the robot commands to point to the tasks
Implementing your robot in small increments and testing it often is important. We know our robot needs to do 2 things: produce and consume. We are going to define 2 tasks that do exactly that:
You try running the robot and your robot, surprinsingly, passes:
This is the first time you have more than one @task
defined and you want to understand how this works.
Both of your tasks ran, one after the other.
You open the robot.yaml
file.
You notice a general command that runs everything it finds in tasks.py
file.
You want a finer control so you modify it so that it points to the tasks that you previously defined.
You create two entries, each with it's descriptive name for your tasks.
The
-t
flag shows that we refer to a@task
method followed by the actual name of the method. This way each task runs under it's specific and suggestive name:
You rerun the robot, and the Robocorp extension asks what task you want to run. You run both of the tasks, and they (should) pass. Great!