Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

You can use the following APIs to call an operation
 

Code Block
languagetext
	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
languagetext
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
titleInformation

Alternatively, you can use ALH API through the fUML object syntax, with $session$ from predefined variables and object.callOperation($session$, operationName, arguments). For example:

  • Object.callOperation($session$, ”test”);
  • Object.callOperation($session$, ”test”, arguments);
  • Object.callOperation($session$, ”test”, arguments, true);