fluid-api/src/main/java/com/fluidbpm/program/api/vo/form/Form.java
@Override
	@XmlTransient
	public JSONObject toJsonObject() throws JSONException {
		JSONObject returnVal = super.toJsonObject();

		//Form Type...
		if(this.getFormType() != null) {
			returnVal.put(JSONMapping.FORM_TYPE, this.getFormType());
		}

		//Form Type Id...
		if(this.getFormTypeId() != null) {
			returnVal.put(JSONMapping.FORM_TYPE_ID, this.getFormTypeId());
		}

		//Title...
		if(this.getTitle() != null) {
			returnVal.put(JSONMapping.TITLE, this.getTitle());
		}

		//Form Description...
		if(this.getFormDescription() != null) {
			returnVal.put(JSONMapping.FORM_DESCRIPTION, this.getFormDescription());
		}

		//Ancestor Label...
		if(this.getAncestorLabel() != null) {
			returnVal.put(JSONMapping.ANCESTOR_LABEL,
					this.getAncestorLabel());
		}

		//Descendant Label...
		if(this.getDescendantsLabel() != null) {
			returnVal.put(JSONMapping.DESCENDANTS_LABEL,
					this.getDescendantsLabel());
		}

		//Number Inputs...
		if(this.getNumberInputs() != null) {
			returnVal.put(JSONMapping.NUMBER_INPUTS,
					this.getNumberInputs());
		}

		//Date Created...
		if(this.getDateCreated() != null) {
			returnVal.put(JSONMapping.DATE_CREATED,
					this.getDateAsLongFromJson(this.getDateCreated()));
		}

		//Date Last Updated...
		if(this.getDateLastUpdated() != null) {
			returnVal.put(JSONMapping.DATE_LAST_UPDATED,
					this.getDateAsLongFromJson(this.getDateLastUpdated()));
		}

		//Current User...
		if(this.getCurrentUser() != null) {
			returnVal.put(
					JSONMapping.CURRENT_USER,
					this.getCurrentUser().toJsonObject());
		}

		//State...
		if(this.getState() != null) {
			returnVal.put(
					JSONMapping.STATE,
					this.getState());
		}

		//Flow State...
		if(this.getFlowState() != null) {
			returnVal.put(
					JSONMapping.FLOW_STATE,
					this.getFlowState());
		}

		//Form Fields...
		if(this.getFormFields() != null && !this.getFormFields().isEmpty()) {
			JSONArray formFieldsArr = new JSONArray();
			for(Field toAdd :this.getFormFields())
			{
				formFieldsArr.put(toAdd.toJsonObject());
			}

			returnVal.put(JSONMapping.FORM_FIELDS, formFieldsArr);
		}

		//Associated Flows...
		if(this.getAssociatedFlows() != null && !this.getAssociatedFlows().isEmpty()) {
			JSONArray assoJobsArr = new JSONArray();
			for(Flow toAdd :this.getAssociatedFlows())
			{
				assoJobsArr.put(toAdd.toJsonObject());
			}

			returnVal.put(JSONMapping.ASSOCIATED_FLOWS, assoJobsArr);
		}

		//Ancestor...
		Long ancestorIdLcl = this.getAncestorId();
		if(ancestorIdLcl != null) {
			returnVal.put(JSONMapping.ANCESTOR_ID, ancestorIdLcl);
		}

		//Table Field Parent Id...
		if(this.getTableFieldParentId() != null) {
			returnVal.put(JSONMapping.TABLE_FIELD_PARENT_ID,
					this.getTableFieldParentId());
		}

		//Descendant Ids...
		if(this.getDescendantIds() != null && !this.getDescendantIds().isEmpty()) {
			JSONArray array = new JSONArray();

			for(Long formId : this.getDescendantIds()) {
				array.put(formId);
			}

			returnVal.put(JSONMapping.DESCENDANT_IDS, array);
		}

		return returnVal;
	}
