AppDefinition appDef = appService.getAppDefinition(appId, version);
PackageDefinition packageDef = appDef.getPackageDefinition();
if (packageDef != null) {
processDefId = WorkflowUtil.getProcessDefIdWithoutVersion(processDefId);
PackageActivityPlugin activityPlugin = packageDef.getPackageActivityPlugin(processDefId, activityDefId);
Plugin plugin = pluginManager.getPlugin(activityPlugin.getPluginName());
if (activityPlugin.getPluginProperties() != null && activityPlugin.getPluginProperties().trim().length() > 0) {
if (!(plugin instanceof PropertyEditable)) {
Map propertyMap = new HashMap();
propertyMap = CsvUtil.getPluginPropertyMap(activityPlugin.getPluginProperties());
map.addAttribute("propertyMap", propertyMap);
} else {
map.addAttribute("properties", PropertyUtil.propertiesJsonLoadProcessing(activityPlugin.getPluginProperties()));
}
}
if (plugin != null) {
PluginDefaultProperties pluginDefaultProperties = pluginDefaultPropertiesDao.loadById(activityPlugin.getPluginName(), appDef);
if (pluginDefaultProperties != null) {
if (!(plugin instanceof PropertyEditable)) {
Map defaultPropertyMap = new HashMap();
String properties = pluginDefaultProperties.getPluginProperties();
if (properties != null && properties.trim().length() > 0) {
defaultPropertyMap = CsvUtil.getPluginPropertyMap(properties);
}
map.addAttribute("defaultPropertyMap", defaultPropertyMap);
} else {
map.addAttribute("defaultProperties", PropertyUtil.propertiesJsonLoadProcessing(pluginDefaultProperties.getPluginProperties()));
}
}
}
if (plugin instanceof PropertyEditable) {
map.addAttribute("propertyEditable", (PropertyEditable) plugin);
}
map.addAttribute("plugin", plugin);
String url = request.getContextPath() + "/web/console/app/" + appId + "/" + appDef.getVersion() + "/processes/" + URLEncoder.encode(processDefId, "UTF-8") + "/activity/" + activityDefId + "/plugin/configure/submit?param_activityPluginId=" + activityPlugin.getUid();
map.addAttribute("actionUrl", url);
}
return "console/plugin/pluginConfig";
}