fluid-api/src/main/java/com/fluidbpm/program/api/vo/form/Form.java
@XmlTransient
	public JSONObject convertToFlatJSONObject()
	{
		JSONObject returnVal = new JSONObject();

		//Id...
		returnVal.put(
				FlatFormJSONMapping.FORM_ID,
				this.getId() == null ?
						JSONObject.NULL : this.getId());

		//Title...
		returnVal.put(
				FlatFormJSONMapping.FORM_TITLE,
				this.getTitle() == null ?
						JSONObject.NULL : this.getTitle());

		//Form Type...
		returnVal.put(
				FlatFormJSONMapping.FORM_TYPE,
				this.getFormType() == null ?
						JSONObject.NULL : this.getFormType());

		//State...
		returnVal.put(
				FlatFormJSONMapping.FORM_STATE,
				this.getState() == null ?
						JSONObject.NULL : this.getState());

		//Form Flow State...
		returnVal.put(
				FlatFormJSONMapping.FORM_FLOW_STATE,
				this.getFlowState() == null ?
						JSONObject.NULL : this.getFlowState());

		//Date Created...
		returnVal.put(
				FlatFormJSONMapping.FORM_DATE_CREATED,
				(this.getDateCreated() == null) ?
						JSONObject.NULL: this.getDateCreated().getTime());

		//Date Last Updated...
		returnVal.put(
				FlatFormJSONMapping.FORM_DATE_LAST_UPDATED,
				(this.getDateLastUpdated() == null) ?
						JSONObject.NULL: this.getDateLastUpdated().getTime());

		//Form Fields...
		if(this.getFormFields() == null || this.getFormFields().isEmpty())
		{
			return returnVal;
		}

		//Set the form fields...
		UtilGlobal utilGlobal = new UtilGlobal();
		this.getFormFields().forEach(
				(formFieldItem) ->
				{
					utilGlobal.setFlatFieldOnJSONObj(
							FlatFormJSONMapping.FORM_FIELD_PREFIX,
							FlatFormJSONMapping.FORM_FIELD_ID_PREFIX,
							formFieldItem,
							returnVal
					);
				}
@XmlTransient
	public JSONObject convertToFlatJSONObject()
	{
		JSONObject returnVal = new JSONObject();

		//Id...
		returnVal.put(
				FlatFormJSONMapping.FORM_ID,
				this.getId() == null ?
						JSONObject.NULL : this.getId());

		//Title...
		returnVal.put(
				FlatFormJSONMapping.FORM_TITLE,
				this.getTitle() == null ?
						JSONObject.NULL : this.getTitle());

		//Form Type...
		returnVal.put(
				FlatFormJSONMapping.FORM_TYPE,
				this.getFormType() == null ?
						JSONObject.NULL : this.getFormType());

		//State...
		returnVal.put(
				FlatFormJSONMapping.FORM_STATE,
				this.getState() == null ?
						JSONObject.NULL : this.getState());

		//Form Flow State...
		returnVal.put(
				FlatFormJSONMapping.FORM_FLOW_STATE,
				this.getFlowState() == null ?
						JSONObject.NULL : this.getFlowState());

		//Date Created...
		returnVal.put(
				FlatFormJSONMapping.FORM_DATE_CREATED,
				(this.getDateCreated() == null) ?
						JSONObject.NULL: this.getDateCreated().getTime());

		//Date Last Updated...
		returnVal.put(
				FlatFormJSONMapping.FORM_DATE_LAST_UPDATED,
				(this.getDateLastUpdated() == null) ?
						JSONObject.NULL: this.getDateLastUpdated().getTime());

		//Form Fields...
		if(this.getFormFields() == null || this.getFormFields().isEmpty())
		{
			return returnVal;
		}

		//Set the form fields...
		UtilGlobal utilGlobal = new UtilGlobal();
		this.getFormFields().forEach(
				(formFieldItem) ->
				{
					utilGlobal.setFlatFieldOnJSONObj(
							FlatFormJSONMapping.FORM_FIELD_PREFIX,
							FlatFormJSONMapping.FORM_FIELD_ID_PREFIX,
							formFieldItem,
							returnVal
					);
				}
@ XmlTransient public JSONObject convertToFlatJSONObject ( ) { JSONObject returnVal = new JSONObject ( ) ; //Id... returnVal . put ( FlatFormJSONMapping . FORM_ID , this . getId ( ) == null ? JSONObject . NULL : this . getId ( ) ) ; //Title... returnVal . put ( FlatFormJSONMapping . FORM_TITLE , this . getTitle ( ) == null ? JSONObject . NULL : this . getTitle ( ) ) ; //Form Type... returnVal . put ( FlatFormJSONMapping . FORM_TYPE , this . getFormType ( ) == null ? JSONObject . NULL : this . getFormType ( ) ) ; //State... returnVal . put ( FlatFormJSONMapping . FORM_STATE , this . getState ( ) == null ? JSONObject . NULL : this . getState ( ) ) ; //Form Flow State... returnVal . put ( FlatFormJSONMapping . FORM_FLOW_STATE , this . getFlowState ( ) == null ? JSONObject . NULL : this . getFlowState ( ) ) ; //Date Created... returnVal . put ( FlatFormJSONMapping . FORM_DATE_CREATED , ( this . getDateCreated ( ) == null ) ? JSONObject . NULL : this . getDateCreated ( ) . getTime ( ) ) ; //Date Last Updated... returnVal . put ( FlatFormJSONMapping . FORM_DATE_LAST_UPDATED , ( this . getDateLastUpdated ( ) == null ) ? JSONObject . NULL : this . getDateLastUpdated ( ) . getTime ( ) ) ; //Form Fields... if ( this . getFormFields ( ) == null || this . getFormFields ( ) . isEmpty ( ) ) { return returnVal ; } //Set the form fields... UtilGlobal utilGlobal = new UtilGlobal ( ) ; this . getFormFields ( ) . forEach ( ( formFieldItem ) - > { utilGlobal . setFlatFieldOnJSONObj ( FlatFormJSONMapping . FORM_FIELD_PREFIX , FlatFormJSONMapping . FORM_FIELD_ID_PREFIX , formFieldItem , returnVal ) ; }
Serialize {@code this} object into a JSONObject.

Any fields provided with a Java {@code null} value will be stored
as {@code JSONObject.Null}. {@code Field.Type.Table} fields are not supported and will be skipped.

@return Flat {@code JSON} object (No inner fields).

@see JSONObject
Serialize { @code this } object into a JSONObject .