Developing Apama Applications > Apama EPL Reference > Variables > Variable declarations > Reference-type variable declarations > Context variable declarations
Context variable declarations
Use one of the following constructors to create a context:
context(string name)
context(string name, boolean receivesInput)
ContextVariableDeclaration
ContextInitializer
Rule components
The optional receivesInput Boolean flag controls whether the context is public or private:
*A public context can receive external, enqueued, and routed events.
*A private context cannot receive events from external components sent to the correlator. A private context can receive enqueued events from other contexts, and enqueued events and routed events from monitor instances in that context. The default is that a context is private.
Example
The following example creates a reference, c, to a private context whose name is test:
context c:=context("test");
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.