logo
logo

Operations

The details of the changes to perform are contained in a JobDescription entity. This entity contains two properties: Job.Configuration and Job.Data. Job.Data is not used at this time, and Job.Configuration contains a JSON document with the details on the changes involved.

The JobConfiguration document is essentially the Create Mass Edit Job Request object that was submitted through the Mass Edit Job Collection resource and contains an array of Operation objects. Each operation object contains the type of operation involved and some parameters. The following operations are available:

Set property

Here's an example of a Set property operation:

{
    ...
    "operations":[
        ...
        {
            "type":"SetProperty",
            "property":"AssetName",
            "culture":"en-US",
            "value":"New name for this Asset."
        },
        ...
    ]
    ...
}

property : The name of the property to modify.

culture : Optionally, the name of the culture for which to set the property. Not required on non-multilingual properties. If ommitted on a multilingual property, the value is expected to be an dictionary with a new value for every culture.

value : The value to set on the property. The type of value is determined by the type of property and whether that property is multilingual and/or multivalue.

Append property

Here's an example of an Append property operation:

{
    ...
    "operations":[
        ...
        {
            "type":"AppendProperty",
            "property":"Description",
            "culture":"en-US",
            "value":"Added description"
        },
        ...
    ]
    ...
}

property : The name of the property to append.

culture : Optionally, the name of the culture for which to append the property. Not required on non-multilingual properties. If ommitted on a multilingual property, the value is expected to be an dictionary with a new value for every culture.

value : The value to append on the property. The type of value is determined by the type of property and whether that property is multilingual or not. Only String properties are supported.

Clear relation

When clearing a relation, all existing related entities are removed.

Here is an example of a "Clear relation" operation:

{
    "operations":[
        ...
        {
            "type":"ClearRelation",
            "relation":"AssetToAssetType",
            "role":"Child"
        },
        ...
    ]
}

relation : The name of the relation to clear.

role : The type of role to change. Can be either "Child" or "Parent".

Add relation

When adding to a relation, the specified related entities that are not present are added at the end of the relation.

Here is an example of an "Add relation" operation:

{
    "operations":[
        ...
        {
            "type":"AddRelation",
            "relation":"AssetToAssetType",
            "role":"Child",
            "value":[
                {
                    "href":"http://server/api/entities/14"
                }
            ]
        },
        ...
    ]
}

relation : The name of the relation to modify.

role : The type of role to change. Can be either "Child" or "Parent".

value : A link object or an array of link objects referring to the related entities to add on the relation.

Remove relation

When removing from a relation, the specified related entities that are present are removed from the relation.

Here is an example of a "Remove relation" operation:

{
    "operations":[
        ...
        {
            "type":"RemoveRelation",
            "relation":"AssetToAssetType",
            "role":"Child",
            "value":[
                {
                    "href":"http://server/api/entities/14"
                }
            ]
        },
        ...
    ]
}

relation : The name of the relation to modify.

role : The type of role to change. Can be either "Child" or "Parent".

value : A link object or an array of link objects referring to the related entities to remove from the relation.

Submit Entity

When submitting an entity:

{
    "operations":[
        ...
        {
            "type":"Submit"
        },
        ...
    ]
}

Approve Entity

When approving an entity:

{
    "operations":[
        ...
        {
            "type":"Approve"
        },
        ...
    ]
}

Reject Entity

When rejecting an entity:

{
    "operations":[
        ...
        {
            "type":"Reject"
        },
        ...
    ]
}

Delete Entity

When deleting an entity, all other operations are ignored, and the targetted entity is deleted. If the entity does not exist, nothing happens.

Here is an example of a 'Delete Entity' operation:

{
    "operations":[
        ...
        {
            "type":"DeleteEntity"
        }
        ...
    ]
}

Can we improve this article ? Provide feedback