Class BulkActiveWorkflowActionRequest

java.lang.Object
com.veeva.vault.vapil.api.request.VaultRequest<BulkActiveWorkflowActionRequest>
com.veeva.vault.vapil.api.request.BulkActiveWorkflowActionRequest

public class BulkActiveWorkflowActionRequest extends VaultRequest<BulkActiveWorkflowActionRequest>
The Bulk Active Workflow APIs retrieve information about actions and action details and to execute actions.
Vault API Coverage:
https://developer.veevavault.com/api/25.1/#bulk-active-workflow-actions
  • Method Details

    • cancelWorkflowTasks

      public BulkWorkflowJobStartResponse cancelWorkflowTasks()
      Cancel Workflow Tasks
      Returns:
      BulkWorkflowJobStartResponse
      Vault API Endpoint:
       POST /api/{version}/object/workflow/actions/canceltasks
      Vault API Help Link:
      https://developer.veevavault.com/api/25.1/#initiate-workflow-actions-on-multiple-workflows
      Example Request:
       Example 1 - Cancel By Task Ids
       List<Integer> ids = Arrays.asList(new Integer[]{1000,1001});
       BulkWorkflowJobStartResponse response = vaultClient.newRequest(BulkActiveWorkflowActionRequest.class)
                                      .setTaskIds(ids)
                                      .cancelWorkflowTasks();
      ,
       Example 2 - Cancel By User Ids
       List<Integer> ids = Arrays.asList(new Integer[]{1000,1001});
       BulkWorkflowJobStartResponse response = vaultClient.newRequest(BulkActiveWorkflowActionRequest.class)
                                      .setUserIds(ids)
                                      .cancelWorkflowTasks();
      Example Response:
       if (response.isSuccessful() {
         if (response.getData()) {
           System.out.println("JobId = " + response.getData().getJobId());
         }
       }
       
    • cancelWorkflows

      public BulkWorkflowJobStartResponse cancelWorkflows(List<Integer> workflowIds)
      Cancel Active Workflows
      Parameters:
      workflowIds - workflow_id__v field values. Maximum 500 workflows.
      Returns:
      BulkWorkflowJobStartResponse
      Vault API Endpoint:
       POST /api/{version}/object/workflow/actions/cancelworkflows
      Vault API Help Link:
      https://developer.veevavault.com/api/25.1/#initiate-workflow-actions-on-multiple-workflows
      Example Request:
       List<String> ids = Arrays.asList(new String[]{"1","2","3"});
       BulkWorkflowJobStartResponse response = vaultClient.newRequest(BulkActiveWorkflowActionRequest.class)
                                      .cancelWorkflows(ids);
      Example Response:
       if (response.isSuccessful() {
         if (response.getData()) {
           System.out.println("JobId = " + response.getData().getJobId());
         }
       }
       
    • reassignTasks

      public BulkWorkflowJobStartResponse reassignTasks(Integer currentTaskAssignee, Integer newTaskAssignee)
      Reassign Workflow Tasks
      Note that this action can reassign a maximum of 500 tasks.
      Parameters:
      currentTaskAssignee - Input the user ID of the user whose tasks you wish to reassign. You cannot reassign specific tasks for a user, only all tasks currently assigned to a user.
      newTaskAssignee - Input the user ID of the user who will receive the newly assigned tasks.
      Returns:
      BulkWorkflowJobStartResponse
      Vault API Endpoint:
       POST /api/{version}/object/workflow/actions/reassigntasks
      Vault API Help Link:
      https://developer.veevavault.com/api/25.1/#initiate-workflow-actions-on-multiple-workflows
      Example Request:
       BulkWorkflowJobStartResponse response = vaultClient.newRequest(BulkActiveWorkflowActionRequest.class)
                                      .reassignTasks(12345, 67890);
      Example Response:
       if (response.isSuccessful() {
         if (response.getData()) {
           System.out.println("JobId = " + response.getData().getJobId());
         }
       }
       
    • replaceWorkflowOwner

      public BulkWorkflowJobStartResponse replaceWorkflowOwner(Integer currentWorkflowOwner, Integer newWorkflowOwner)
      Replace Workflow Owner
      Parameters:
      currentWorkflowOwner - Input the ID of the user who will become the current workflow owner.
      newWorkflowOwner - Input the ID of the user who will become the new workflow owner.
      Returns:
      BulkWorkflowJobStartResponse
      Vault API Endpoint:
       POST /api/{version}/object/workflow/actions/replaceworkflowowner
      Vault API Help Link:
      https://developer.veevavault.com/api/25.1/#initiate-workflow-actions-on-multiple-workflows
      Example Request:
       BulkWorkflowJobStartResponse response = vaultClient.newRequest(BulkActiveWorkflowActionRequest.class)
                                      .replaceWorkflowOwner(12345, 67890);
      Example Response:
       if (response.isSuccessful() {
         if (response.getData()) {
           System.out.println("JobId = " + response.getData().getJobId());
         }
       }
       
    • retrieveBulkWorkflowActionDetails

      public BulkWorkflowActionDetailsResponse retrieveBulkWorkflowActionDetails(String action)
      Retrieve Cancel Workflow Action Details
      Parameters:
      action - The name of the workflow action
      Returns:
      BulkWorkflowActionDetailsResponse
      Vault API Endpoint:
       GET /api/{version}/object/workflow/actions/{action}
      Vault API Help Link:
      https://developer.veevavault.com/api/25.1/#retrieve-bulk-workflow-actions-details
      Example Request:
       BulkWorkflowActionDetailsResponse resp = vaultClient.newRequest(BulkActiveWorkflowActionRequest.class)
                                      .retrieveBulkWorkflowActionDetails();
      Example Response:
       if (resp.isSuccessful() {
         if (resp.getDetails() != null) {
           System.out.println("Name " + resp.getName() +"\n");
           if resp.getDetails().getControls() != null && !resp.getDetails().getControls().isEmpty()) {
             System.out.println("Controls Exist\n");
      
             for (Control control : resp.getControls()) {
               System.out.println("  ------------------------------");
               System.out.println("  Type " + control.getType());
               System.out.println("  Label " + action.getLabel());
      
               if control.getPrompts() != null && !control.getPrompts().isEmpty()) {
                 System.out.println("  Prompts Exist");
                 System.out.println("    ------------------------------");
                 for (Prompt prompt : control.getPrompts()) {
                     System.out.println("    Name " + prompt.getName());
                     System.out.println("    Label " + prompt.getLabel());
                     System.out.println("    Required " + prompt.getRequired());
                     System.out.println("    Multi-Value " + prompt.getMultiValue());
                 }
               } else {
                   System.out.println("  No Prompts Exist");
               }
             } else {
               System.out.println("No Controls Exist\n");
             }
           }
         }
       }
         
    • retrieveBulkWorkflowActions

      public BulkWorkflowActionsResponse retrieveBulkWorkflowActions()
      Retrieve Bulk Workflow Actions
      Retrieve All available workflow actions that can be initiated on a workflow which:
      • The authenticated user has permissions to view or initiate
      • Can be initiated through the API
      Returns:
      BulkWorkflowActionsResponse
      Vault API Endpoint:
       GET /api/{version}/object/workflow/actions
      Vault API Help Link:
      https://developer.veevavault.com/api/25.1/#retrieve-bulk-workflow-actions
      Example Request:
       BulkWorkflowActionsResponse resp = vaultClient.newRequest(BulkActiveWorkflowActionRequest.class)
                                      .retrieveBulkWorkflowActions();
      Example Response:
       if (resp.isSuccessful() && resp.getActionsItems() != null && !resp.getActionsItems().isEmpty()) {
         System.out.println("Actions Exist\n");
      
         for (ActionItem action : resp.getActionsItems()) {
           System.out.println("------------------------------");
           System.out.println("Name " + action.getName());
           System.out.println("Label " + action.getLabel());
           }
       } else {
         System.out.println("No Actions Exist\n");
       }
    • setTaskIds

      public BulkActiveWorkflowActionRequest setTaskIds(List<Integer> taskIds)
      Parameters:
      taskIds - list of task ids
      Returns:
      BulkActiveWorkflowActionRequest
    • setUserIds

      public BulkActiveWorkflowActionRequest setUserIds(List<Integer> userIds)
      Parameters:
      userIds - list of user ids
      Returns:
      BulkActiveWorkflowActionRequest