Call Function
The Call Function construct is used to invoke and execute Function within an event or another function. This construct enables modularization and promotes code reusability, allowing for structured and organized logic. It improves efficiency and maintainability.
Steps to Add a Call Function Construct in an Event Flow
- Drag and Drop: In the designer canvas of an event flow, drag and drop the Call Function construct into the flow.
- Configure Properties: Double-click the construct to configure its properties as required and then click save.
Properties
| Property | Description | Comments |
|---|---|---|
| Label | Labels help developers quickly understand each step in the logic flow without examining the details of the construct. | It is recommended to provide a simple precise label that improves the logic flow readability. |
| Function* | The name of the Function to be executed, selected from a drop-down list. | |
| Input Parameters | The required parameters to pass into the function using the Expression Builder. | Ensure that all input parameters are assigned with value. |
| Execution Mode* | Defines how the Function executes: | Sequential – Executes in order and waits for completion. Async – Executes independently without waiting for completion. |
| Activity Handle* | Unique identifier required for Asynchronous execution. | This field is visible only if Execution Mode is set to async. This will be awaited when required. |
| Output Mapping* | Select Output mapping from the list. It displays properties based on the output parameter type of the selected function. | All existing parameters in the Function flow are loaded if they match with the data type of the selected function output parameter. |
| Comment | Specify whether to comment this construct or not. Either Yes or No. | If marked as Yes, the construct is treated as a commented expression and ignored in code generation. |
| Description | Provides details about the Call Function purpose and behaviour. | Helps in understanding Call Function Construct significance. |
Note: Properties marked with an asterisk (*) are mandatory for configuring the Call Function construct.
Upon successfully adding the Call Function construct, a confirmation message is displayed.
Output Mapping params is loaded based on the Function output parameter data type.
| Flow Name | OutputMapping Params |
|---|---|
| Event | Models, Appcontext and Variables |
| Subscriptions | Models, Appcontext and Variables |
| Component Event | Models, Appcontext and Variables |
| Component Subscriptions | Models, Appcontext and Variables |