Search in sources :

Example 1 with EntityEntity

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;
}
Also used : EntityEntity(life.genny.qwanda.entity.EntityEntity) Link(life.genny.qwanda.Link) HashSet(java.util.HashSet)

Aggregations

HashSet (java.util.HashSet)1 Link (life.genny.qwanda.Link)1 EntityEntity (life.genny.qwanda.entity.EntityEntity)1