Iterator<Relation> iterator = result.iterator();
while (iterator.hasNext()) {
// get the info from the relation
Relation relation = iterator.next();
String nature = new String();
String status = new String();
String from = new String();
String to = new String();
String id = new String();
// check if values are not empty
if (relation.getId() != null
&& relation.getId().length() > 0) {
id = relation.getId();
}
if (relation.getNature() != null
&& relation.getNature().length() > 0) {
nature = relation.getNature();
}
if (relation.getStatus() != null
&& relation.getStatus().length() > 0) {
status = relation.getStatus();
}
if (relation.getFrom() != null
&& relation.getFrom().length() > 0) {
from = relation.getFrom();
}
if (relation.getTo() != null
&& relation.getTo().length() > 0) {
to = relation.getTo();
}
if (from != null && nature != null && status != null
&& to != null) {
addRelationshipWidget(id, nature, status, from, to);