Developing Apama Applications > Apama EPL Reference > Monitors > Monitor actions > Actions with parameters
Actions with parameters
An action can take an optional list of parameters.
ActionWithParameters
Formal parameters
The FormalParameterList is a comma-separated list of data type name and identifier pairs.
FormalParameterList
The identifier is the name of a parameter variable that will be bound to a copy of the value of an expression specified by the caller (that is, the value passed by the caller) when the action is invoked. The number and type of actual parameters passed by a caller must match those listed in the action’s formal parameters.
The scope of a parameter variable is the statement or block that forms the action body. Parameter variables are very similar to an action’s local variables.
Action return value
If you specify a returns clause, then the action must return a value whose type matches that specified in the returns clause. You specify the return value by using a return statement and result expression within the action. Every control path (see Transfer of control statements) within the action body must lead to a return statement with a result expression of the correct type.
Action body
After the returns clause (or after the formal parameters if there is no returns clause), a statement forms the action body. The action body can be a single statement or a block.
Within the action body, you use the parameter variable names to obtain the values that are passed to the action by its caller.
Copyright © 2013 Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or Terracotta Inc., San Francisco, CA, USA, and/or Software AG (Canada) Inc., Cambridge, Ontario, Canada, and/or, Software AG (UK) Ltd., Derby, United Kingdom, and/or Software A.G. (Israel) Ltd., Or-Yehuda, Israel and/or their licensors.