function getData()

in ui-modules/blueprint-composer/app/components/util/model/entity.model.js [982:1030]


function getData(includeChildren = true) {
    if (!ID.has(this)) { // Entity has already been garbage collected
        return {};
    }

    let result = this.getMetadataAsJson();
    if (this.hasConfig()) {
        result[FIELD.CONFIG] = this.getConfigAsJson();
    }
    if (this.hasParameters()) {
        result[FIELD.PARAMETERS] = this.getParametersAsArray();
    }
    if (this.hasInitializers()) {
        result[FIELD.INITIALIZERS] = this.getInitializersAsArray();
    }
    if (this.hasLocation()) {
        result[FIELD.LOCATION] = LOCATION.get(this);
    }
    if (this.hasLocations()) {
        result[FIELD.LOCATIONS] = LOCATIONS.get(this);
    }
    if (this.hasChildren() && includeChildren) {
        let children = [];
        for (let child of CHILDREN.get(this).values()) {
            children.push(child.getData());
        }
        if (this.hasParent()) {
            result[FIELD.CHILDREN] = children;
        } else {
            result[FIELD.SERVICES] = children;
        }
    }
    if (this.hasPolicies()) {
        let policies = [];
        for (let policy of POLICIES.get(this).values()) {
            policies.push(policy.getData());
        }
        result[FIELD.POLICIES] = policies;
    }
    if (this.hasEnrichers()) {
        let enrichers = [];
        for (let enricher of ENRICHERS.get(this).values()) {
            enrichers.push(enricher.getData());
        }
        result[FIELD.ENRICHERS] = enrichers;
    }

    return deepMerge(result, this.miscData.get('virtual'));
}