WorkflowProcessListener listener = (WorkflowProcessListener) implClass.newInstance();
workflowProcess.addWorkflowProcessListener(listener);
}
catch (Throwable ex)
{
errorList.add(new WorkflowException("Can not load class :" + className, ex));
System.err.println("Can not load class :" + className);
System.err.println(loader);
}
}
}
//---------------------------------------------------------
// 2. format WorkflowActivity LISTENER_QUALIFIED_CLASS_NAME
//---------------------------------------------------------
for (int i = 0; i < processList.size(); ++i)
{
WorkflowProcess workflowProcess = (WorkflowProcess) processList.get(i);
List activies = workflowProcess.getWorkflowActivities();
int activitySize = activies.size();
for (int j = 0; j < activitySize; ++j)
{
WorkflowActivity activity = (WorkflowActivity) activies.get(j);
String className = activity.getListenerClassName();
if (className != null && className.length() > 0)
{
try
{
Class implClass = loader.loadClass(className);
WorkflowActivityListener listener = (WorkflowActivityListener) implClass.newInstance();
activity.addWorkflowActivityListener(listener);
}
catch (Throwable ex)
{
errorList.add(new WorkflowException("Can not load class :" + className, ex));
System.err.println("Can not load class :" + className);
System.err.println(loader);
}
}
}