@Override
	@XmlTransient
	public JSONObject toJsonObject() throws JSONException {
		JSONObject returnVal = super.toJsonObject();

		//Form Type...
		if(this.getFormType() != null) {
			returnVal.put(JSONMapping.FORM_TYPE, this.getFormType());
		}

		//Form Type Id...
		if(this.getFormTypeId() != null) {
			returnVal.put(JSONMapping.FORM_TYPE_ID, this.getFormTypeId());
		}

		//Title...
		if(this.getTitle() != null) {
			returnVal.put(JSONMapping.TITLE, this.getTitle());
		}

		//Form Description...
		if(this.getFormDescription() != null) {
			returnVal.put(JSONMapping.FORM_DESCRIPTION, this.getFormDescription());
		}

		//Ancestor Label...
		if(this.getAncestorLabel() != null) {
			returnVal.put(JSONMapping.ANCESTOR_LABEL,
					this.getAncestorLabel());
		}

		//Descendant Label...
		if(this.getDescendantsLabel() != null) {
			returnVal.put(JSONMapping.DESCENDANTS_LABEL,
					this.getDescendantsLabel());
		}

		//Number Inputs...
		if(this.getNumberInputs() != null) {
			returnVal.put(JSONMapping.NUMBER_INPUTS,
					this.getNumberInputs());
		}

		//Date Created...
		if(this.getDateCreated() != null) {
			returnVal.put(JSONMapping.DATE_CREATED,
					this.getDateAsLongFromJson(this.getDateCreated()));
		}

		//Date Last Updated...
		if(this.getDateLastUpdated() != null) {
			returnVal.put(JSONMapping.DATE_LAST_UPDATED,
					this.getDateAsLongFromJson(this.getDateLastUpdated()));
		}

		//Current User...
		if(this.getCurrentUser() != null) {
			returnVal.put(
					JSONMapping.CURRENT_USER,
					this.getCurrentUser().toJsonObject());
		}

		//State...
		if(this.getState() != null) {
			returnVal.put(
					JSONMapping.STATE,
					this.getState());
		}

		//Flow State...
		if(this.getFlowState() != null) {
			returnVal.put(
					JSONMapping.FLOW_STATE,
					this.getFlowState());
		}

		//Form Fields...
		if(this.getFormFields() != null && !this.getFormFields().isEmpty()) {
			JSONArray formFieldsArr = new JSONArray();
			for(Field toAdd :this.getFormFields())
			{
				formFieldsArr.put(toAdd.toJsonObject());
			}

			returnVal.put(JSONMapping.FORM_FIELDS, formFieldsArr);
		}

		//Associated Flows...
		if(this.getAssociatedFlows() != null && !this.getAssociatedFlows().isEmpty()) {
			JSONArray assoJobsArr = new JSONArray();
			for(Flow toAdd :this.getAssociatedFlows())
			{
				assoJobsArr.put(toAdd.toJsonObject());
			}

			returnVal.put(JSONMapping.ASSOCIATED_FLOWS, assoJobsArr);
		}

		//Ancestor...
		Long ancestorIdLcl = this.getAncestorId();
		if(ancestorIdLcl != null) {
			returnVal.put(JSONMapping.ANCESTOR_ID, ancestorIdLcl);
		}

		//Table Field Parent Id...
		if(this.getTableFieldParentId() != null) {
			returnVal.put(JSONMapping.TABLE_FIELD_PARENT_ID,
					this.getTableFieldParentId());
		}

		//Descendant Ids...
		if(this.getDescendantIds() != null && !this.getDescendantIds().isEmpty()) {
			JSONArray array = new JSONArray();

			for(Long formId : this.getDescendantIds()) {
				array.put(formId);
			}

			returnVal.put(JSONMapping.DESCENDANT_IDS, array);
		}

		return returnVal;
	}
