Queues - ResgreenGroup/Botway-Documentation GitHub Wiki
Current Location: Home->Customizing BotWay->Queues
Job queues are the way BotWay distributes jobs to robots. A job is a requested route to be executed by the next available robot. When a job is added to a queue, BotWay gives the job to a robot that is waiting at one of the queue's stations. Stations are tags; when robots are held at stations, BotWay distributes a job from the station's associated queue. When a robot receives a job, its route changes and it will either embark immediately, or it will wait in a "Staged" mode until an external source sets the job to "active."
Queues can be added, removed, or modified from the "Queues" menu. Log in as Admin, then click "Edit," click "Options," then click "Queues" from the dropdown menu. This opens a dialogue window to interact with queues, shown below. The Queue Configuration Dialogue window is split in half. The top half is called "Queues" and the bottom half is called "Stations." The Queues half allows for creating, modifying, and deleting queues. These actions are associated with the "Add," "Edit," and "Remove" buttons along the top of the section.

Figure 1: Queue Configuration dialogue window
-
"Add:" The "Add" button will enable the two fields on the right side of the Queues section. Fill in the name of the queue in the "Name" field, then select how jobs will be distributed from the "Type" dropdown menu. "List" mode distributes jobs to the first available station in the order they are listed; a station is available if a robot is held at it. "Random" type will distribute jobs randomly among available stations. "RR"(Round Robin) type queues give robots priority based on how recently they took a job; when a robot receives a job, it moves to the bottom of the priority list. To finalize the new queue, click the "Save" button.
-
"Remove:" The "Remove" button is disabled until an existing queue is selected from the list on the left side of the window. Selecting a queue and clicking "Remove" will open a confirmation window to verify deletion. Click "Yes" and the queue will be deleted.
-
"Edit:" Select a queue and press the "Edit" Button to change its name or its list type, then press save in the toolbar at the top of the dialogue window.
-
"Cancel:" The "Cancel" button is used to reverse changes to a queue in the process of being modified; after the "Edit" button has been clicked, press the "Cancel" button to exit out of queue modification without saving changes.
The "Stations" half of the dialogue window allows for assignment of stations to each queue. A queue can have multiple stations associated with it, and a tag can be a station for multiple queues. Stations are combinations of tags and return routes. When a robot is assigned a job, BotWay keeps track of the station where the robot took the job from. In the route table, it is possible to create a line with the robot set to BotWay; this is done to manage staging data and return routes. See the routes section for information about BotWay commands. The BotWay command will be associated with a tag; whenever a robot gets to this tag and there is a BotWay command of "return," BotWay will check for the station that the robot took the job from and change that robot's route to the return route. A return route should be a route that directs the robot from wherever the return command is issued to the station where it takes jobs from.
-
"Add:" Select a queue from the top half of the dialogue window to display its stations in the bottom half of the window. For a new queue this lower window will be empty. Click the "Add" button to enable the fields on the right side of the "Stations" section. Enter the name of the tag and the return route in the associated fields. BotWay uses return routes to send robots from wherever a job is completed back to the station to take another job.
-
"Edit:" Select a queue, then select a station in the "Stations" window, then click the "Edit" button to change the tag name or return route. Finally, click "Save" in the toolbar of the "Stations" section.
-
"Remove:" Select a queue, then a station, then the "Remove" button in the "stations" toolbar to remove a station. A confirmation window will appear to verify deletion.
-
"Priority:" Select a queue, then a station, then click the "Priority" button to switch the positions of the selected station and the station above it. This changes the order in which BotWay checks station availability when distributing jobs.
-
"Cancel:" The "Cancel" button is used to erase a station in the process of being created; after the "Add" button has been clicked, press the "Cancel" button to exit out of station creation without saving changes.
Using a queue requires jobs to be defined. This is done in the Buttons menu for BotWay versions older than 2.7.0. defining a job using a button is described Here. When making a Job Add button, a target queue must be selected. When this button is pressed, it will instruct BotWay to add a job to the target queue. For a description of the Job Queues in the BotWay dashboard, click Here.
For BotWay version 2.7.0 or newer, job definitions have their own dialogue window. Create job definitions here, then assign them in the "Buttons" dialogue window. The effect is the same: when the button is pressed, a job is added to the queue specified by the job definition.
For BotWay versions older than 2.7.0, Jobs are defined in the buttons menu and they are created when a Job Add button is pressed. Job Queues will be filled with jobs. Log in as Admin, go into edit mode and enter the button configuration dialogue window. Then, create a "Job Add-"type button. Most of the fields are filled in using dropdown menus. Specify the device ID, Button number, job type, start route and tag, end route and tag, start status, end status, completor ID and number, and stage time limit.
- The Device ID is the name of the device. BotWay will provide a dropdown menu of all device IDs that are currently known for selection. A device is considered "known" if it successfully connected to BotWay at least once. Removing a device from this list requires going into clientData.xml and removing the device there; there is no way to remove a known device in BotWay, even if the device tile is removed.
- The Number is the individual button on the device. Some devices can have multiple buttons on them. This field specifies which button on a device will be associated with adding a job.
- The Queue field specifies the target queue to assign a job to.
- The job type specifies how exclusive a job will be. There are three choices for this: Concurrent jobs have no restrictions on how many jobs can be queued or how many jobs can be active, exclusive jobs can only have one active and one queued job, and consecutive jobs can have only one active job but many queued jobs.
- The Start Route and start tag fields specify what route the robot is changed to when it receives the job from BotWay and what tag the robot will be receiving the job at.
- The End Route specifies what route the robot must be on in order to complete the job at the end tag. The end tag is the tag where the job is ended and switches from "Active" to "Completed" or "Staged."
- The start status is what the job status changes to when it is assigned to a robot. If this is set to "Active," then the robot will immediately embark on the start route. if this is set to "Staged," the robot will change its route, but not embark until an external source signals BotWay to send the robot.
- Status at End specifies what the job status changes to when the robot reaches the end tag while on the end route. If this is set to "Completed," the robot will become available to take a new job and continue on its way. If this is set to "Staged," BotWay will wait for an external signal to trigger the job completion. This is specified by the "Completor ID" and "Completor #" fields below this field.
- "Completor ID" and "Completor #" specify the device name and button number of the device that completes a job whose status at end is selected to be "Staged" in the previous field. The dropdown menu is filled the same way as the Device ID field at the top of the button creation menu.
- Stage Time Limit specifies a number of seconds that a job can be in the queue before it is considered "Late." When viewing a job queue with the job monitor application, Any job in the queue will be colored according to its status; yellow for staged, green for active, red for late, and grey for no job assigned.
For BotWay version 2.7.0 or newer, all of the previous information is found in a new dialogue window called "Job Definitions," shown below. To get here, log in as admin, click "edit," then "options," then "Job Defs." The information is the same as above, with one additional feature called priority. Priority uses integers from 1 to 10. Lower numbers mean higher priority. When a job is called for by a button, BotWay looks at the priority in the job definition. Jobs with higher priority will be placed above jobs with lower priority. Jobs with equal priority will have no change made to their order when called. To assign a job to a button, log in as admin, click "edit," then "options," then "buttons." create a new button of the type "Job Add." click the dropdown menu and select one of the job definitions to assign to this button. Then click "done," Then click "save."