Hi all!Help me, please, with custom ClassLoader in ProcessEngineConfigurationImplThe issue can be seen on Activiti 5.13 under Alfresco.In org.alfresco.repo.workflow.activiti.ActivitiWorkflowEngine.endNormalTask:
taskService.complete(localTaskId);
// The task should have a historicTaskInstance
HistoricTaskInstance historicTask = historyService.createHistoricTaskInstanceQuery().taskId(task.getId()).singleResult();
return typeConverter.convert(historicTask); // <— The problem is here
In org.alfresco.repo.workflow.activiti.properties.ActivitiPropertyConverter.convertHistoricDetailswe see the instructions:
for(Entry<String, HistoricVariableUpdate> entry : updateMap.entrySet())
{
variables.put(entry.getKey(), entry.getValue().getValue());
}when trying to getValue in org.activiti.engine.impl.persistence.entity.HistoricDetailVariableInstanceUpdateEntitywe come to org.activiti.engine.impl.variable.SerializableType.getValueand then - to org.activiti.engine.impl.util.ReflectUtil.loadClass: Class<?> clazz = null;
ClassLoader classLoader = getCustomClassLoader();
in getCustomClassLoader(): ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration();
if(processEngineConfiguration != null) {
final ClassLoader classLoader = processEngineConfiguration.getClassLoader();
if(classLoader != null) {
return classLoader;
}
}
return null;
at this point we can see that Context.getProcessEngineConfiguration() returns null (it's always cleared by executed commands in the end of execution).So, we can not use custom ClassLoader, added to ProcessEngineConfigurationImpl, and of course get an java.lang.ClassNotFoundException.The question is: isn't it a bug, and if not then how to deal with this behavior?Thank you!Serge