DeliveryRequestTemplateInstance

The DeliveryRequestTemplateInstance will define that a certain DeliveryRequestTemplate should be created for EditorialObjects matching a certain filter.

Property Reference

This is a table of the properties of a DeliveryRequestTemplateInstance object. Some properties are discussed in more detail below.

Field Name Required Type Description Format

created

Date

The time when this resource was created

date-time

createdBy

String

The request or process that created this resource

id

Long

The id of this resource

int64

lastUpdated

Date

The time when this resource was last updated

date-time

modifiedBy

String

The request or process responsible for the last update of this resource

objectType

String

The data model type or class name of this resource

overrideProperties

Object

query

ObjectFilter

template

DeliveryRequestTemplate

templateContext

String

templateGroup

DeliveryRequestTemplateGroup

templateHandle

String

version

Long

The version of this resource, used for Optimistic Locking

int64

query

The query property determines whether the Editorial Object fulfils the condition for creating a DeliveryRequestInstance.

overrideProperties

The DeliveryRequest is created using the values defined in the template, after which some properties can be overwritten by the values in overrideProperties. Expressions are supported by prefixing the property with @. Then the value of the property is evaluated with the expression engine. The objects available for use in these expressions are listed in the table below.

Table 1. Available objects in the expressions
object Description

production

the production in which the DeliveryRequest will be created

productionSettings

the settings of the production

editorialObject

the editorialObject the DeliveryRequest will be attached to (optional)

account

the account of the production

accountSettings

the settings of the account

participants

the list of production participants

  • useful for selecting a reviewer/supplier

  • contains the role of the participant in the production

context

context allows you to use objects and parameters available in the context of the bootstrap task.

If the bootstrap task has input

{
    "deliveryRequestTemplating": {
      "contextParameters": {
        "volumeAccessHandle": "\"1a5193bc-c884-4999-b335-5ed81d31ff2e\""
      },
      "deliveryRequestTemplateGroupHandle": "dpg-template-poc",
      ...
    }
}

one can use context.THEKEY (e.g. context.volumeAccessHandle) to access fields of the contextParameters object. The context object will also contain other contextual objects like production.

More Examples

Example 1

Below you can see a DeliveryRequestTemplateInstance which defines that for each EditorialObject which has a custom field productType with value "Series", there should exist a DeliveryRequest based on the DeliveryRequestTemplate with handle "seasonVisuals".

{
    query: {
        key: 'editorialObject.customFields.productType.value',
        values: [
            'Series'
        ],
    },
    templateHandle: 'seasonVisuals',
    templateContext: 'EditorialObject',
    overrideProperties: {
        volumeAccessQuery: {
            key: 'handle',
            '@values': [
                'context.parameters.volumeAccessHandle'
            ],
        },
    },
}

The query property determines whether the Editorial Object fulfils the condition for creating a DeliveryRequestInstance.

{
    query: {
        key: 'editorialObject.customFields.productType.value',
        values: [
            'Series'
        ],
    },
    ...
}

The Editorial Object must have a custom field called productType with value 'Series'. If this is the case, a DeliveryRequest will be created based on the template given by seasonVisuals for this Editorial Object.

The overrideProperties is used to set certain fields of the request based on properties of the EditorialObject or the context.

Example 2

Below you can see a DeliveryRequestTemplateInstance which defines that for each EditorialObject which has a custom field productType with value "Series", there should exist a DeliveryRequest based on the DeliveryRequestTemplate with handle "seasonMetadata".

The overrideProperties are used here to set the description of the DeliveryRequest, as well as set the defaultValue of some of the form fields.

{
    query: {
        key: 'editorialObject.customFields.productType.value',
        values: [
            'Series'
        ],
    },
    templateHandle: 'seasonMetadata',
    templateContext: 'EditorialObject',
    overrideProperties: {
        '@description': "'Please provide the season-level metadata for '+ editorialObject.customFields.episodeTitle.value",
        formFieldDefaultValues: {
            productionHouse: {
                '@value': 'editorialObject.customFields.productionHouse.value',
            },
            externalReference: {
                '@value': 'editorialObject.customFields.externalReference.value',
            },
        },
    },
}