Search in sources :

Example 16 with QDataBaseEntityMessage

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

the class RulesUtils method getBaseEntitysByChildAndLinkCodeWithAttributes.

/**
 * @param qwandaServiceUrl
 * @param decodedToken
 * @param token
 * @param parentCode
 * @param linkCode
 * @return baseEntitys
 */
public static List<BaseEntity> getBaseEntitysByChildAndLinkCodeWithAttributes(final String qwandaServiceUrl, Map<String, Object> decodedToken, final String token, final String childCode, final String linkCode) {
    String beJson = getBaseEntitysJsonByChildAndLinkCodeWithAttributes(qwandaServiceUrl, decodedToken, token, childCode, linkCode);
    QDataBaseEntityMessage msg = JsonUtils.fromJson(beJson, QDataBaseEntityMessage.class);
    BaseEntity[] beArray = msg.getItems();
    ArrayList<BaseEntity> arrayList = new ArrayList<BaseEntity>(Arrays.asList(beArray));
    return arrayList;
}
Also used : QDataBaseEntityMessage(life.genny.qwanda.message.QDataBaseEntityMessage) BaseEntity(life.genny.qwanda.entity.BaseEntity) ArrayList(java.util.ArrayList)

Example 17 with QDataBaseEntityMessage

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

the class RulesUtils method getBaseEntitysByParentAndLinkCodeWithAttributesAndStakeholderCode.

/**
 * @param qwandaServiceUrl
 * @param decodedToken
 * @param token
 * @param parentCode
 * @param linkCode
 * @param stakeholderCode
 * @return baseEntitys
 */
public static List<BaseEntity> getBaseEntitysByParentAndLinkCodeWithAttributesAndStakeholderCode(final String qwandaServiceUrl, Map<String, Object> decodedToken, final String token, final String parentCode, final String linkCode, final String stakeholderCode) {
    if (parentCode.equalsIgnoreCase("GRP_NEW_ITEMS")) {
        println("Group New Items Debug");
    }
    String beJson = getBaseEntitysJsonByParentAndLinkCodeWithAttributesAndStakeholderCode(qwandaServiceUrl, decodedToken, token, parentCode, linkCode, stakeholderCode);
    QDataBaseEntityMessage msg = fromJson(beJson, QDataBaseEntityMessage.class);
    if (msg == null) {
        log.error("Error in fetching BE from Qwanda Service");
    } else {
        BaseEntity[] beArray = msg.getItems();
        ArrayList<BaseEntity> arrayList = new ArrayList<BaseEntity>(Arrays.asList(beArray));
        return arrayList;
    }
    // TODO get exception =s in place
    return null;
}
Also used : QDataBaseEntityMessage(life.genny.qwanda.message.QDataBaseEntityMessage) BaseEntity(life.genny.qwanda.entity.BaseEntity) ArrayList(java.util.ArrayList)

Example 18 with QDataBaseEntityMessage

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

the class RulesUtils method getBaseEntitysArrayByParentAndLinkCodeAndLinkValueWithAttributes.

/**
 * @param qwandaServiceUrl
 * @param decodedToken
 * @param token
 * @param parentCode
 * @param linkCode
 * @param linkValue
 * @param pageStart
 * @param pageSize
 * @return baseEntitys
 */
public static BaseEntity[] getBaseEntitysArrayByParentAndLinkCodeAndLinkValueWithAttributes(final String qwandaServiceUrl, Map<String, Object> decodedToken, final String token, final String parentCode, final String linkCode, final String linkValue, final Integer pageStart, final Integer pageSize) {
    String beJson = getBaseEntitysJsonByParentAndLinkCodeAndLinkValue(qwandaServiceUrl, decodedToken, token, parentCode, linkCode, linkValue, pageStart, pageSize);
    QDataBaseEntityMessage msg = JsonUtils.fromJson(beJson, QDataBaseEntityMessage.class);
    return msg.getItems();
}
Also used : QDataBaseEntityMessage(life.genny.qwanda.message.QDataBaseEntityMessage)

Example 19 with QDataBaseEntityMessage

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

the class RulesUtils method getBaseEntitysArrayByParentAndLinkCodeWithAttributes.

/**
 * @param qwandaServiceUrl
 * @param decodedToken
 * @param token
 * @param parentCode
 * @param linkCode
 * @return baseEntitys
 */
public static BaseEntity[] getBaseEntitysArrayByParentAndLinkCodeWithAttributes(final String qwandaServiceUrl, Map<String, Object> decodedToken, final String token, final String parentCode, final String linkCode) {
    String beJson = getBaseEntitysJsonByParentAndLinkCode(qwandaServiceUrl, decodedToken, token, parentCode, linkCode);
    QDataBaseEntityMessage msg = JsonUtils.fromJson(beJson, QDataBaseEntityMessage.class);
    return msg.getItems();
}
Also used : QDataBaseEntityMessage(life.genny.qwanda.message.QDataBaseEntityMessage)

Example 20 with QDataBaseEntityMessage

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

the class RulesUtils method getBaseEntitysArrayByParentAndLinkCodeWithAttributes.

/**
 * @param qwandaServiceUrl
 * @param decodedToken
 * @param token
 * @param parentCode
 * @param linkCode
 * @param pageStart
 * @param pageSize
 * @return baseEntitys
 */
public static BaseEntity[] getBaseEntitysArrayByParentAndLinkCodeWithAttributes(final String qwandaServiceUrl, Map<String, Object> decodedToken, final String token, final String parentCode, final String linkCode, final Integer pageStart, final Integer pageSize) {
    String beJson = getBaseEntitysJsonByParentAndLinkCode(qwandaServiceUrl, decodedToken, token, parentCode, linkCode, pageStart, pageSize);
    QDataBaseEntityMessage msg = JsonUtils.fromJson(beJson, QDataBaseEntityMessage.class);
    return msg.getItems();
}
Also used : QDataBaseEntityMessage(life.genny.qwanda.message.QDataBaseEntityMessage)

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