Developing Apama Applications > Developing Apama Applications in EPL > Defining Monitors > Spawning monitor instances > Specifying parameters when spawning
Specifying parameters when spawning
When spawning a monitor instance, you can pass parameters to an action. For example:
monitor m {
   action onload() {
     spawn forward("a", "channelA");
     spawn forward("b", "channelB");
  }
 
   action forward(string arg, string channel) {
     Event e;
     on all Event(arg):e {
       send e to channel;
     }
     on StopForwarding(arg) {
       die();
     }
   }
}
The following are equivalent:
spawn actionName(); // This is the correct syntax.
spawn actionName; // This is deprecated. Do not use it.
Copyright © Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or its Subsidiaries and or/its Affiliates and/or their licensors.
Use, reproduction, transfer, publication or disclosure is prohibited except as specifically provided for in your License Agreement with Software AG.