Update Custom Attributes

This service enables user to update custom/non-custom attribute. For example if user wants to update the display name of an attribute, this service can be consumed to do so. There are some constraints over using the said service. One cannot update the following attribute(s).

  • BO_NAME

  • ENTITY

  • BO_ATTR_NAME

  • ATTRIBUTE

This service can not only update the metadata of an attribute but also can update the physical property of that very attribute. For example user can also update the data type of an attribute. For example if attribute data type is `CHARACTER VARYING(100)' and user wants to increase its size to `CHARACTER VARYING(150)'. In that case, not only metadata will be updated but physical table will also be updated without deleting the data inside it (physical table).

IMPORTANT

The attribute data type will only be updated if it’s supported by the respective DB. In case of errors the same error message, returned from DB, is returned by the service. For example if user wants to update an attribute that have datatype of `CHARACTER VARYING' and if data resides against the same attribute and user tries to update the data type to `INTEGER', this is not allowed and this will throw error.

This service will issue alter statement to the physical if any of the following attribute’s property update request is received.

  • ATTRIBUTE_DATATYPE

  • ATTRIBUTE_DEFAULT

  • IS_NOT_NULL

  • IS_MANDATORY

    IMPORTANT

    The alter statement is issues by our service and will only be successful if it is supported by the respective DB. In case of any errors, the error message returned by the DB is returned by the service.

In addition to the above constraints, there are also some constraints for reference fields updating that are listed below:

  • If IS*REFERENCE*IDN is true then user must provide the values for other reference columns like for REFERENCE_BO_NAME, REFERENCE_BO_ATTR_VALUE and REFERENCE_BO_ATTR_LABEL. And if this is false, user must remove the same above reference columns by sending null values in the request packet against the same other reference attributes.

  • In case user updates any reference data fields then it is verified that the REFERENCE_BO_ATTR_VALUE and REFERENCE_BO_ATTR_LABEL must exists in REFERENCE_BO_NAME.

  • In case of RELATED_BO_ATTR_NAME update it is made sure that RELATED_BO_ATTR_NAME already exists in the current/same business object.

  • In case of UNIT update, the service expects there’s no data against that attribute in physical table. If any data exists, service will throw error.

1. Request URL

/{PDM Server domain}/metadata/write/updateCustomAttributes

Method: POST

2. Request headers

Name Value

Content-Type

application/json

3. Response Type

Name Value

responseType

blob

4. Request body

{
    "BUSINESS OBJECT": {
        "language": "en",
        "readBack": true,
        "timezone": "GMT+08:00",
        "showSQLStats": true,
        "data": [
            {
                "BO_NAME": "{{boName}}",
                "BO_ATTR_NAME": "{{attribute}}",
                "ATTRIBUTE_DISPLAYNAME": "{{attribute_displayname}}",
                "ATTRIBUTE_DATATYPE": "character varying(100)"
            }
        ]
    }
}
Try it myself

5. Responses

When response.status = 200, It will response a `application/octet-stream' excel file.

Otherwise, it will response json file, Please see Responses