Developing Apama Applications > Apama EPL Reference > Variables > Variable declarations > Reference-type variable declarations > Action variable declarations
Action variable declarations
You can assign an action to an action variable of the same action type. An action is of the same type as an action variable if they have the same argument list (the same types in the same order) and return type (if any).
ActionVariableDeclaration
ActionParameterTypeList
Rule components
The format for defining an action variable is as follows:
action<[type1 [, type2]...]> [returns type3] name;
Follow the action keyword with zero, one or more parameter types enclosed in angle brackets and separated by commas. The angle brackets are required even when the action takes no arguments.
Optionally, follow the parameter list with a returns clause. Specify the returns keyword followed by the type of the returned value.
Finally, specify the name of the variable.
Example
action<string> a;
action<integer, integer> returns string b;
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.