use of com.ramussoft.core.history.Record in project ramus by Vitaliy-Yakovchuk.
the class StandardAttributesPlugin method getHistory.
public static List<Record> getHistory(Engine engine, Element element, Attribute attribute) {
StandardAttributesPlugin plugin = getStandardPlugin(engine);
List<Element> elements = engine.findElements(plugin.historyQualifier.getId(), plugin.historyElement, element.getId());
List<Record> res = new ArrayList<Record>();
for (Element element2 : elements) {
Long id = (Long) engine.getAttribute(element2, plugin.historyAttribute);
if (id.longValue() == attribute.getId()) {
Record record = new Record();
record.setDate((Date) engine.getAttribute(element2, plugin.historyTime));
record.setValue(engine.getAttribute(element2, attribute));
record.setElement(element2);
res.add(record);
}
}
Collections.sort(res);
return res;
}