public void trigger(final RuleFlowNodeInstance from) {
Object action = getActionNode().getAction();
if (action instanceof DroolsConsequenceAction) {
String actionString = ((DroolsConsequenceAction) action).getConsequence();
ExpressionCompiler compiler = new ExpressionCompiler(actionString);
ParserContext parserContext = new ParserContext();
// imports
List imports = getProcessInstance().getRuleFlowProcess().getImports();
Set importSet = new HashSet();
if (imports != null) {
importSet.addAll(imports);
for (Iterator iterator = imports.iterator(); iterator.hasNext(); ) {
String importClassName = (String) iterator.next();
if ( importClassName.endsWith( ".*" ) ) {
importClassName = importClassName.substring(0, importClassName.indexOf(".*"));
parserContext.addPackageImport(importClassName);
} else {
try {
parserContext.addImport(Class.forName(importClassName));
} catch (ClassNotFoundException e) {
// class not found, do nothing
}
}
}
}
TypeResolver typeResolver = new ClassTypeResolver(importSet, Thread.currentThread().getContextClassLoader());
// compile expression
Serializable expression = compiler.compile(parserContext);
// globals
Map globalDefs = getProcessInstance().getRuleFlowProcess().getGlobals();
Map globals = new HashMap();
if (globalDefs != null) {
for (Iterator iterator = globalDefs.entrySet().iterator(); iterator.hasNext(); ) {