kevinn-veeva edited this page Dec 14, 2018 · 9 revisions

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.


Introduction

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.

Setup

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:

  1. Clone or download the sample Maven project vSDK Document Sample project from GitHub.

  2. Run through the Getting Started guide to set up your development environment.

  3. Log in to your vault and navigate to Admin > Deployment > Inbound Packages and click Import:

    Deploy Object Action code: Select the \deploy-vpk\code\vsdk-document-sample-code.vpk file.

  4. From the Actions menu, select Review & Deploy. Vault displays a list of all components in the package.
    reviewdeploy-code

  5. Click Next.

  6. On the confirmation page, review and click Finish. You will receive an email when Vault completes the deployment.

  7. Repeat steps 3-6 for the vault components:

    Base Vault: \deploy-vpk\components\Base_vsdk-document-sample-components\Base_vsdk-document-sample-components.vpk file.

    Multichannel Vault: \deploy-vpk\components\Multichannel_vsdk-document-sample-components\Multichannel_vsdk-document-sample-components.vpk file.

    Clinical Vault: \deploy-vpk\components\Clinical_vsdk-document-sample-components\Clinical_vsdk-document-sample-components.vpk file.

    RIM Vault: \deploy-vpk\components\RIM_vsdk-document-sample-components\RIM_vsdk-document-sample-components.vpk file.

    Quality Vault: \deploy-vpk\components\Quality_vsdk-document-sample-components\Quality_vsdk-document-sample-components.vpk file.

  8. 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:
      createdocument
  9. 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:

    relateddocument

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.

Document Types

  • vSDK Document

Document Fields

  • vSDK External Id (vsdk_external_id__c)

Document Actions

Draft State:

  • 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)

Objects

  • vSDK Document Task (vsdk_document_task__c)

Lifecycles

lifecycle

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.