Skip to main content
Skip table of contents

Using Action Script

By adding class operations, you can model the behavior of the classes from the data model. For class operations, you can select from different types of implementation: Action Script (explained on this page), Mapping Diagram (refer to Modeling Data Mapping for more information), Activity Diagram (refer to Modeling Activities for more information), and JavaScript (refer to Using JavaScript for more information).

The xUML Action Language is a script like language that you can use in class operations to implement atomic actions like manipulating strings, arrays, and so forth. Such class operations are called action script.

Refer to Action Script Language for a comprehensive documentation of all elements of the xUML Action Language.

Creating an Operation Containing Action Script

Via a Quick Action

The fastest way to create an Action Script operation is via the quick actions of the related class. Hover over the class you want to add the operation to, and use quick action Add Action Script Operation:

Assign a name to your new action script and click Save:

grafik-20250522-065618.png

The Action Script editor opens in a new tab:

grafik-20250522-070528.png

You can now add action script. Your entered Action Script is saved and validated in the background:

grafik-20250522-070630.png

Expert Advice

Use option Go to documentation to jump to the documentation of the Action Script Language for detailed information about the usage of Action Script:

grafik-20250522-070747.png

This documentation contains helpful basic information such as

Via the Context Menu

Alternatively, you can add a class operation via the context menu of a class, and create an implementation afterwards. Right-click the class you want to add an operation to and select Add Operation from the context menu:

The dialog Add Operation opens. Select Action Script from the drop-down list, enter a name for the operation and click Save:

grafik-20250522-070823.png

The new operation has been added to the class. The Action Script editor opens automatically in a new Designer tab, and you can start entering Action Script (see above).

Refer to Working with the Action Script Editor for detailed information.

Once the operation has been created, you can use the quick actions and the context menu to manage it:

You can:

  • add parameters

    • in

    • out

    • return

  • add a suboperation

  • open the implementation of the Action Script

  • change the implementation from Action Script to activity diagram or mapping diagram

  • cut the Action Script operation

  • copy the Action Script operation

  • paste the Action Script operation (available if Copy or Cut option have been used before)

  • rename the Action Script operation

  • delete the Action Script operation

Refer to Implementation and Modeling Data Structures for more information on your options.

Attributes of an Action Script Operation

Select an Action Script operation in the Implementation folder of the service panel to display its attributes in the Attributes panel. You can also edit them there:

grafik-20250522-071053.png

Action script operations have the following attributes:

Attribute

Description

Possible Values / Example

Name

Click here to change the Name of the related element.

Action Script operation names must follow certain naming rules. They

  • must not contain blanks

  • must not start with a number

  • must not contain special characters

getApproved

Description

If you want to insert or change a description for the respective Action Script operation, click here to open a text editor where you can enter and format your text.

Is Static

Specify if the operation is static (default) or not.

  • Static Action Script operations can be called without creating an instance of the related class. They get all necessary data via their input parameters.

  • Wanting to call a non-static Action Script operation, you need to create a local instance of the related class, and call the operation on that object. This is called self Context.

For more information, also refer to Adding Operation Calls.

true

The Action Script operation is static (default) and can be used outside the context of the related class.

false

The Action Script operation is non-static and needs a self object as an input.

Extensions

By clicking Add, you can add extensions to an Action Script operation.
By adding an extension, you can add additional attributes to an Action Script operation.

REST

Related Content

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.