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.

How to Create a User-defined Action

  1. In the eSpace tree, under the Logic layer, right-click on the Actions folder and select Add Action;
  2. Rename it as desired. Service Studio automatically opens the action flow on the Content Canvas. Design the behavior of the action.

A User-defined action can have input parameters, output parameters and local variables.

Flow of a User-defined Action

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.

User-defined Action Scope

When editing expressions in your user-defined action flow, you have access to the following elements in the scope:

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.

Executing a User-defined Action

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?

System Events Actions

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:

Using User-defined Action References

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.

Using User Functions

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.

Improving Runtime Performance

To improve the runtime performance of your User-defined Actions, Service Studio provides you with the following advanced techniques:

See Also

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