}
private void addBIObjectParameterToDossier(BIObject dossier,
BIObjectParameter parameterToBeAdded) {
logger.debug("IN");
IBIObjectParameterDAO objParDAO;
try {
objParDAO = DAOFactory.getBIObjectParameterDAO();
BIObjectParameter objPar = new BIObjectParameter();
objPar.setId(new Integer(-1));
objPar.setBiObjectID(dossier.getId());
objPar.setParID(parameterToBeAdded.getParID());
Parameter par = new Parameter();
par.setId(parameterToBeAdded.getParID());
objPar.setParameter(par);
objPar.setLabel(parameterToBeAdded.getLabel());
objPar.setParameterUrlName(parameterToBeAdded.getParameterUrlName());
objPar.setRequired(parameterToBeAdded.getRequired());
objPar.setModifiable(parameterToBeAdded.getModifiable());
objPar.setVisible(parameterToBeAdded.getVisible());
objPar.setMultivalue(parameterToBeAdded.getMultivalue());
List existingParameters = dossier.getBiObjectParameters();
int priority = existingParameters != null ? existingParameters.size() + 1 : 1;
objPar.setPriority(new Integer(priority));
parameterToBeAdded.setId(new Integer(-1));
objParDAO.insertBIObjectParameter(objPar);
} catch (EMFUserError e) {
throw new RuntimeException("Cannot save new parameter into dossier with label " + dossier.getLabel(), e);
}
updateBIObjectParameters(dossier);
logger.debug("OUT");