Working with Trigger Action Process
Process Purpose
It is possible to associate a custom action to a background procedure to retrieve specific information and, then, share it with the foreground. See Custom Actions.
The "Trigger Action" process is used in the background (within a background procedure running in a secondary thread) to notify the foreground program that the specified custom action has information to be retrieved (the required custom action is called in the intended screen). See To Add a "Custom Action" to a Screen.
If required, the process can, also, be used to assign values to the selected custom action's parameters.
This process is ONLY active within the "Background Procedures" module.
Check the example for this process at the end of this topic.
The "Trigger Action" process is meant to be used as follows:
1. The "Trigger Action" process is added to a background procedure (to its "Procedure" tab) to notify the foreground that the referenced custom action can be triggered onto a screen.
2. The custom action is added, in the foreground, to the screen that is meant to handle the information and trigger the required business logic (processes). See To Add a "Custom Action" to a Screen.
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 "Trigger Action" 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:
Action |
|
Name |
Select a custom action from the drop-down (it provides all the custom actions) OR click to create a new custom action or edit an existing one. |
Send Parameters |
|
Name column |
Not editable. Displays the selected custom action's parameters which are defined in the "Parameters" tab of a custom action's properties window. |
Value column |
If required, enter a value for the custom action's parameter to be shared with the foreground OR click to select a variable with the intended value. |
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.
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 of a "Trigger Action" Process
Foreground Context:
The intended custom action must be created beforehand (see To Define a Custom Action in a Project), so it is available for the intended background procedure. This custom action ("MyAction_1") includes 2 parameters ("Param1" and "Param2").
Background Procedure Context:
The background procedure ("Background_Procedure_1") must include a "Trigger Action" process that references the required custom action ("MyAction_1") in its "Procedure" tab. In this case, the "Trigger Action" process assigns values to the defined custom action's parameters - "Param1" is fed with a value contained in the "B_Param_1_Value" background variable and "Param2" is set with the value "300".
Due to the "Trigger Action" process, the foreground program is notified that there is information to be retrieved from the "MyAction_1" custom action. The actual data retrieval is executed by the program running in the foreground, specifically, in the intended screen. m Foreground Context (a running program):
The custom event ("MyAction_1") is added to a screen of the running program. For instance, it can be added to the screen that calls the background procedure ("Background Procedure_1"). The values from the selected custom action's parameters are, automatically stored into predefined local variables to be managed in the foreground. Ex: The "Param1" parameter of "MyAction_1" will generate a local variable (in the foreground) named "L_Param1" to take in its value. In this case, this custom action will also trigger the business logic (processes) added to the screen (the "Variable Assign" and "Message Box" processes).
|