I'm having trouble with using beestings in a heredoc in a global function. The runtime throws an error "Exception: arg2 is not defined
". Here is an example:
ruleset a163x59 {
meta {
name "Beesting in heredoc"
description <<
Demonstrate the error with beestings in global function heredocs
>>
author "Steve Nay"
logging on
}
dispatch {
}
global {
myFunc = function(arg1, arg2) {
firstString = "This is a regular string: #{arg1}. No problem there.";
secondString = <<
This is a heredoc with a beesting: #{arg2}. Problem!
>>;
secondString;
};
}
rule first_rule {
select when pageview ".*" setting ()
pre {
msg = myFunc("First argument", "Second argument");
}
notify("Testing...", msg) with sticky = true;
}
}
It never complains about arg1
being undefined, which shows that using a beesting inside a regular string is just fine.
Is there something I'm doing wrong, or is this a bug?