Working with Wait for Variable Update Process

Navigation:  How to Work with Processes > Working with the Branch Processes Group >

Working with Wait for Variable Update Process

Previous pageReturn to chapter overviewNext page

 

Process Purpose

 

The "Wait for Variable Update" process is used by the background procedure to track if a background variable has been updated by the main thread. This process will not return the value of the background variable, it will, simply, notify the background procedure that the variable was updated.

This process is particularly useful to establish a background procedure's workflow, meaning, you can define where the workflow should proceed to depending on the update (or not) of the intended background variable.

Ex: If you have a background variable that is meant to receive a specific value, such as a time stamp, you can use the "Wait for a Variable Update" to send the workflow to a defined Label with a set of processes as soon as the background variable is updated with the time stamp.

 

When a given background procedure is executed as an "application service", this process can be used as a short "waiting point" before initiating a new iteration of the service. While in this "waiting point", the background procedure can decide to continue to run, abort or execute another action depending on the background variable's update.

This process is ONLY used within the "Background Procedures" module.

Check the example for this process at the end of this topic.

 

Best practice for a project that intends the main thread to be responsible for the assignment/update of the values contained in background variables, is NOT to have these background variables updated within the background procedure's business logic.

 

 

When you add a process, you are required to define its settings. This occurs in the process's properties window which is displayed automatically after having added the "Wait for Variable Update" process.

If any subsequent edition is required, double-click the process to open its properties window and enter the necessary modifications.

 

 

Fill in the following options:

 

On Variable Update...Go to

Variable column

Click and select the variable you want checked for updates.

Go to column

Select a target destination, from the drop-down or list, for when the selected variable is updated. See Detail of a window below.

Max. Wait Time (Seconds)

Define how long to wait for the variable update. Select an entry from the drop-down OR  click and select the variable with the intended value.

This drop-down is only active after the option "On Time Out Go to" is checked.

Select a target destination for when the defined time out is completed without an update, from the drop-down or list. This drop-down is only active after the option "On Time Out Go to" is checked.

 

Detail of a window:

 

 

"S:Menu" is a screen included in the same program as the process.

"R:Routine_1" is a routine included in the same program as the process.

 

Use the editing icons to the right of the table to move the rows up and down and to delete or add more rows.

 

If required, click to attach any relevant notes to this process. Click it and enter your notes in the resulting text box. These notes will be displayed in the corresponding "Actions" tab or "Process" window (in the "Notes" field) and in the "Developer Report".

 

After filling in the required options, click to conclude or to abort the operation.

The added process is displayed in the corresponding "Actions" tab or "Process" window.

 

 

 

If you want to use a label as a target destination, you can use the "Auto-Label" mechanism. This alternative to the "Set Label" process allows you to create a label in the properties window of a process - specifically, in the fields used to define target destinations (ex: the "If Error..." type fields).  See To Automatically Create a Label.

 

 

Use the right-click in MCL-Designer's input boxes to access some related options as well as the general "Cut", "Copy"; "Paste"; "Search" actions (active/inactive according to the current context).

Ex: If you right-click the "Variable" input box (included in a "Conversion's" properties window), you are provided with general editing/search actions and other more specific options such as "Variable Select" (see "Variable Select");"Variable Insert" (see "Variable Insert"); "Insert Special Character" (see To Insert Special Characters into a Control's Text Input Field) and "Localization Select" (see Localization List).

If you right-click another input box, it may provide other possibilities.

 

 

 

Click Here for an Example on the Use of a "Wait for Variable Update" Process