} catch (ClassNotFoundException e) {
logger.debug("class loaded not foud...",e);
}
Object obj = clazz.newInstance();
logger.debug("class loaded "+classToLoad);
SpagoBIWork workToLaunch=null;
// class loaded could be instance of CmdExecWork o di Work, testa se � il primo, se no � l'altra
if (obj instanceof CmdExecWork) {
logger.debug("Class specified extends CmdExecWork");
workToLaunch = (CmdExecWork) obj;
workToLaunch.setPid(work.getPId());
((CmdExecWork)obj).setCommand(work.getCommand());
((CmdExecWork)obj).setCommandEnvironment(work.getCommand_environment());
((CmdExecWork)obj).setCmdParameters(work.getCmdParameters());
((CmdExecWork)obj).setClasspathParameters(work.getClasspathParameters());
workToLaunch.setAnalyticalParameters(work.getAnalyticalParameters());
workToLaunch.setSbiParameters(work.getSbiParametersMap());
if(isLabel) workToLaunch.setSbiLabel(documentUnique);
}
else
if (obj instanceof SpagoBIWork) {
logger.debug("Class specified extends Work");
workToLaunch=(SpagoBIWork)obj;
workToLaunch.setPid(work.getPId());
workToLaunch.setSbiParameters(work.getSbiParametersMap());
workToLaunch.setAnalyticalParameters(work.getAnalyticalParameters());
if(isLabel) workToLaunch.setSbiLabel(documentUnique);
}
else{
logger.error("Class you want to launch should extend SpagoBIWork or CmdExecWork");
return;
}