use of life.genny.qwanda.message.QDataAnswerMessage in project rulesservice by genny-project.
the class QRules method publishData.
public void publishData(final Answer answer, final String[] recipientsCode) {
QDataAnswerMessage msg = new QDataAnswerMessage(answer);
msg.setRecipientCodeArray(recipientsCode);
msg.setToken(getToken());
publish("data", RulesUtils.toJsonObject(msg));
}
use of life.genny.qwanda.message.QDataAnswerMessage in project rulesservice by genny-project.
the class QRules method publishData.
public void publishData(final Answer answer) {
QDataAnswerMessage msg = new QDataAnswerMessage(answer);
msg.setToken(getToken());
publish("data", JsonUtils.toJson(msg));
}
use of life.genny.qwanda.message.QDataAnswerMessage in project rulesservice by genny-project.
the class QRules method publishCmd.
public void publishCmd(final Answer answer) {
QDataAnswerMessage msg = new QDataAnswerMessage(answer);
msg.setToken(getToken());
publish("cmds", JsonUtils.toJson(msg));
}
use of life.genny.qwanda.message.QDataAnswerMessage in project rulesservice by genny-project.
the class QRules method saveAnswers.
/**
* @param answers
*/
public void saveAnswers(List<Answer> answers, final boolean changeEvent) {
if (!changeEvent) {
for (Answer answer : answers) {
answer.setChangeEvent(false);
}
}
Answer[] items = new Answer[answers.size()];
items = answers.toArray(items);
QDataAnswerMessage msg = new QDataAnswerMessage(items);
updateCachedBaseEntity(answers);
String jsonAnswer = RulesUtils.toJson(msg);
jsonAnswer.replace("\\\"", "\"");
try {
QwandaUtils.apiPostEntity(getQwandaServiceUrl() + "/qwanda/answers/bulk2", jsonAnswer, token);
} catch (IOException e) {
log.error("Socket error trying to post answer");
}
}
use of life.genny.qwanda.message.QDataAnswerMessage in project rulesservice by genny-project.
the class QRules method publishData.
public void publishData(final List<Answer> answerList) {
Answer[] answerArray = answerList.toArray(new Answer[answerList.size()]);
QDataAnswerMessage msg = new QDataAnswerMessage(answerArray);
msg.setToken(getToken());
publish("data", JsonUtils.toJson(msg));
}
Aggregations