fluid-api/src/main/java/com/fluidbpm/program/api/util/elasticsearch/ESFormFieldUtil.java
public Form getFormFields(Long electronicFormIdParam, boolean includeTableFieldsParam) {

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

		//Query using the descendantId directly...
		StringBuffer primaryQuery = new StringBuffer(ABaseFluidJSONObject.JSONMapping.ID);
		primaryQuery.append(":\"");
		primaryQuery.append(electronicFormIdParam);
		primaryQuery.append("\"");

		//Search for the primary...
		List<Form> formsWithId = this.searchAndConvertHitsToFormWithAllFields(
				QueryBuilders.queryStringQuery(primaryQuery.toString()), Index.DOCUMENT,
				DEFAULT_OFFSET, 1,
				new Long[]{});

		Form returnVal = null;
		if (formsWithId != null && !formsWithId.isEmpty()) {
			returnVal = formsWithId.get(0);
		}

		//No result...
		if (returnVal == null) {
			return null;
		}

		//Skip Table fields...
		if (!includeTableFieldsParam) {
			return returnVal;
		}

		//Populate the Table Fields...
		this.populateTableFields(false, true, returnVal.getFormFields());

		return returnVal;
	}
public Form getFormFields(Long electronicFormIdParam, boolean includeTableFieldsParam) {

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

		//Query using the descendantId directly...
		StringBuffer primaryQuery = new StringBuffer(ABaseFluidJSONObject.JSONMapping.ID);
		primaryQuery.append(":\"");
		primaryQuery.append(electronicFormIdParam);
		primaryQuery.append("\"");

		//Search for the primary...
		List<Form> formsWithId = this.searchAndConvertHitsToFormWithAllFields(
				QueryBuilders.queryStringQuery(primaryQuery.toString()), Index.DOCUMENT,
				DEFAULT_OFFSET, 1,
				new Long[]{});

		Form returnVal = null;
		if (formsWithId != null && !formsWithId.isEmpty()) {
			returnVal = formsWithId.get(0);
		}

		//No result...
		if (returnVal == null) {
			return null;
		}

		//Skip Table fields...
		if (!includeTableFieldsParam) {
			return returnVal;
		}

		//Populate the Table Fields...
		this.populateTableFields(false, true, returnVal.getFormFields());

		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.
@return The Form Fields for Electronic Form
{@code electronicFormIdParam}.