Doctype Triggers are a new Vault Java SDK entry point that allows Vault application developers and customers to extend Vault Document functionality. Triggers execute at the document version model layer with pre- and post- events for insert, update, and delete actions on document metadata.
Documents have a complex data structure with both a hierarchical Doctype structure and versioning. In Vault, actions are performed on document versions in bulk across Doctypes. Therefore, triggers will fire on document and document version events only.
This project contains 3 Doctype Trigger examples:
DefaultDocumentFieldValue: This trigger fires on a BEFORE_UPDATE event. Iftitle__vis blank, it sets the value to the same value asname__vPreventLowercase: This trigger fires on a BEFORE_UPDATE event. Ifname__vstarts with a lowercase letter, a row level error is set to prevent the update.StartJobOnFieldChange: This trigger fires on an AFTER_UPDATE event. If thename__vfield value has changed, an async SDK Job is started to notify the document owner.
All triggers are set on the base_document__v Doctype and will fire for all document types in the Vault.
- Download the Hello World Project for SDK Doctype Triggers
- Deploy the
HELLO-SDK-DOCTYPE-TRIGGERVPK located inside of the Hello World project at:vsdk-hello-doctype-trigger/deployment/packages/. This package contains the configuration and code for this project.
To make changes to the code and deploy those changes to a Vault, use the Vault Java SDK Maven Plugin. The pom.xml file includes the plugin details, but you must update the configuration values.