try{
JSONObject info=null;
// work to build
WorksRepository worksRepository=null;
CommonjWork work=null;
// can take the document id or the document label
boolean isLabel = false;
String documentUnique = null;
if(documentLabel != null){
isLabel = true;
documentUnique = documentLabel;
}
else if(documentId != null){
isLabel = false;
documentUnique = documentId;
}
// Build work from template
try {
work = new CommonjWork( getTemplateAsSourceBean());
} catch (SpagoBIEngineException e) {
logger.error("Error in reading work template",e);
return;
}
// calculate process Id
String pId = work.calculatePId();
logger.debug("process Id is "+pId);
work.setSbiParametersMap(parameters);
CommonjEngine cm=new CommonjEngine();
try {
worksRepository = CommonjEngine.getWorksRepository();
} catch (SpagoBIEngineException e) {