use of life.genny.qwanda.Link in project rulesservice by genny-project.
the class QRules method updateLink.
public Link updateLink(String groupCode, String targetCode, String linkCode, Double weight) {
log.info("UPDATING LINK between " + groupCode + "and" + targetCode);
Link link = new Link(groupCode, targetCode, linkCode);
link.setWeight(weight);
try {
QwandaUtils.apiPutEntity(qwandaServiceUrl + "/qwanda/links", RulesUtils.toJson(link), getToken());
} catch (IOException e) {
e.printStackTrace();
}
return link;
}
use of life.genny.qwanda.Link in project rulesservice by genny-project.
the class QRules method getOfferBaseEntity.
public BaseEntity getOfferBaseEntity(String groupCode, String linkCode, String linkValue, String quoterCode, String token) {
List linkList = getLinkList(groupCode, linkCode, linkValue, token);
String quoterCodeForOffer = null;
BaseEntity offer = null;
if (linkList != null) {
for (Object linkObj : linkList) {
Link link = JsonUtils.fromJson(linkObj.toString(), Link.class);
BaseEntity offerBe = getBaseEntityByCode(link.getTargetCode());
if (offerBe != null) {
quoterCodeForOffer = offerBe.getValue("PRI_QUOTER_CODE", null);
if (quoterCode.equals(quoterCodeForOffer)) {
offer = offerBe;
return offerBe;
}
}
}
}
return offer;
}
Aggregations