{
"status":1,
"expire":15349870000,
"detail1":"test1",
"detail2":"test2"
}
{
"status":0,
"expire":15349870000,
"detail1":"test1",
"detail2":"test2"
}
我有两个相同数据类型的不同文档,我想根据条件更新状态 detail1 和 detail2
if(status==0 and expire > now()) then status = 1 and detail1 = "good"
if(status==1 and expire > now()) then status = 2 and detail2 = "bad"
但是这一切我想在处理器中做。那么,当我无法在处理器中获取字段值时,如何应用检查处理器?
@Override
public Progress process(Processing processing) {
for (DocumentOperation op : processing.getDocumentOperations()) {
if (op instanceof DocumentUpdate) {
DocumentUpdate documentUpdate = (DocumentUpdate) op;
if(?){
documentUpdate.addFieldUpdate(FieldUpdate.createAssign(documentUpdate.getDocumentType().getField("detail1"), new StringFieldValue("good")));
}
else if(?){
documentUpdate.addFieldUpdate(FieldUpdate.createAssign(documentUpdate.getDocumentType().getField("detail2"), new StringFieldValue("bad")));
}
}
}
return Progress.DONE;
}
请帮忙!