Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from space WDESIGNER and version 24.1

Image Removed

When you decide to create

When creating class operations to your own data model in the

Designer

Implementation folder, you can

choose between two

select from the following different types of implementation

for your class operations

:

  • Action Script:The usage of action script is explained on this page.
  • JavaScript: For more Information about the usage of java script refer to Using JavaScript.
  • Mapping Diagram:

Go
  • Refer to

page for detailed information.

Adding Action Script

  • for more information about mapping diagrams.

  • Activity Diagram: You can implement class operations by a UML activity diagram. Refer to Modeling Activities for more information on activity diagrams.

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.

Tip

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.

Image Added

Hover over the class you want to add the operation to, and click the Add Action Script Operation quick action (Image Added).

Image Added

Image Removed

If you want to add action script, right click on the operation you want to create an implementation for and choose menu item Create Implementation.

Image Removed

In the pop-up window, select option Action Script and confirm with

Assign a name to your new action script and click

Save.

Image Modified

The Action Script Editor opens in a new tab.The operation icon in the service panel is extended by a blue pointImage Removed, indicating that implementation has been added to the operation. 

Anchor
action_script
action_script

You can now add action script in the editor.

Do not forget to save after you have finished your input.

Tip
titleExpert Advice

We recommend the chapter Click the help icon (Image Added) to jump to the documentation of the xUML Action Language in the xUML Services Reference Guide for detailed information about the usage of action script. This documentation contains helpful basic information such as

The script you have entered is saved and validated in the background.

Div
Stylefloat:left; padding-right: 10px; padding-top: 1.1em; padding-bottom: 1.1em;

Image Removed

Div
Stylepadding-top:1.1em;

You have direct access to this chapter via the help button in the editor. The 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.

Image Added

Right-click the class you want to add an operation to and select Add Operation from the context menu.

Image Added

The dialog Add Operation opens.

Select Action Script from the drop-down list, enter a name for the operation and click Save.

Image Added

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 further above).

Tip

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

Image Added

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

  • add a parameter
    • 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
Tip

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

Attributes of an Action Script Operation

Image Added

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.

Action script operations have the following attributes:

AttributeDescriptionPossible 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
DescriptionIf 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 scriptoperation, 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.

trueThe action script operation is static (default) and can be used outside the context of the related class.
falseThe action script operation is non-static and needs a self object as an input.
StereotypeVia Add Stereotype, you can add a stereotype to a action script operation.
By adding a stereotype, you can extend the attributes of a action script operation with additional properties.
REST

Image Added

When you click in the Action Script Editor, the following attributes of the current action script are displayed in the Attributes panel. All attributes are read-only and cannot be edited there.

AttributeDescriptionExample
NameDisplays the name of the current action script.getApproved
TypePath within the implementation folder where the corresponding action script operation resides. IdeaManagement.Idea