A deployment spec contains Datapack specific logic and allows hooking into the deployment process to manipulate what get's deployed and execute post-deployment activation logic.

Implementers can implement any of the specified functions in this interface, all functions are optional and only the implemented functions are executed.

For many standard datapacks spec logic is implemented under the ./deploymentSpecs folder.

Hierarchy

  • DatapackDeploymentSpec

Implemented by

Methods

  • This hook is called after all records of a datapack are deployed and will only be called once for every datapack in the deployment. Use this hook to execute datapack activation logic. It is comparable to post-step in Vlocity tools and should also execute any activation logic if required.

    Use the getDeployedRecords function to get a list of deployed records for a specific SObject type. This excludes any records that didn't get deployed.

    The type argument passed to getRecords should not be prefixed with a namespace even if the object you try to access has a namespace; see also __type.

    Parameters

    Returns any

  • Executes after a group of records is deployed, at this stage it is not possible to change any field value anymore. The hook point can be used to run post-deployment validations or post-deployment activation processes.

    Note: this runs on record level and use __type to run datapack activation processes.

    Parameters

    • event: readonly DatapackDeploymentRecord[]

      Array of records that got deployed; contains both the failed and success records.

    Returns any

  • This hook is almost identical to the __type hook except that executes after a datapack is converted into 1 or more Salesforce records.

    The list of records past into this hook contains all the records generated for a single datapack; it is not possible to remove/drop any record but individual records can be manipulated,

    Note At this point dependencies are not yet resolved

    Parameters

    Returns any

  • This hook is called before deploying the first record in a datapack, and is only called once very datapack in the deployment.

    • Use this hook to execute and pre-deployment actions. This action is comparable with the pre-step job from the Vlocity tools library.
    • Use the getRecords function to get a list of records for a specific SObject type.

    The type argument passed to getRecords should not be prefixed with a namespace. I.e; to get a list of OmniScript__c records in the deployment use:

    DatapackDeploymentEvent.getRecords('OmniScript__c')
    

    instead of

    DatapackDeploymentEvent.getRecords('vlocity_cmt__OmniScript__c')
    

    The event object also exposes getDeployedRecords; in the __type this will always return an empty array.

    Parameters

    Returns any

  • Executed just before the records are being deployed; the event contains a readonly array of records. At this stage values for the records can still be manipulated. This hook point should only be used to run logic that depends on all dependencies on individual record level are resolved.

    Note: this runs on record level and use __type to run datapack activation processes.

    Parameters

    Returns any

  • Executed before a record is retried; this hook point can be used to run any logic that should be executed before a record is retried such as updating the record values ot changing the upsert fields.

    This hook point is called before dependency resolution.

    Parameters

    Returns any

  • This function executes before a datapack is converted into a set of DatapackDeploymentRecord's and allow changing the datapack data, correct faulty field values that would otherwise cause errors during record conversion or remove certain fields that should not be deployed.

    This hook can also be used to override certain fields with autogenerated values; i.e. setting the element order and level field of OmniScript elements

    Parameters

    Returns any