public class ObjectLifecycleWorkflowRequest extends VaultRequest
HTTP_HEADER_AUTHORIZATION, HTTP_HEADER_VAULT_CLIENT_ID, vaultClient| Modifier and Type | Method and Description |
|---|---|
ObjectRecordActionResponse |
initiateObjectActionOnASingleRecord(String objectName,
String recordId,
String actionName)
Initiate Object Action on a Single Record
|
ObjectRecordActionBulkResponse |
initiateObjectActionOnMultipleRecords(String objectName,
Set<String> recordIds,
String actionName)
Initiate Object Action on Multiple Records
|
VaultResponse |
initiateWorkflowAction(int workflowId,
String workflowAction)
Initiate Workflow Action
Initiate a workflow action on a specific object workflow. |
VaultResponse |
initiateWorkflowTaskAction(int taskId,
String taskAction)
Initiate Workflow Task Action
|
ObjectRecordActionResponse |
retrieveObjectRecordUserActionDetails(String objectName,
String recordId,
String actionName)
Retrieve Object User Action Details
|
ObjectRecordActionResponse |
retrieveObjectRecordUserActions(String objectName,
String recordId)
Retrieve Object Record User Actions
|
ObjectWorkflowTaskActionDetailsResponse |
retrieveObjectWorkflowTaskActionDetails(int taskId,
String taskAction)
Retrieve Workflow Tasks Actions Details
|
ObjectWorkflowActionResponse |
retrieveObjectWorkflowTaskActions(int taskId)
Retrieve Workflow Tasks Actions
|
ObjectWorkflowTaskResponse |
retrieveObjectWorkflowTaskDetails(int taskId)
Retrieve Workflow Tasks Details
|
ObjectWorkflowTaskResponse |
retrieveObjectWorkflowTasks(String object,
String recordId,
String assignee)
Retrieve Workflow Tasks, Retrieve Object Workflow Tasks
|
ObjectWorkflowActionDetailsResponse |
retrieveWorkflowActionDetails(int workflowId,
String workflowAction)
Retrieve Workflow Action Details
Retrieve details about a workflow action. |
ObjectWorkflowActionResponse |
retrieveWorkflowActions(int workflowId)
Retrieve Workflow Action
Retrieve the details for a specific object workflow. |
ObjectWorkflowResponse |
retrieveWorkflowDetails(int workflowId)
Retrieve Workflow Details
Retrieve the details for a specific object workflow. |
ObjectWorkflowResponse |
retrieveWorkflows(String object,
String recordId,
String participant)
Retrieve Workflows
|
ObjectLifecycleWorkflowRequest |
setBodyParams(Map<String,Object> bodyParams)
Single record form ObjectRecordRequest with name/value body parameters
|
ObjectLifecycleWorkflowRequest |
setDocumentIds(List<Integer> documentIdList)
Set the documents__sys body parameter to initiate actions on specific documents in a multi-doc workflow
|
ObjectLifecycleWorkflowRequest |
setLoc(boolean loc)
Set the loc
|
ObjectLifecycleWorkflowRequest |
setOffset(int offset)
Set the offset
|
ObjectLifecycleWorkflowRequest |
setPageSize(int pageSize)
Set the page size
|
ObjectLifecycleWorkflowRequest |
setStatus(String status)
Set the status
|
getBaseObjectMapper, send, send, sendReturnBinary, sendReturnBinary, sendToFile, sendToFile, setVaultClientpublic ObjectRecordActionResponse retrieveObjectRecordUserActions(String objectName, String recordId)
Retrieve all available user actions that can be initiated on a specific object record. Returned data can be retrieved via the "getActions" method.
objectName - The object name The object namerecordId - The object record id
GET /api/{version}/vobjects/{object_name}/{object_record_id}/actions
ObjectRecordActionResponse resp = vaultClient.newRequest(ObjectLifecycleWorkflowRequest.class)
.retrieveObjectRecordUserActions("tt_claim__c", "OOW000000000501");
if (resp.getData() != null) {
System.out.println("Actions Exist\n");
for (Action action : resp.getData()) {
System.out.println("------------------------------");
System.out.println("Name " + action.getName());
System.out.println("Label " + action.getLabel());
System.out.println("Type " + action.getType());
for (Link link : action.getLinks()) {
System.out.println("Rel " + link.getRel());
System.out.println("Accept " + link.getAccept());
System.out.println("Href " + link.getHref());
System.out.println("Method " + link.getMethod());
System.out.println("");
}
}
} else
System.out.println("No Actions Exist\n");
}public ObjectRecordActionResponse retrieveObjectRecordUserActionDetails(String objectName, String recordId, String actionName)
Retrieve the details for a specific user action.
Returned data can be retrieved via the "getActions" method. Note that the an array is returned instead of a single entity for a consistent response class. Responses with data will have an array of size one.
objectName - The object namerecordId - The object record idactionName - Obtained from the Retrieve User Actions request
retrieveObjectRecordUserActions(java.lang.String, java.lang.String)
GET /api/{version}/vobjects/{object_name}/{object_record_id}/actions/{action_name}
ObjectRecordActionResponse resp = vaultClient.newRequest(ObjectLifecycleWorkflowRequest.class)
.retrieveObjectRecordUserActionDetails(objectName, recordId, actionName);
if (resp.getData() != null) {
System.out.println("Actions Exist\n");
for (Action action : resp.getData()) {
System.out.println("------------------------------");
System.out.println("Name " + action.getName());
System.out.println("Label " + action.getLabel());
System.out.println("Type " + action.getType());
for (Link link : action.getLinks()) {
System.out.println("Rel " + link.getRel());
System.out.println("Accept " + link.getAccept());
System.out.println("Href " + link.getHref());
System.out.println("Method " + link.getMethod());
System.out.println("");
}
}
}public ObjectRecordActionResponse initiateObjectActionOnASingleRecord(String objectName, String recordId, String actionName)
objectName - The object namerecordId - The object record idactionName - Obtained from the Retrieve User Actions request
retrieveObjectRecordUserActions(java.lang.String, java.lang.String)
POST /api/{version}/vobjects/{object_name}/{object_record_id}/actions/{action_name}
ObjectRecordActionResponse resp = vaultClient.newRequest(ObjectLifecycleWorkflowRequest.class)
.initiateObjectActionOnASingleRecord(objectName, recordId, actionName);System.out.println(resp.getResponseStatus()); System.out.println(resp.getResponse());
public ObjectRecordActionBulkResponse initiateObjectActionOnMultipleRecords(String objectName, Set<String> recordIds, String actionName)
Initiate an object user action on multiple records. Maximum 500 records per batch.
objectName - The object namerecordIds - Set of record ids to perform the action upon. Up to 500
entries per callactionName - Obtained from the Retrieve User Actions request
retrieveObjectRecordUserActions(java.lang.String, java.lang.String)
POST /api/{version}/vobjects/{object_name}/actions/{action_name}
ObjectRecordActionResponse resp = vaultClient.newRequest(ObjectLifecycleWorkflowRequest.class)
.initiateObjectActionOnMultipleRecords(objectName, ids, actionName);,
ObjectRecordActionBulkResponse resp = vaultClient.newRequest(ObjectLifecycleWorkflowRequest.class)
.initiateObjectActionOnMultipleRecords(objectName, ids, actionName);System.out.println(resp.getResponseStatus()); System.out.println(resp.getResponse());,
System.out.println(resp.getResponseStatus()); System.out.println(resp.getResponse());
public ObjectWorkflowResponse retrieveWorkflows(String object, String recordId, String participant)
Retrieve all workflows for a specific object and object record or from a specific workflow participant.
object - To retrieve all workflows configured on an object.recordId - Object record id field values e.g
object__v={name__v}&record_id__v={id}.
object__v=product__v&record_id__v=00P07551participant - To retrieve all workflows available to a particular user,
include the user id field value as ?participant={id}. To
retrieve your own workflows, set this value to
participant=me. This parameter is required when the
object__v and record_id__v parameters are not used.
GET /api/{version}/objects/objectworkflows
ObjectWorkflowResponse resp = vaultClient.newRequest(ObjectLifecycleWorkflowRequest.class).setPageSize(0).setOffset(0)
.retrieveWorkflows(object, recordId, participant);System.out.println(resp.getResponseStatus());
System.out.println(resp.getResponse());
Object.ObjectReference objInfo = resp.getResponseDetails().getObject();
System.out.println("-----------Response Details -------------------");
System.out.println("Total: " + resp.getResponseDetails().getTotal());
System.out.println("Offset: " + resp.getResponseDetails().getOffset());
System.out.println("PageSize: " + resp.getResponseDetails().getPageSize());
resp.getResponseDetails().getOffset();
System.out.println("-----------Object Info -------------------");
System.out.println("Name: " + objInfo.getName());
System.out.println("Label: " + objInfo.getLabel());
System.out.println("URL: " + objInfo.getUrl());
System.out.println("Label Plural: " + objInfo.getLabelPlural());
List<ObjectWorkflow> objectWorkflowDetail = resp.getData();
for (ObjectWorkflow workflowDetail : objectWorkflowDetail) {
System.out.println("-----------Data -------------------");
System.out.println("Get ID: " + workflowDetail.getId());
System.out.println("Get Label: " + workflowDetail.getLabel());
System.out.println("Get StartDate: " + workflowDetail.getStartedDate());
System.out.println("Get Object: " + workflowDetail.getObject());
System.out.println("Get RecordID: " + workflowDetail.getRecordId());
System.out.println("Get Initiator: " + workflowDetail.getInitiator());
System.out.println("Get Due Date: " + workflowDetail.getDueDate());
}public ObjectWorkflowResponse retrieveWorkflowDetails(int workflowId)
workflowId - The workflow id.
GET /api/{version}/objects/objectworkflows/{workflow_id}
ObjectWorkflowResponse resp = vaultClient.newRequest(ObjectLifecycleWorkflowRequest.class).setLoc(true)
.retrieveWorkflowDetails(workflowId);
System.out.println(resp.getResponseStatus());
System.out.println(resp.getResponse());
Object.ObjectReference objInfo = resp.getResponseDetails().getObject();
System.out.println("-----------Response Details -------------------");
System.out.println("URL: " + resp.getResponseDetails().getUrl());
resp.getResponseDetails().getOffset();
System.out.println("-----------Object Info -------------------");
System.out.println("Name: " + objInfo.getName());
System.out.println("Label: " + objInfo.getLabel());
System.out.println("URL: " + objInfo.getUrl());
System.out.println("Label Plural: " + objInfo.getLabelPlural());
List<ObjectWorkflow> objectWorkflowDetail = resp.getData();
for (ObjectWorkflow workflowDetail : objectWorkflowDetail) {
System.out.println("-----------Data -------------------");
System.out.println("Get ID: " + workflowDetail.getId());
System.out.println("Get Label: " + workflowDetail.getLabel());
System.out.println("Get StartDate: " + workflowDetail.getStartedDate());
System.out.println("Get Object: " + workflowDetail.getObject());
System.out.println("Get RecordID: " + workflowDetail.getRecordId());
System.out.println("Get Initiator: " + workflowDetail.getInitiator());
System.out.println("Get Due Date: " + workflowDetail.getDueDate());
}public ObjectWorkflowActionResponse retrieveWorkflowActions(int workflowId)
workflowId - The workflow id.
GET /api/{version}/objects/objectworkflows/{workflow_id}/actions
ObjectWorkflowActionResponse resp = vaultClient.newRequest(ObjectLifecycleWorkflowRequest.class).setLoc(false)
.retrieveWorkflowActions(workflowId);System.out.println("Response Status: " + resp.getResponseStatus());
System.out.println("Response :" + resp.getResponse());
List<WorkflowAction> objectWorkflowDetail = resp.getData();
if (resp.getData() != null) {
for (WorkflowAction workflowDetail : objectWorkflowDetail) {
System.out.println("Name: " + workflowDetail.getName());
System.out.println("Label: " + workflowDetail.getLabel());
}
}public ObjectWorkflowActionDetailsResponse retrieveWorkflowActionDetails(int workflowId, String workflowAction)
workflowId - The workflow id.workflowAction - The name of the workflow action. To get this value,
You can Retrieve Workflow Actions.
GET /api/{version}/objects/objectworkflows/{workflow_id}/actions/{workflow_action}
ObjectWorkflowActionDetailsResponse resp = vaultClient.newRequest(ObjectLifecycleWorkflowRequest.class).setLoc(false)
.retrieveWorkflowActionDetails(workflowId, workflowName);
System.out.println("Response Status: " + resp.getResponseStatus());
System.out.println("Response :" + resp.getResponse());
List<Control> controls = resp.getData().getControls();
if (controls != null) {
for (Control control : controls) {
System.out.println("Type: " + control.getType());
System.out.println("Class: " + control.getClass());
List<CurrentValue> currentValue = control.getCurrentValues();
for (CurrentValue cValue : currentValue) {
System.out.println("Class: " + cValue.getDocumentId());
}
}
}public VaultResponse initiateWorkflowAction(int workflowId, String workflowAction)
workflowId - The workflow id.workflowAction - The name of the workflow action.
POST /api/{version}/objects/objectworkflows/{workflow_id}/actions/{workflow_action}
VaultResponse resp = vaultClient.newRequest(ObjectLifecycleWorkflowRequest.class)
.setBodyParams(bodyParams)
.initiateWorkflowAction(workflowId, workflowName);
System.out.println("Response Status: " + resp.getResponseStatus());
System.out.println("Response :" + resp.getResponse());
public ObjectWorkflowTaskResponse retrieveObjectWorkflowTasks(String object, String recordId, String assignee)
Note: Tasks associated with multi-document workflows will not appear in API versions earlier than v18.3.
object - To retrieve all workflows configured on an object.recordId - Object record id field values e.g
object__v={name__v}&record_id__v={id}.
object__v=product__v&record_id__v=00P07551assignee - To retrieve all workflow tasks available to a particular
user, include the user id field value as ?assignee__v={id}.
To retrieve your own workflow tasks, set this value to
?assignee__v=me. This parameter is required when the
object__v and record_id__v parameters are not used.
GET /api/{version}/objects/objectworkflows/tasks
ObjectWorkflowTaskResponse resp = vaultClient.newRequest(ObjectLifecycleWorkflowRequest.class).setPageSize(0)
.setOffset(0).retrieveObjectWorkflowTasks(object, recordId, assignee);System.out.println(resp.getResponseStatus());
System.out.println(resp.getResponse());
Object.ObjectReference objInfo = resp.getResponseDetails().getObject();
System.out.println("-----------Response Details -------------------");
System.out.println("Total: " + resp.getResponseDetails().getTotal());
System.out.println("Offset: " + resp.getResponseDetails().getOffset());
System.out.println("PageSize: " + resp.getResponseDetails().getPageSize());
resp.getResponseDetails().getOffset();
System.out.println("-----------Object Info -------------------");
System.out.println("Name: " + objInfo.getName());
System.out.println("Label: " + objInfo.getLabel());
System.out.println("URL: " + objInfo.getUrl());
System.out.println("Label Plural: " + objInfo.getLabelPlural());
List<ObjectWorkflowTask> tasks = resp.getData();
for (ObjectWorkflowTask workflowTask : tasks) {
System.out.println("-----------Data -------------------");
System.out.println("Get ID: " + workflowTask.getId());
System.out.println("Get Label: " + workflowTask.getLabel());
System.out.println("Get CreatedDate: " + workflowTask.getCreatedDate());
System.out.println("Get Object: " + workflowTask.getObject());
System.out.println("Get RecordID: " + workflowTask.getRecordId());
System.out.println("Get Instructions: " + workflowTask.getInstructions());
System.out.println("Get Due Date: " + workflowTask.getDueDate());
}public ObjectWorkflowTaskResponse retrieveObjectWorkflowTaskDetails(int taskId)
taskId - id of task
GET /api/{version}/objects/objectworkflows/tasks/{task_id}
ObjectWorkflowTaskResponse resp = vaultClient.newRequest(ObjectLifecycleWorkflowRequest.class)
.retrieveObjectWorkflowTaskDetails(taskId);System.out.println(resp.getResponseStatus());
System.out.println(resp.getResponse());
Object.ObjectReference objInfo = resp.getResponseDetails().getObject();
System.out.println("-----------Response Details -------------------");
System.out.println("URL: " + resp.getResponseDetails().getUrl());
resp.getResponseDetails().getOffset();
System.out.println("-----------Object Info -------------------");
System.out.println("Name: " + objInfo.getName());
System.out.println("Label: " + objInfo.getLabel());
System.out.println("URL: " + objInfo.getUrl());
System.out.println("Label Plural: " + objInfo.getLabelPlural());
List<ObjectWorkflowTask> tasks = resp.getData();
for (ObjectWorkflowTask workflowTask : tasks) {
System.out.println("-----------Data -------------------");
System.out.println("Get ID: " + workflowTask.getId());
System.out.println("Get Label: " + workflowTask.getLabel());
System.out.println("Get CreatedDate: " + workflowTask.getCreatedDate());
System.out.println("Get Object: " + workflowTask.getObject());
System.out.println("Get RecordID: " + workflowTask.getRecordId());
System.out.println("Get Instructions: " + workflowTask.getInstructions());
System.out.println("Get Assigned Date: " + workflowTask.getAssignedDate());
}public ObjectWorkflowActionResponse retrieveObjectWorkflowTaskActions(int taskId)
taskId - id of task
GET /api/{version}/objects/objectworkflows/tasks/{task_id}/actions
ObjectWorkflowActionResponse resp = vaultClient.newRequest(ObjectLifecycleWorkflowRequest.class).setLoc(false)
.retrieveObjectWorkflowTaskActions(taskId);System.out.println("Response Status: " + resp.getResponseStatus());
System.out.println("Response :" + resp.getResponse());
List<WorkflowAction> objectWorkflowTask = resp.getData();
if (resp.getData() != null) {
for (WorkflowAction workflowDetail : objectWorkflowTask) {
System.out.println("Name: " + workflowDetail.getName());
System.out.println("Label: " + workflowDetail.getLabel());
}
}public ObjectWorkflowTaskActionDetailsResponse retrieveObjectWorkflowTaskActionDetails(int taskId, String taskAction)
taskId - The task id field value.taskAction - The name of the task action retrieved from Retrieve
Workflow Task Actions.
GET /api/{version}/objects/objectworkflows/tasks/{task_id}/actions/{task_action}
ObjectWorkflowTaskActionDetailsResponse resp = vaultClient.newRequest(ObjectLifecycleWorkflowRequest.class).setLoc(false)
.retrieveObjectWorkflowTaskActionDetails(taskId, taskAction);System.out.println("Response Status: " + resp.getResponseStatus());
System.out.println("Response :" + resp.getResponse());
List<ObjectWorkflowTaskActionDetails> actionDetails = resp.getData();
if (actionDetails != null) {
for (ObjectWorkflowTaskActionDetails workflowTaskActionDetails : actionDetails) {
System.out.println("-----------Data -------------------");
System.out.println("Get ID: " + workflowTaskActionDetails.getName());
System.out.println("Get Label: " + workflowTaskActionDetails.getLabel());
System.out.println("Get Type: " + workflowTaskActionDetails.getType());
System.out.println("Get Description: " + workflowTaskActionDetails.getDescription());
if (workflowTaskActionDetails.getControls() != null) {
List<Control> controls = workflowTaskActionDetails.getControls();
if (controls != null) {
for (Control taskControl : controls) {
System.out.println("-----------Controls -------------------");
System.out.println("Get Label: " + taskControl.getLabel());
System.out.println("Get Type: " + taskControl.getType());
System.out.println("Get Instructions " + taskControl.getInstructions());
List<Verdict> verdicts = taskControl.getVerdicts();
if (verdicts != null) {
for (Verdict verdict : verdicts) {
System.out.println("-----------Verdict -------------------");
System.out.println("Get Name: " + verdict.getName());
System.out.println("Get Label: " + verdict.getLabel());
List<Prompt> prompts = verdict.getPrompts();
if (prompts != null) {
for (Prompt prompt : prompts) {
System.out.println("-----------Prompts -------------------");
System.out.println("Get Prompt Name: " + prompt.getName());
System.out.println("Get Prompt Label: " + prompt.getLabel());
System.out.println("Get Prompt Required: " + prompt.getRequired());
System.out.println("Get Prompt MultiValue: " + prompt.getMultiValue());
System.out.println("Get Prompt Type: " + prompt.getType());
}
}
}
}
}
}
}
}
}public VaultResponse initiateWorkflowTaskAction(int taskId, String taskAction)
Initiate an object workflow task action on a specific object record. On SUCCESS, the specified object workflow task action is initiated on the object record.
taskId - The task id field value.taskAction - The name of the task action retrieved from Retrieve
Workflow Task Actions.
POST /api/{version}/objects/objectworkflows/tasks/{task_id}/actions/{task_action}
VaultResponse resp = vaultClient.newRequest(ObjectLifecycleWorkflowRequest.class)
.setBodyParams(bodyParams)
.initiateWorkflowTaskAction(taskId, taskAction);
System.out.println("Response Status: " + resp.getResponseStatus());
System.out.println("Response :" + resp.getResponse());public ObjectLifecycleWorkflowRequest setBodyParams(Map<String,Object> bodyParams)
bodyParams - map of body paramspublic ObjectLifecycleWorkflowRequest setDocumentIds(List<Integer> documentIdList)
documentIdList - List of document IDspublic ObjectLifecycleWorkflowRequest setLoc(boolean loc)
loc - locpublic ObjectLifecycleWorkflowRequest setOffset(int offset)
offset - offsetpublic ObjectLifecycleWorkflowRequest setPageSize(int pageSize)
pageSize - page sizepublic ObjectLifecycleWorkflowRequest setStatus(String status)
status - statusCopyright © 2021. All rights reserved.