Using Anypoint Studio to Configure Veeva Vault Connector 1.2 - Mule 4
Add Veeva Vault Connector to a Mule project in Anypoint Studio, configure an input source for the Mule flow, and configure the connector.
To add and configure a connector in Studio:
-
Create a Mule project.
-
Add the connector to your Mule project
-
Configure an input source for the connector’s flow.
-
Configure global elements for the connector.
If you are new to configuring Anypoint Connectors in Studio, see Using Anypoint Studio to Configure a Connector.
Create a Mule Project
In Anypoint Studio, create a new Mule project in which to add and configure the connector.
-
In Anypoint Studio, from the main menu, select File > New > Mule Project.
-
Enter a name for your Mule project, and click Finish.
Add the Connector to the Mule Project
Add Veeva Vault Connector to a Mule project to automatically populate the XML code with the connector’s namespace and schema location, as well as add the required dependencies to the project’s pom.xml
file.
-
In the Mule Palette view, click (X) Search in Exchange.
-
In Add Modules to Project, type "veeva" in the search field.
-
In Available modules, click Veeva Vault Connector - Mule 4 and click Add.
-
Click Finish.
Adding a connector to a Mule project in Studio does not make that same connector available to other projects in your Studio workspace.
Configure an Input Source for the Flow
After adding the connector to your Mule project, configure an input source for the flow, such as HTTP Listener (HTTP Connector), or Scheduler.
Configure the Connector
To use Veeva Vault Connector in your Mule app, configure a global Veeva Vault element that can be used by all Veeva Vault Connector operations in the application.
-
To create a global Veeva Vault element, click the Global Elements tab at the bottom of the Studio canvas and click Create.
-
In the Choose Global Type window, expand Connector Configuration, click Veeva Vault Config, and click OK.
-
In the Veeva Vault Config window, in the General tab, enter the following configuration values:
Field Description Name
Enter a name for this configuration to reference it later.
Vault URL
Enter the Veeva Vault instance URL.
Username
Enter the Veeva Vault instance username.
Password
Enter the password that corresponds to the username.
Version
Enter the Veeva Vault instance version.
Client Id
Enter the client ID to send with each request in the header for tracking purposes, in the format:
{organization}-{company|team}
.
The client ID is prefixed with "mulesoft" and has a suffix with "client-vaultconnector" internally, for example:mulesoft-abcpharma-clinicalprod-client-vaultconnector
.In the previous image, the placeholder values refer to a configuration file placed in the folder (
src/main/resources
) of your project. Although you can hardcode your credentials into the global configuration properties, you can simplify maintenance and achieve better project reusability if you reference a configuration file that contains these values instead. Keeping these values in a separate file is useful if you need to deploy to different environments in which your access credentials differ (such as production, development, and QA).
The following example is a snippet of theconfiguration.yaml
file under thesrc/main/resources/config
folder:#Veeva Vault details veeva: vaultURL: "https://xxxx-xxxx.veevavault.com" username: "someone@example.com" password: "xxxxxxx" version : "v20.1" clientId: "mulesoft-abcpharma-clinicalprod-client-vaultconnector"
The connection configuration performs basic authentication, which accepts the required Vault URL, username, and password parameters to connect to the Veeva Vault instance to retrieve the session. The retrieved session is used for sending requests by each operation configured in the Mule application.
-
In the Veeva Vault Config window, in the Advanced tab, configure the burst API limit:
Burst API Limit Profile
The burst API limit profile configuration to act upon if the specified burst API limit of the Veeva Vault API reaches the threshold of the configured value or is exceeded.
If Burst API limit config is enabled (default), then the connector evaluates the Veeva Vault API’s response header (
X-VaultAPI-BurstLimitRemaining
) value against the specified API Limit threshold value. If the remaining burst API limit reaches or exceeds this threshold value, the connector waits for the specified amount of time to restart the count for the Burst Limit Remaining.Following is an example from the application logs, showing a warning message at
2019-06-06 10:34:45,096
and subsequently waiting for five minutes before rerunning as shown in the next message at2019-06-06 10:39:45,098
:WARN 2019-06-06 10:34:45,096 [[MuleRuntime].io.27: [veevavault-connector-demo].get-documents-operationFlow.BLOCKING @2dd2ffaf] [event: 99716950-8818-11e9-90e2-d61515f42856] org.mule.extension.veevavault.internal.service.HttpRequestService: Burst API Limit remaining calls [1997] has exceeded/reached an API Limit Profile threshold set as [1997]. As per API Limit Profile, Veeva Vault Connector will wait for [5] MINUTES. WARN 2019-06-06 10:39:45,098 [[MuleRuntime].io.27: [veevavault-connector-demo].get-documents-operationFlow.BLOCKING @2dd2ffaf] [event: 99716950-8818-11e9-90e2-d61515f42856] org.mule.extension.veevavault.internal.operations.VeevaVaultOperations: Properties or Fields is not available for api [/api/v18.2/metadata/objects/documents/types/site_management__c] , will use input list [[name__v, type__v, subtype__v, classification__v, lifecycle__v, status__v, study__v, product__v, id]] if configured to build VQL query INFO 2019-06-06 10:39:45,098 [[MuleRuntime].io.27: [veevavault-connector-demo].get-documents-operationFlow.BLOCKING @2dd2ffaf] [event: 99716950-8818-11e9-90e2-d61515f42856] org.mule.extension.veevavault.internal.pagination.GetDocumentsPagingProvider: Query Build :: SELECT name__v, type__v, subtype__v, classification__v, lifecycle__v, status__v, study__v, product__v, id FROM documents WHERE name__v= 'F22611234--6764' INFO 2019-06-06 10:39:46,024 [[MuleRuntime].io.27: [veevavault-connector-demo].get-documents-operationFlow.BLOCKING @2dd2ffaf] [event: 99716950-8818-11e9-90e2-d61515f42856] org.mule.extension.veevavault.internal.service.HttpRequestService: Response received for sync http request :: 'https://[vault-domain]/api/v18.2/query?q=SELECT+name__v%2C+type__v%2C+subtype__v%2C+classification__v%2C+lifecycle__v%2C+status__v%2C+study__v%2C+product__v%2C+id+FROM+documents+WHERE+name__v%3D+%27F22611234--6764%27++LIMIT+1000+OFFSET+0' in 925 milliseconds.
Field Description API Limit Threshold
Enter the Veeva Vault API threshold limit. When this threshold is reached or exceeded, the connector waits the specified time. The default is
200
.Wait Time
Enter the amount of time the connector should wait if the API limit threshold is reached or exceeded. The default is
5
.Time Unit
Select the time unit for the wait time. The default is
MINUTES
.Daily API Limit Exceed Profile:
The daily API limit exceed profile configuration (Connector Configuration > Advanced Tab) to use if the daily API limit of the Veeva Vault API reaches or exceeds the configured threshold. The daily limit is the total number of API calls within any 24-hour window on a daily rolling basis.
If the Daily API Limit Exceed Profile is enabled (default), then the connector evaluates the Veeva Vault API’s response header (X-VaultAPI-DailyLimitRemaining) for the specified value of the threshold, and throws an exception indicating that the daily API limit is exceeded. The exception continues to be thrown for each job or request created until the daily limit is reset or rolled over the next day.
Following is an example log that shows a warning at 2019-06-06 10:47:31,698 and an error at 2019-06-06 10:47:31,699:
WARN 2019-06-06 10:47:31,698 [[MuleRuntime].io.44: [veevavault-connector-demo].get-documents-operationFlow.BLOCKING @108e7f43] [event: 624cfa50-881a-11e9-90e2-d61515f42856] org.mule.extension.veevavault.internal.service.HttpRequestService: Veeva Daily API Limit remaining calls [10000] has exceeded/reached an Daily API Limit Profile threshold set as [10000]. As per API Limit Profile, Veeva Vault Connector will throw an exception. ERROR 2019-06-06 10:47:31,699 [[MuleRuntime].io.44: [veevavault-connector-demo].get-documents-operationFlow.BLOCKING @108e7f43] [event: 624cfa50-881a-11e9-90e2-d61515f42856] org.mule.extension.veevavault.internal.service.HttpRequestService: Exception caught while processing Sync request ::: https://xxxxx-xxxxx.veevavault.com/api/v20.1/metadata/vobjects/site__v, Exception ::: \{"responseStatus":"FAILURE","errors":[\{"type":"API_LIMIT_EXCEED","message":"The Veeva Vault Connector has reached/exceeded daily API limit remaining calls [10000]. The configured daily api limit threshold is \(10000\)"}\]} ERROR 2019-06-06 10:47:31,767 [[MuleRuntime].io.44: [veevavault-connector-demo].get-documents-operationFlow.BLOCKING @108e7f43] [event: 624cfa50-881a-11e9-90e2-d61515f42856] org.mule.runtime.core.internal.exception.OnErrorPropagateHandler: ********************************************************************************** Message : An error occurred from the Veeva Vault API. Error Code: API_LIMIT_EXCEED. Original Error Message: The Veeva Vault Connector has reached/exceeded daily API limit remaining calls [10000]. The configured daily api limit threshold is (10000). Error type : VEEVAVAULT:API_LIMIT_EXCEED **********************************************************************************
Field Description API Limit Threshold
Enter the API threshold limit. When the specified limit is reached or exceeded, the connector waits for the specified time. The default is
10000
.Response Timeout:
The maximum time, in milliseconds, that the connector waits for the Veeva Vault response. If the maximum time is exceeded, a timeout exception is thrown. The default is 30,000 milliseconds.
Field Description Response Timeout
Enter the timeout value for the connector to wait for a response from the Veeva Vault instance. The default is 30 seconds.
Next Step
After configuring Veeva Vault Connector for use in Studio, see the Additional Configuration Information topic for more configuration steps.