use of life.genny.qwanda.exception.BadDataException in project rulesservice by genny-project.
the class QRules method updateCachedBaseEntity.
public BaseEntity updateCachedBaseEntity(final Answer answer) {
BaseEntity cachedBe = this.getBaseEntityByCode(answer.getTargetCode());
// Add an attribute if not already there
try {
answer.setAttribute(RulesUtils.attributeMap.get(answer.getAttributeCode()));
if (answer.getAttribute() == null) {
log.error("Null Attribute");
} else
cachedBe.addAnswer(answer);
VertxUtils.writeCachedJson(answer.getTargetCode(), JsonUtils.toJson(cachedBe));
} catch (BadDataException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return cachedBe;
}
Aggregations