return executeBusinessRules(ruleId,parameter,null);
}
@Override
public Object executeBusinessRules(String ruleId, Object parameter, Map<String, Object> configMap) {
ProcessEngineConfigurationImpl processEngineConfiguration=Context.getProcessEngineConfiguration();
groovyShell.setVariable("sysRulesConfig", Context.getProcessEngineConfiguration());
groovyShell.setVariable("parameter", parameter);
groovyShell.setVariable("sqlCommand", new SqlCommand(Context.getDbConnection()));
if(configMap!=null){
for (String mapKey : configMap.keySet()) {
groovyShell.setVariable(mapKey, configMap.get(mapKey));
}
}
Rule rule = processEngineConfiguration.getRule(ruleId);
Object returnObj = groovyShell.evaluate(rule.getSqlValue());
return returnObj;
}