Developing Apama Applications > Apama EPL Reference > Variables > Provided variables > self
self
Purpose
The predefined variable self is an event reference that can be used to refer to an event instance within the event’s definition.
Within an event action body, you can use the self variable to refer an event instance of that event type. In other words, the scope of self is each action body in the event definition. For example:
event Circle
{   
float radius;
   location position;
   action area () returns float
   {
      return (float.PI * radius * radius);
   }
   action circumference () returns float
   {
      return (2.0 * float.PI * self.radius);
   }
}
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.