Developing Apama Applications > Developing Apama Applications in EPL > Common EPL Patterns > Inline request-response pattern > Canonical form for synchronous requests
Canonical form for synchronous requests
The next example show the canonical form for when you want to code a pattern that specifies two or more synchronous requests.
The events:
event RequestA { integer requestId; ... }
event ResponseA { integer requestId; ... }
event RequestB { integer requestId; ... }
event ResponseB { integer requestId; ... }
The monitor:
monitor Client {
   action doWork() {
      //do some processing
      integer requestId := integer.getUnique();
      route RequestA(requestId,...);
      ResponseA ra;
      on ResponseA(id=requestId):ra doWork2(ra);
   }
   action doWork2(ResponseA ra) {
      //do some more processing
      integer requestId := integer.getUnique();
      route RequestB(requestId,...);
      Response rb;
      on ResponseB(id=requestId):rb doWork3(rb);
   }
   action doWork3(ResponseB rb) {
      //do yet more processing
   }
}
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.