Created
June 30, 2011 02:13
-
-
Save riferrei/1055488 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.apama.card.offers; | |
monitor MerchantStoreService { | |
dictionary<string, sequence<MerchantStore> > merchantstores; | |
action onload() { | |
MerchantStore ms; | |
on all MerchantStore():ms { | |
if not merchantstores.hasKey(ms.merchantname) then { | |
merchantstores.add(ms.merchantname, new sequence<MerchantStore>); | |
} | |
merchantstores[ms.merchantname].append(ms); | |
} | |
LookupMerchants lm; | |
on all LookupMerchants():lm { | |
if merchantstores.hasKey(lm.merchantname) then { | |
MerchantStore ms := new MerchantStore; | |
for ms in merchantstores[lm.merchantname] { | |
if ms.locality = lm.locality then { | |
MerchantLookupResults lr := new MerchantLookupResults; | |
lr.correlationid := lm.correlationid; | |
lr.ms := ms; | |
log lr.toString(); | |
route lr; | |
} | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment