fluid-api/src/main/java/com/fluidbpm/program/api/util/sql/impl/SQLFormFieldUtil.java
public List<Field> getFormFields(
			Long electronicFormIdParam,
			boolean includeTableFieldsParam,
			boolean includeTableFieldFormRecordInfoParam
	) {
		List<Field> returnVal = new ArrayList();

		if(electronicFormIdParam == null) {
			return returnVal;
		}

		List<FormFieldMapping> fieldMappings =
				this.getFormFieldMappingForForm(electronicFormIdParam);

		if(fieldMappings == null || fieldMappings.isEmpty()) {
			return returnVal;
		}

		//Get the values for each of the fields...
		for(FormFieldMapping fieldMapping : fieldMappings) {
			//Skip if ignore Table Fields...
			if(!includeTableFieldsParam &&
					fieldMapping.dataType == UtilGlobal.FieldTypeId._7_TABLE_FIELD){//Table Field...
				continue;
			}

			Field fieldToAdd = this.getFormFieldValueFor(
					fieldMapping,
					electronicFormIdParam,
					includeTableFieldFormRecordInfoParam);

			if(fieldToAdd == null) {
				continue;
			}

			//When table field...
			if(includeTableFieldsParam && (fieldToAdd.getFieldValue() instanceof TableField)) {
				TableField tableField = (TableField)fieldToAdd.getFieldValue();

				if(tableField.getTableRecords() != null && !tableField.getTableRecords().isEmpty()) {
					for(Form tableRecordForm : tableField.getTableRecords()) {
						tableRecordForm.setFormFields(
								this.getFormFields(
										tableRecordForm.getId(),
										false,
										false));
					}
				}
			}

			returnVal.add(fieldToAdd);
		}

		return returnVal;
	}
public List<Field> getFormFields(
			Long electronicFormIdParam,
			boolean includeTableFieldsParam,
			boolean includeTableFieldFormRecordInfoParam
	) {
		List<Field> returnVal = new ArrayList();

		if(electronicFormIdParam == null) {
			return returnVal;
		}

		List<FormFieldMapping> fieldMappings =
				this.getFormFieldMappingForForm(electronicFormIdParam);

		if(fieldMappings == null || fieldMappings.isEmpty()) {
			return returnVal;
		}

		//Get the values for each of the fields...
		for(FormFieldMapping fieldMapping : fieldMappings) {
			//Skip if ignore Table Fields...
			if(!includeTableFieldsParam &&
					fieldMapping.dataType == UtilGlobal.FieldTypeId._7_TABLE_FIELD){//Table Field...
				continue;
			}

			Field fieldToAdd = this.getFormFieldValueFor(
					fieldMapping,
					electronicFormIdParam,
					includeTableFieldFormRecordInfoParam);

			if(fieldToAdd == null) {
				continue;
			}

			//When table field...
			if(includeTableFieldsParam && (fieldToAdd.getFieldValue() instanceof TableField)) {
				TableField tableField = (TableField)fieldToAdd.getFieldValue();

				if(tableField.getTableRecords() != null && !tableField.getTableRecords().isEmpty()) {
					for(Form tableRecordForm : tableField.getTableRecords()) {
						tableRecordForm.setFormFields(
								this.getFormFields(
										tableRecordForm.getId(),
										false,
										false));
					}
				}
			}

			returnVal.add(fieldToAdd);
		}

		return returnVal;
	}
Retrieves the Form Fields {@code VALUES} for the
Electronic Form with id {@code electronicFormIdParam}.

@param electronicFormIdParam The Electronic Form to fetch fields for.
@param includeTableFieldsParam Whether to populate the table fields.
@param includeTableFieldFormRecordInfoParam Does table record form data need to be included.

@return The Form Fields for Electronic Form {@code electronicFormIdParam}.