Skip to content

Instantly share code, notes, and snippets.

@MikeGrace
Created November 3, 2010 21:47
Show Gist options
  • Save MikeGrace/661784 to your computer and use it in GitHub Desktop.
Save MikeGrace/661784 to your computer and use it in GitHub Desktop.
Testing going into a loop without passing the loop count parameter. Everything worked as expected.
ruleset a60x412 {
meta {
name "test-non-passed-parameter"
description <<
test-non-passed-parameter
>>
author "Mike Grace"
logging on
}
rule start {
select when pageview ".*"
{
notify("getting started","Not passing count param") with sticky = true;
}
fired {
raise explicit event loopy;
}
}
rule loopy {
select when explicit loopy
pre {
loopCount = event:param("loopCount");
}
if (loopCount < 5) then {
notify("Loopy!","loopCount: #{loopCount}") with sticky = true;
}
fired {
raise explicit event loopy
with loopCount = loopCount + 1;
} else {
raise explicit event loopy_bye_bye
}
}
rule loopy_bye_bye {
select when explicit loopy_bye_bye
{
notify("All done!","That was fun. : )") with sticky = true;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment