use of life.genny.qwanda.entity.EntityEntity in project rulesservice by genny-project.
the class QRules method getRecipientCodes.
public String[] getRecipientCodes(final QEventAttributeValueChangeMessage msg) {
String[] results = null;
Set<EntityEntity> links = msg.getBe().getLinks();
Set<String> recipientCodesSet = new HashSet<String>();
for (EntityEntity ee : links) {
Link link = ee.getLink();
String[] recipientArray = VertxUtils.getSubscribers(realm(), link.getTargetCode());
if (recipientArray != null) {
recipientCodesSet.addAll(Sets.newHashSet(recipientArray));
}
String[] recipientArray2 = VertxUtils.getSubscribers(realm(), link.getSourceCode());
if (recipientArray2 != null) {
recipientCodesSet.addAll(Sets.newHashSet(recipientArray2));
}
}
results = (String[]) FluentIterable.from(recipientCodesSet).toArray(String.class);
return results;
}
Aggregations