fluid-api/src/main/java/com/fluidbpm/program/api/util/elasticsearch/ABaseESUtil.java
protected final List<Form> populateTableFields(
			boolean addAllTableRecordsForReturnParam,
			boolean includeFieldDataParam,
			List<Field> formFieldsParam) {
		if(formFieldsParam == null || formFieldsParam.isEmpty()) {
			return null;
		}

		List<Form> allTableRecordsFromAllFields = addAllTableRecordsForReturnParam ?
				new ArrayList() : null;

		//Populate each of the Table Fields...
		for(Field descendantField : formFieldsParam) {
			//Skip if not Table Field...
			if(!(descendantField.getFieldValue() instanceof TableField)) {
				continue;
			}

			TableField tableField = (TableField)descendantField.getFieldValue();

			List<Form> tableRecordWithIdOnly = tableField.getTableRecords();
			if(tableRecordWithIdOnly == null || tableRecordWithIdOnly.isEmpty()) {
				continue;
			}

			//Populate the ids for lookup...
			List<Long> formIdsOnly = new ArrayList();
			for(Form tableRecord : tableRecordWithIdOnly) {
				formIdsOnly.add(tableRecord.getId());
			}

			List<Form> populatedTableRecords = this.getFormsByIds(
					Index.TABLE_RECORD,
					formIdsOnly,
					includeFieldDataParam,
					DEFAULT_OFFSET, MAX_NUMBER_OF_TABLE_RECORDS);

			if(addAllTableRecordsForReturnParam && populatedTableRecords != null) {
				allTableRecordsFromAllFields.addAll(populatedTableRecords);
			}

			tableField.setTableRecords(populatedTableRecords);
			descendantField.setFieldValue(tableField);
		}

		return allTableRecordsFromAllFields;
	}
protected final List<Form> populateTableFields(
			boolean addAllTableRecordsForReturnParam,
			boolean includeFieldDataParam,
			List<Field> formFieldsParam) {
		if(formFieldsParam == null || formFieldsParam.isEmpty()) {
			return null;
		}

		List<Form> allTableRecordsFromAllFields = addAllTableRecordsForReturnParam ?
				new ArrayList() : null;

		//Populate each of the Table Fields...
		for(Field descendantField : formFieldsParam) {
			//Skip if not Table Field...
			if(!(descendantField.getFieldValue() instanceof TableField)) {
				continue;
			}

			TableField tableField = (TableField)descendantField.getFieldValue();

			List<Form> tableRecordWithIdOnly = tableField.getTableRecords();
			if(tableRecordWithIdOnly == null || tableRecordWithIdOnly.isEmpty()) {
				continue;
			}

			//Populate the ids for lookup...
			List<Long> formIdsOnly = new ArrayList();
			for(Form tableRecord : tableRecordWithIdOnly) {
				formIdsOnly.add(tableRecord.getId());
			}

			List<Form> populatedTableRecords = this.getFormsByIds(
					Index.TABLE_RECORD,
					formIdsOnly,
					includeFieldDataParam,
					DEFAULT_OFFSET, MAX_NUMBER_OF_TABLE_RECORDS);

			if(addAllTableRecordsForReturnParam && populatedTableRecords != null) {
				allTableRecordsFromAllFields.addAll(populatedTableRecords);
			}

			tableField.setTableRecords(populatedTableRecords);
			descendantField.setFieldValue(tableField);
		}

		return allTableRecordsFromAllFields;
	}
Populate all the Table Field values from the Table index.

@param addAllTableRecordsForReturnParam Whether to include all the Table Records as a return value.
@param includeFieldDataParam Whether to populate the return {@code Form} table fields.
@param formFieldsParam The {@code Field}s to populate.

@return {@code List<Form>} of populated Table Field records.