Page History
You can use the following APIs to call an operation
Code Block | ||
---|---|---|
| ||
public static Objectobject callOperation(String name) { ... } public static Object object callOperation(String name, List<?> arguments) { ... } public static Object object callOperation(Object_ object, String name) { ... } public static Object object callOperation(Object_ object, String name, List<?> arguments) { ... } public static Object object callOperation(Object_ object, String name, List<?> arguments, boolean isSynchronous) { ... } |
If the object is omitted then context (self) is used automatically.
The following example shows how to call a specified operation in ALH API by passing the operation's name
Code Block | ||
---|---|---|
| ||
value = ALH.callOperation("test"); |
...
You can also give initial parameter values in which the arguments lists must be created by executing the following code
...
If a found Behavior value is null or an argument's size is not equal to the in or inout parameter's size of the found Behavior, an IllegalArgumentException will be thrown.
Info | ||
---|---|---|
| ||
Alternatively, you can use ALH API through the fUML object syntax, with $session$ from predefined variables and object.callOperation($session$, operationName, arguments). For example:
|