public void registerProcessDictionaries(InputStream is) {
if (is != null) {
ProcessDictionaries dictionaries = (ProcessDictionaries) DictionaryLoader.getInstance().unmarshall(is);
String processBpmKey = dictionaries.getProcessBpmDefinitionKey();
if (!Strings.hasText(processBpmKey)) {
throw new DictionaryLoadingException("No process name specified in the dictionaries XML");
}
Session session = sessionFactory.openSession();
try {
Transaction tx = session.beginTransaction();
ProcessDefinitionConfig definitionConfig = getProcessDefinitionDAO(session).getActiveConfigurationByKey(processBpmKey);
if (definitionConfig == null) {
throw new DictionaryLoadingException("No active definition config with BPM key: " + processBpmKey);
}
saveDictionaryInternal(session, definitionConfig, dictionaries);
tx.commit();
logger.warning("Registered dictionaries for process: " + processBpmKey);
}