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

        //Name...
        if(this.getName() != null)
        {
            returnVal.put(JSONMapping.NAME,this.getName());
        }

        //Description...
        if(this.getDescription() != null)
        {
            returnVal.put(JSONMapping.DESCRIPTION,this.getDescription());
        }

        //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()));
        }

        //Flow...
        if(this.getFlow() != null)
        {
            returnVal.put(JSONMapping.FLOW,
                    this.getFlow().toJsonObject());
        }

        //Flow Step Type...
        if(this.getFlowStepType() != null)
        {
            returnVal.put(JSONMapping.FLOW_STEP_TYPE,this.getFlowStepType());
        }

        //Flow Step Parent Id...
        if(this.getFlowStepParentId() != null)
        {
            returnVal.put(
                    JSONMapping.FLOW_STEP_PARENT_ID, this.getFlowStepParentId());
        }

        //Entry Rules...
        if(this.getEntryRules() != null && !this.getEntryRules().isEmpty())
        {
            JSONArray jsonArray = new JSONArray();

            for(FlowStepRule rule : this.getEntryRules())
            {
                jsonArray.put(rule.toJsonObject());
            }

            returnVal.put(JSONMapping.ENTRY_RULES, jsonArray);
        }

        //Exit Rules...
        if(this.getExitRules() != null && !this.getExitRules().isEmpty())
        {
            JSONArray jsonArray = new JSONArray();

            for(FlowStepRule rule : this.getExitRules())
            {
                jsonArray.put(rule.toJsonObject());
            }

            returnVal.put(JSONMapping.EXIT_RULES, jsonArray);
        }

        //View Rules...
        if(this.getViewRules() != null && !this.getViewRules().isEmpty())
        {
            JSONArray jsonArray = new JSONArray();

            for(FlowStepRule rule : this.getViewRules())
            {
                jsonArray.put(rule.toJsonObject());
            }

            returnVal.put(JSONMapping.VIEW_RULES, jsonArray);
        }

        //Step Properties...
        if(this.getStepProperties() != null && !this.getStepProperties().isEmpty())
        {
            JSONArray jsonArray = new JSONArray();

            for(StepProperty stepProperty : this.getStepProperties())
            {
                jsonArray.put(stepProperty.toJsonObject());
            }

            returnVal.put(JSONMapping.STEP_PROPERTIES, jsonArray);
        }

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

        //Name...
        if(this.getName() != null)
        {
            returnVal.put(JSONMapping.NAME,this.getName());
        }

        //Description...
        if(this.getDescription() != null)
        {
            returnVal.put(JSONMapping.DESCRIPTION,this.getDescription());
        }

        //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()));
        }

        //Flow...
        if(this.getFlow() != null)
        {
            returnVal.put(JSONMapping.FLOW,
                    this.getFlow().toJsonObject());
        }

        //Flow Step Type...
        if(this.getFlowStepType() != null)
        {
            returnVal.put(JSONMapping.FLOW_STEP_TYPE,this.getFlowStepType());
        }

        //Flow Step Parent Id...
        if(this.getFlowStepParentId() != null)
        {
            returnVal.put(
                    JSONMapping.FLOW_STEP_PARENT_ID, this.getFlowStepParentId());
        }

        //Entry Rules...
        if(this.getEntryRules() != null && !this.getEntryRules().isEmpty())
        {
            JSONArray jsonArray = new JSONArray();

            for(FlowStepRule rule : this.getEntryRules())
            {
                jsonArray.put(rule.toJsonObject());
            }

            returnVal.put(JSONMapping.ENTRY_RULES, jsonArray);
        }

        //Exit Rules...
        if(this.getExitRules() != null && !this.getExitRules().isEmpty())
        {
            JSONArray jsonArray = new JSONArray();

            for(FlowStepRule rule : this.getExitRules())
            {
                jsonArray.put(rule.toJsonObject());
            }

            returnVal.put(JSONMapping.EXIT_RULES, jsonArray);
        }

        //View Rules...
        if(this.getViewRules() != null && !this.getViewRules().isEmpty())
        {
            JSONArray jsonArray = new JSONArray();

            for(FlowStepRule rule : this.getViewRules())
            {
                jsonArray.put(rule.toJsonObject());
            }

            returnVal.put(JSONMapping.VIEW_RULES, jsonArray);
        }

        //Step Properties...
        if(this.getStepProperties() != null && !this.getStepProperties().isEmpty())
        {
            JSONArray jsonArray = new JSONArray();

            for(StepProperty stepProperty : this.getStepProperties())
            {
                jsonArray.put(stepProperty.toJsonObject());
            }

            returnVal.put(JSONMapping.STEP_PROPERTIES, jsonArray);
        }

        return returnVal;
    }
@ Override public JSONObject toJsonObject ( ) throws JSONException { JSONObject returnVal = super . toJsonObject ( ) ; //Name... if ( this . getName ( ) != null ) { returnVal . put ( JSONMapping . NAME , this . getName ( ) ) ; } //Description... if ( this . getDescription ( ) != null ) { returnVal . put ( JSONMapping . DESCRIPTION , this . getDescription ( ) ) ; } //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 ( ) ) ) ; } //Flow... if ( this . getFlow ( ) != null ) { returnVal . put ( JSONMapping . FLOW , this . getFlow ( ) . toJsonObject ( ) ) ; } //Flow Step Type... if ( this . getFlowStepType ( ) != null ) { returnVal . put ( JSONMapping . FLOW_STEP_TYPE , this . getFlowStepType ( ) ) ; } //Flow Step Parent Id... if ( this . getFlowStepParentId ( ) != null ) { returnVal . put ( JSONMapping . FLOW_STEP_PARENT_ID , this . getFlowStepParentId ( ) ) ; } //Entry Rules... if ( this . getEntryRules ( ) != null && ! this . getEntryRules ( ) . isEmpty ( ) ) { JSONArray jsonArray = new JSONArray ( ) ; for ( FlowStepRule rule : this . getEntryRules ( ) ) { jsonArray . put ( rule . toJsonObject ( ) ) ; } returnVal . put ( JSONMapping . ENTRY_RULES , jsonArray ) ; } //Exit Rules... if ( this . getExitRules ( ) != null && ! this . getExitRules ( ) . isEmpty ( ) ) { JSONArray jsonArray = new JSONArray ( ) ; for ( FlowStepRule rule : this . getExitRules ( ) ) { jsonArray . put ( rule . toJsonObject ( ) ) ; } returnVal . put ( JSONMapping . EXIT_RULES , jsonArray ) ; } //View Rules... if ( this . getViewRules ( ) != null && ! this . getViewRules ( ) . isEmpty ( ) ) { JSONArray jsonArray = new JSONArray ( ) ; for ( FlowStepRule rule : this . getViewRules ( ) ) { jsonArray . put ( rule . toJsonObject ( ) ) ; } returnVal . put ( JSONMapping . VIEW_RULES , jsonArray ) ; } //Step Properties... if ( this . getStepProperties ( ) != null && ! this . getStepProperties ( ) . isEmpty ( ) ) { JSONArray jsonArray = new JSONArray ( ) ; for ( StepProperty stepProperty : this . getStepProperties ( ) ) { jsonArray . put ( stepProperty . toJsonObject ( ) ) ; } returnVal . put ( JSONMapping . STEP_PROPERTIES , jsonArray ) ; } return returnVal ; }
Conversion to {@code JSONObject} from Java Object.

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

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