}
try {
if (!varList.isEmpty()) {
PluginManager pluginManager = (PluginManager) appContext.getBean("pluginManager");
PluginDefaultPropertiesDao pluginDefaultPropertiesDao = (PluginDefaultPropertiesDao) appContext.getBean("pluginDefaultPropertiesDao");
Collection<Plugin> pluginList = pluginManager.list(HashVariablePlugin.class);
Map <String, HashVariablePlugin> hashVariablePluginCache = new HashMap<String, HashVariablePlugin>();
for (String var : varList) {
String tempVar = var.replaceAll("#", "");
for (Plugin p : pluginList) {
HashVariablePlugin hashVariablePlugin = (HashVariablePlugin) p;
if (tempVar.startsWith(hashVariablePlugin.getPrefix() + ".")) {
tempVar = tempVar.replaceFirst(hashVariablePlugin.getPrefix() + ".", "");
HashVariablePlugin cachedPlugin = hashVariablePluginCache.get(hashVariablePlugin.getClassName());
if (cachedPlugin == null) {
cachedPlugin = (HashVariablePlugin) pluginManager.getPlugin(hashVariablePlugin.getClassName());
//get default plugin properties
if (appDef == null) {
appDef = AppUtil.getCurrentAppDefinition();
}
PluginDefaultProperties pluginDefaultProperties = pluginDefaultPropertiesDao.loadById(cachedPlugin.getClassName(), appDef);
if (pluginDefaultProperties != null && pluginDefaultProperties.getPluginProperties() != null && pluginDefaultProperties.getPluginProperties().trim().length() > 0) {
cachedPlugin.setProperties(PropertyUtil.getPropertiesValueFromJson(pluginDefaultProperties.getPluginProperties()));
}
//put appDef & wfAssignment to properties