@Override
public ListGridRecord copyValues(OperationScheduleComposite from) {
ListGridRecord record = new ListGridRecord();
if (from instanceof ResourceOperationScheduleComposite) {
ResourceOperationScheduleComposite resource = (ResourceOperationScheduleComposite) from;
record.setAttribute(Field.RESOURCE_OR_GROUP.propertyName, resource.getResourceName());
// for ancestry handling
record.setAttribute(AncestryUtil.RESOURCE_ID, resource.getResourceId());
record.setAttribute(AncestryUtil.RESOURCE_NAME, resource.getResourceName());
record.setAttribute(AncestryUtil.RESOURCE_ANCESTRY, resource.getAncestry());
record.setAttribute(AncestryUtil.RESOURCE_TYPE_ID, resource.getResourceTypeId());
} else { // group
GroupOperationScheduleComposite resource = (GroupOperationScheduleComposite) from;
record.setAttribute(Field.RESOURCE_OR_GROUP.propertyName, resource.getGroupName());
record.setAttribute(Field.GROUP_ID.propertyName, resource.getGroupId());
record.setAttribute(Field.GROUP_TYPE.propertyName, resource.getGroupResourceTypeName());
}
record.setAttribute("id", from.getId());
record.setAttribute(Field.OPERATION.propertyName, from.getOperationName());
record.setAttribute(Field.TIME.propertyName, new Date(from.getOperationNextFireTime()));