When designing your eSpace, you can create your own actions that can be invoked in any action flow or even used in expressions (if they're defined as User Functions). These actions are called User-defined Actions.
This topic also applies to Web Service methods.
A User-defined action can have input parameters, output parameters and local variables.
You have a specific editor to design the behavior of user-defined actions, that is, their action flow. In this editor, you can select any tool available in the Action Flow Toolbox to be executed in the action flow of your User-defined action.
A user-defined action flow normally terminates with an End element. You can have more than one End element in the action flow.
When editing expressions in your user-defined action flow, you have access to the following elements in the scope:
Input parameters, Output parameters and local variables defined in the user-defined action;
Queries invoked in the user-defined action;
Execute Action output parameters of the user-defined action. To use them in, for example, an Assign element, the Execute Action must precede the Assign in all paths to the Assign element in the user-defined action flow.
Anyway, when you're editing your user-defined action flow, all the elements available in the scope are present in the Scope tree of the Expression Editor, in a case where you're editing an expression; or in the variables tree of the Select Variable window, in a case where you're trying to use a variable.
A User-defined actions is explicitly invoked in an action flow by dragging it from the Logic tab of the eSpace Tree or, alternatively, by dragging the Execute Action tool from the Action Flow Toolbox and choosing the user defined action from the list.
A user-defined action can be executed in a screen action, in a screen preparation, in another user-defined action, or in a web service method. How?
There is a special type of actions that are used to handle System Events. The behavior of these actions is designed by you and they're executed when the System event occurs, though they can be executed just like any other User-defined action with the following differences:
OutSystems Platform provides you with mechanisms to reuse User-defined Actions among application modules. You can expose your User-defined actions to other modules or use User-defined actions defined in another module.
If you define a User-defined Action as a function, you can also use it in expressions. Therefore, it is available in the User Functions folder in the Scope tree of the Expression editor.
To improve the runtime performance of your User-defined Actions, Service Studio provides you with the following advanced techniques:
Action Properties | Create an Action | Action Flow Editor | Overview of System Events | Expose an Action | Use an Action Reference | Expose an Action as a User Function | Use User Functions