Search in sources :

Example 11 with QDataBaseEntityMessage

use of life.genny.qwanda.message.QDataBaseEntityMessage in project rulesservice by genny-project.

the class QRules method publishBaseEntityByCode.

public void publishBaseEntityByCode(final String be, final String parentCode, final String linkCode, final String[] recipientCodes) {
    BaseEntity item = getBaseEntityByCode(be);
    BaseEntity[] itemArray = new BaseEntity[1];
    itemArray[0] = item;
    QDataBaseEntityMessage msg = new QDataBaseEntityMessage(itemArray, parentCode, linkCode);
    msg.setRecipientCodeArray(recipientCodes);
    publishData(msg, recipientCodes);
}
Also used : QDataBaseEntityMessage(life.genny.qwanda.message.QDataBaseEntityMessage) BaseEntity(life.genny.qwanda.entity.BaseEntity)

Example 12 with QDataBaseEntityMessage

use of life.genny.qwanda.message.QDataBaseEntityMessage in project rulesservice by genny-project.

the class QRules method publishCmd.

public void publishCmd(final BaseEntity be, final String aliasCode, final String[] recipientsCode) {
    QDataBaseEntityMessage msg = new QDataBaseEntityMessage(be, aliasCode);
    msg.setToken(getToken());
    if (recipientsCode != null) {
        msg.setRecipientCodeArray(recipientsCode);
    }
    publish("cmds", JsonUtils.toJson(msg));
}
Also used : QDataBaseEntityMessage(life.genny.qwanda.message.QDataBaseEntityMessage)

Example 13 with QDataBaseEntityMessage

use of life.genny.qwanda.message.QDataBaseEntityMessage in project rulesservice by genny-project.

the class QRules method fastClearBaseEntity.

/* sets delete field to true so that FE removes the BE from their store */
public void fastClearBaseEntity(String baseEntityCode, String[] recipients) {
    BaseEntity be = new BaseEntity(baseEntityCode, "FastBE");
    QDataBaseEntityMessage beMsg = new QDataBaseEntityMessage(be);
    beMsg.setDelete(true);
    publishData(beMsg, recipients);
}
Also used : QDataBaseEntityMessage(life.genny.qwanda.message.QDataBaseEntityMessage) BaseEntity(life.genny.qwanda.entity.BaseEntity)

Example 14 with QDataBaseEntityMessage

use of life.genny.qwanda.message.QDataBaseEntityMessage in project rulesservice by genny-project.

the class QRules method publishData.

public void publishData(final BaseEntity be, final String aliasCode, final String[] recipientsCode) {
    QDataBaseEntityMessage msg = new QDataBaseEntityMessage(be, aliasCode);
    msg.setToken(getToken());
    if (recipientsCode != null) {
        msg.setRecipientCodeArray(recipientsCode);
    }
    publish("cmds", RulesUtils.toJsonObject(msg));
}
Also used : QDataBaseEntityMessage(life.genny.qwanda.message.QDataBaseEntityMessage)

Example 15 with QDataBaseEntityMessage

use of life.genny.qwanda.message.QDataBaseEntityMessage in project rulesservice by genny-project.

the class QRules method publishData.

public void publishData(final List<BaseEntity> beList, final String parentCode, final String linkCode, String[] recipientCodes) {
    QDataBaseEntityMessage msg = new QDataBaseEntityMessage(beList.toArray(new BaseEntity[0]));
    msg.setParentCode(parentCode);
    msg.setLinkCode(linkCode);
    msg.setToken(getToken());
    if (recipientCodes != null) {
        msg.setRecipientCodeArray(recipientCodes);
    }
    publish("data", RulesUtils.toJsonObject(msg));
}
Also used : QDataBaseEntityMessage(life.genny.qwanda.message.QDataBaseEntityMessage) BaseEntity(life.genny.qwanda.entity.BaseEntity)

Aggregations

QDataBaseEntityMessage (life.genny.qwanda.message.QDataBaseEntityMessage)20 BaseEntity (life.genny.qwanda.entity.BaseEntity)13 ArrayList (java.util.ArrayList)3 IOException (java.io.IOException)2 HashSet (java.util.HashSet)2 EntityAttribute (life.genny.qwanda.attribute.EntityAttribute)2 JsonParseException (com.google.gson.JsonParseException)1 HashMap (java.util.HashMap)1 LinkedHashMap (java.util.LinkedHashMap)1 Answer (life.genny.qwanda.Answer)1 AttributeBoolean (life.genny.qwanda.attribute.AttributeBoolean)1 AttributeMoney (life.genny.qwanda.attribute.AttributeMoney)1 Money (org.javamoney.moneta.Money)1