You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

In the activity diagram, you can call methods of imported classes with the Java adapter.

Example Files (Builder project Add-ons\Java):

<your example path>\Add-ons\Java\uml\javaCollections.xml

In the following examples, the Java adapter is used to call method getProducts, which is a member method of class ProductList. It takes a number of product ids as input and returns an array of product objects.

Figure: Calling a Java Method with the Java Adapter

Generally, to class methods are called in an activity diagram by Call Operation Actions. You can select the imported Java method you want to call from the containment tree, and drag and drop in onto the diagram pane.

The action pins correspond to the parameters of the class operation. The Java adapter has one input and one output pin. Input pin list represents the input parameter of the Java method getProducts with exactly that same name, output pin return respectively represents the return value of the Java method.

Also have a look at the development hints on Getting Started with the Java Adapter > Java Class Development Hints.

  • No labels