Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Triggers and Actions can be used to address a number of business requirements that cannot be configured in vault. This page describes some of the common use cases along with sample code that you can use with your vault to step through the code in the Vault Java SDK Debugger.
The vsdk-document-sample project covers the use of custom actions on a document of type vSDK Document. The actions will step through:
- Updating fields on the vSDK Document and on its related vSDK Documents with a user action.
- Creating related vSDK Document Task records with a state change entry action.
Unlike Record Triggers, custom actions must be deployed to vault and configured on a Document or Object Lifecycle State in order for it to be available in the UI. This means you CANNOT debug your action code until they have been deployed. See Actions for more information.
For this project, the custom actions and necessary vault components are contained in the two separate vault packages (VPK). The VPKs are located in the project's deploy-vpk directory and need to be deployed to your vault prior to debugging these use cases:
Clone or download the sample Maven project vSDK Document Sample project from GitHub.
Run through the Getting Started guide to set up your development environment.
Log in to your vault and navigate to Admin > Deployment > Inbound Packages and click Import:
Deploy Object Action code: Select the
From the Actions menu, select Review & Deploy. Vault displays a list of all components in the package.
On the confirmation page, review and click Finish. You will receive an email when Vault completes the deployment.
Repeat steps 3-6 for the vault components:
Create two documents with the vSDK Document type:
- From the main page select Create > Upload
- Upload the Parent vSDK Document.txt and Related vSDK Document.txt files in the deploy-vpk directory:
Navigate to the Parent vSDK Document, click the blue (+) button next to the Supporting Documents section on the right hand side and then add (+) the Related vSDK Document:
Once the package has been deployed and the documents have been created, you will want to review the configuration and understand the normal behavior so you can observe the effects of the sample trigger code.
Below is a rundown of the included components.
- vSDK Document
- vSDK External Id (vsdk_external_id__c)
- Run vSDK Change Field User Action (ChangeFieldsDocumentUserAction.java)
- Change State to "Entry Action via SDK"
Entry Action via SDK State:
- Run vSDK Create Records Entry Action (CreateRecordsDocumentEntryAction.java)
- Change State to Draft
Document Notification Template
- vSDK Notification Template (vsdk_notification_template__c)
- vSDK Document Task (vsdk_document_task__c)