* @param comment
* the description value
*/
private void updateOrCreateDescriptionValuesAndAddToWorkReportLine(WorkReportLine workReportLine,
String comment) {
DescriptionField descriptionField = workReportType.getLineFields().iterator().next();
Integer maxLenght = descriptionField.getLength();
if (comment.length() > maxLenght) {
comment = comment.substring(0, maxLenght - 1);
}
Set<DescriptionValue> descriptionValues = workReportLine
.getDescriptionValues();
if (descriptionValues.isEmpty()) {
descriptionValues.add(DescriptionValue.create(
descriptionField.getFieldName(), comment));
} else {
descriptionValues.iterator().next().setValue(comment);
}
workReportLine.setDescriptionValues(descriptionValues);