public class DocumentWorkflowRequest extends VaultRequest<DocumentWorkflowRequest>
HTTP_HEADER_AUTHORIZATION, HTTP_HEADER_REFERENCE_ID, HTTP_HEADER_VAULT_CLIENT_ID, referenceId, vaultClient| Modifier and Type | Method and Description |
|---|---|
InitiateDocumentWorkflowResponse |
initiateDocumentWorkflow(String workflowName,
List<String> documents,
Map<String,String> participantName,
String description)
Initiate Document Workflow
Initiate a document workflow on a set of documents. |
DocumentWorkflowResponse |
retrieveAllDocumentWorkflows()
Retrieve All Document Workflows
Retrieve all available document workflows that can be initiated on a set of documents |
DocumentWorkflowDetailsResponse |
retrieveDocumentWorkflowDetails(String workflowName)
Retrieve Document Workflow Details
Retrieves the details for a specific document workflow. |
DocumentWorkflowRequest |
setAcceptJSON()
Set the Header Accept to return JSON
|
DocumentWorkflowRequest |
setLoc(Boolean loc)
When localized (translated) strings are available, retrieve them by setting
loc to true
|
getBaseObjectMapper, send, send, sendReturnBinary, sendReturnBinary, sendToFile, sendToFile, setHeaderReferenceId, setVaultClientpublic DocumentWorkflowResponse retrieveAllDocumentWorkflows()
GET /api/{version}/objects/documents/actions
DocumentWorkflowResponse resp = vaultClient.newRequest(DocumentWorkflowRequest.class)
.retrieveAllDocumentWorkflows();
if (resp.getData() != null) {
for (DocumentWorkflow workflow : resp.getData()) {
System.out.println("------------------------------");
System.out.println("Name " + workflow.getName());
System.out.println("Label " + workflow.getLabel());
System.out.println("Type " + workflow.getType());
}
}public DocumentWorkflowDetailsResponse retrieveDocumentWorkflowDetails(String workflowName)
workflowName - The document workflow name value. Obtained from the
Retrieve All Document Workflows request
retrieveAllDocumentWorkflows()
GET /api/{version}/objects/documents/actions/{workflow_name}
DocumentWorkflowDetailsResponse resp = vaultClient.newRequest(DocumentWorkflowRequest.class)
.retrieveDocumentWorkflowDetails(workflowName);
if (resp.getData() != null) {
DocumentWorkflowDetailsResponse.DocumentWorkflow workflow = resp.getData();
System.out.println("Workflow Name " + workflow.getName());
System.out.println("------------------------------");
for (Control con : workflow.getControls()) {
System.out.println("Control Exist\n");
System.out.println("------------------------------");
System.out.println("Control Instruction " + con.getInstructions());
System.out.println("Control Label " + con.getLabel());
System.out.println("Control Type " + con.getType());
for (Prompt prompts : con.getPrompts()) {
System.out.println("\tPrompts Exist\n");
System.out.println("------------------------------");
System.out.println("\tPrompt Lable " + prompts.getLabel());
System.out.println("\tPrompt Name " + prompts.getName());
System.out.println("\tPrompt Multivalue " + prompts.getMultiValue());
}
}
}
public InitiateDocumentWorkflowResponse initiateDocumentWorkflow(String workflowName, List<String> documents, Map<String,String> participantName, String description)
workflowName - The document workflow name value. Obtained from the
Retrieve All Document Workflows request
retrieveAllDocumentWorkflows()documents - Input a comma-separated list of document id field values.participantName - Enter the participant name and input the user or group id value. For example, approvers__c: user:123,group:234.description - Description of the workflow. Maximum 1,000 characters.
POST /api/{version}/objects/documents/actions/{workflow_name}
InitiateDocumentWorkflowResponse resp = vaultClient.newRequest(DocumentWorkflowRequest.class)
.initiateDocumentWorkflow(workflowName, documents,participantName,description);
System.out.println("Status = " + resp.getResponseStatus());
if (resp.isSuccessful()) {
System.out.println("Record ID " + resp.getData().getRecordId());
System.out.println("Record URL " + resp.getData().getRecordUrl());
System.out.println("Workflow ID " + resp.getData().getWorkflowId());
}public DocumentWorkflowRequest setLoc(Boolean loc)
loc - Set to true to retrieve localized (translated) strings (if
available)public DocumentWorkflowRequest setAcceptJSON()
Copyright © 2024. All rights reserved.