Run Beanshell Rules

How can I run a Beanshell Rule inside another Rule?
For example, I want to do something like this:

BeanshellExecutor executor = new BeanShellExecutor("SampleRule");
executor.setArgument("argumentx", "x");

Object result = executor.execute();
Rule rule = context.getObjectByName(Rule.class, "Name of rule");
Map args = new HashMap();
// Populate args with any arguments you want to pass to the rule
Object returnValueFromRule = context.runRule(rule, args);
4 Likes

Thanks Derek! Great! <3