@ Override @ XmlTransient public JSONObject toJsonObject ( ) throws JSONException { JSONObject returnVal = super . toJsonObject ( ) ; //Form Type... if ( this . getFormType ( ) != null ) { returnVal . put ( JSONMapping . FORM_TYPE , this . getFormType ( ) ) ; } //Form Type Id... if ( this . getFormTypeId ( ) != null ) { returnVal . put ( JSONMapping . FORM_TYPE_ID , this . getFormTypeId ( ) ) ; } //Title... if ( this . getTitle ( ) != null ) { returnVal . put ( JSONMapping . TITLE , this . getTitle ( ) ) ; } //Form Description... if ( this . getFormDescription ( ) != null ) { returnVal . put ( JSONMapping . FORM_DESCRIPTION , this . getFormDescription ( ) ) ; } //Ancestor Label... if ( this . getAncestorLabel ( ) != null ) { returnVal . put ( JSONMapping . ANCESTOR_LABEL , this . getAncestorLabel ( ) ) ; } //Descendant Label... if ( this . getDescendantsLabel ( ) != null ) { returnVal . put ( JSONMapping . DESCENDANTS_LABEL , this . getDescendantsLabel ( ) ) ; } //Number Inputs... if ( this . getNumberInputs ( ) != null ) { returnVal . put ( JSONMapping . NUMBER_INPUTS , this . getNumberInputs ( ) ) ; } //Date Created... if ( this . getDateCreated ( ) != null ) { returnVal . put ( JSONMapping . DATE_CREATED , this . getDateAsLongFromJson ( this . getDateCreated ( ) ) ) ; } //Date Last Updated... if ( this . getDateLastUpdated ( ) != null ) { returnVal . put ( JSONMapping . DATE_LAST_UPDATED , this . getDateAsLongFromJson ( this . getDateLastUpdated ( ) ) ) ; } //Current User... if ( this . getCurrentUser ( ) != null ) { returnVal . put ( JSONMapping . CURRENT_USER , this . getCurrentUser ( ) . toJsonObject ( ) ) ; } //State... if ( this . getState ( ) != null ) { returnVal . put ( JSONMapping . STATE , this . getState ( ) ) ; } //Flow State... if ( this . getFlowState ( ) != null ) { returnVal . put ( JSONMapping . FLOW_STATE , this . getFlowState ( ) ) ; } //Form Fields... if ( this . getFormFields ( ) != null && ! this . getFormFields ( ) . isEmpty ( ) ) { JSONArray formFieldsArr = new JSONArray ( ) ; for ( Field toAdd : this . getFormFields ( ) ) { formFieldsArr . put ( toAdd . toJsonObject ( ) ) ; } returnVal . put ( JSONMapping . FORM_FIELDS , formFieldsArr ) ; } //Associated Flows... if ( this . getAssociatedFlows ( ) != null && ! this . getAssociatedFlows ( ) . isEmpty ( ) ) { JSONArray assoJobsArr = new JSONArray ( ) ; for ( Flow toAdd : this . getAssociatedFlows ( ) ) { assoJobsArr . put ( toAdd . toJsonObject ( ) ) ; } returnVal . put ( JSONMapping . ASSOCIATED_FLOWS , assoJobsArr ) ; } //Ancestor... Long ancestorIdLcl = this . getAncestorId ( ) ; if ( ancestorIdLcl != null ) { returnVal . put ( JSONMapping . ANCESTOR_ID , ancestorIdLcl ) ; } //Table Field Parent Id... if ( this . getTableFieldParentId ( ) != null ) { returnVal . put ( JSONMapping . TABLE_FIELD_PARENT_ID , this . getTableFieldParentId ( ) ) ; } //Descendant Ids... if ( this . getDescendantIds ( ) != null && ! this . getDescendantIds ( ) . isEmpty ( ) ) { JSONArray array = new JSONArray ( ) ; for ( Long formId : this . getDescendantIds ( ) ) { array . put ( formId ) ; } returnVal . put ( JSONMapping . DESCENDANT_IDS , array ) ; } return returnVal ; }
Conversion to {@code JSONObject} from Java Object.

@return {@code JSONObject} representation of {@code Form}
@throws JSONException If there is a problem with the JSON Body.

@see ABaseFluidJSONObject#toJsonObject()
Conversion to { @code JSONObject } from Java Object .