/
Using the Scan Correlation Features and Correlation ID

Using the Scan Correlation Features and Correlation ID

This Article will explain what the correlationId parameter is and how it can be used across all our Platforms with any of our Anyline scanning capabilities.

 


What is the Correlation ID?

The Correlation ID is a unique key in the UUIDv4 format that customers can optionally pass as an additional parameter. This ID can be assigned to a scan and all subsequent scans of a workflow or business process, whether from a single Anyline scanning capability or a series of scans from various Anyline scanning capabilities.

IMPORTANT:

The Correlation ID must be in the UUIDv4 format, otherwise an error will be thrown in the respective call or request.

Please see an example of the UUID format structure below.

 

UUID Example 1-20241014-094012.png

 


What can I use the Correlation ID for?

By utilizing the Correlation ID during your scans, you can get a more streamlined way of identifying and organizing scans specific to your use and/or workflow. Additionally, it allows you to unlock advanced analytics and insights, providing more granular scan tracking and delivering cross-module intelligence to better understand your scan data.

Examples of Correlation ID Usage

PLEASE NOTE:

The Correlation ID value is not provided by Anyline, but provided by the Integrator. There are various frameworks and ways to safely generate a UUIDv4. Some examples are provided in some of the code snippets below.

  1. Tire Tread Measurements:

    • If a Customer wishes to measure the tire tread of a car, each of the four measurements can be assigned the same Correlation ID. This ensures that all data related to that specific car’s tire tread is grouped together for easy reference and analysis.

  2. Comprehensive Vehicle Inspection:

    • If a Customer wishes to identify a car by using the License Plate scanning capabilities, checking the four tires using the Tire Sidewall Scanner, and then measuring the tread of all four tires, all nine transactions can be assigned the same Correlation ID. This way, all related scans are linked, providing a complete overview of the vehicle’s inspection process.

Using the Correlation ID in these ways helps streamline data management and enhances the ability to track and analyze related scans efficiently.

 


How can I use the Correlation ID?

Here is how you can use the Correlation ID using the following Anyline Products and Platforms:

Mobile SDK

For the Anyline Android Native SDK, you can now pass an optional parameter InitializationParameters to methods initializing ScanView as well as in ScanViewConfigHolder.

This object lets you set a correlationId value which would be used in subsequent scans.

For example:

Java:

ScanViewInitializationParameters initParams = new ScanViewInitializationParameters(); initParams.setCorrelationId(UUID.randomUUID().toString()); scanView.init("barcode_config.json", initParams);

Kotlin:

val initParams = ScanViewInitializationParameters() initParams.correlationId = UUID.randomUUID().toString() scanView.init("barcode_config.json", initParams)

For the Anyline iOS Native SDK, you can now pass an optional parameter InitializationParameters to methods initializing ALScanView as well as in ALScanViewFactory.

This object lets you set a correlationId value which would be used in subsequent scans.

For example:

Swift:

let initParams = ALScanViewInitializationParameters.init() let correlationId = UUID().uuidString initParams.correlationID = correlationId let scanView = try ALScanView(frame: .zero, scanViewConfig: scanViewConfig, initializationParams: initParams)

Objective-C:

For the Anyline Cordova Plugin, you can now pass an optional parameter Dictionary? initializationParams to the scan method.

This object lets you set a correlationId value which would be used in subsequent scans.

For example:

For the Anyline Flutter Plugin, you can now pass an optional parameter String? initializationParams to the startScanning() method.

This object lets you set a correlationId value which would be used in subsequent scans.

For example:

For the Anyline .NET Plugin, you can now pass an optional initializationParameters parameter to the ScanView.init() (Android) or ALScanViewFactory.WithConfigFilePath (iOS) methods.

This object lets you set a correlationId value which would be used in subsequent scans.

For example:

Android:

iOS:

Tire Tread SDK

For the Anyline Tire Tread SDK, you can now connect the correlationId to the additionalContext property, allowing you to amalgamate other Anyline Scan Processes to the tread depth measurements from the Tire Tread SDK.

To connect your scans with one of our other Anyline capabilities you can pass a correlationId with the additionalContext either via a JSON configuration file or in the code itself. Please see the following examples below:

Web SDK

For the Anyline Web SDK, you can now add a parameter correlationId to the AnylineJSParams interface. This parameter lets you set a correlationId value which can be used to correlate scan data across multiple scans and platforms (See https://js.anyline.com/release/54.1.0/docs/interfaces/types.AnylineJSParams.html#correlationId ).

For example:

Cloud API

For the Anyline Cloud API, you can now provide the correlationId as part of the request. This parameter will be sent with the request to correlate scan data across multiple scans and platforms.