Atlassian uses cookies to improve your browsing experience, perform analytics and research, and conduct advertising. Accept all cookies to indicate that you agree to our use of cookies on your device. Atlassian cookies and tracking notice, (opens new window)
Using the Scan Correlation Features and Correlation ID
By Colm Rogers
6 min
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.
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.
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.
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.
PLEASE NOTE:
The Correlation ID parameter is not limited to our automotive-related scanning capabilities. It can be used to combine any of our scanning capabilities into a single, grouped collection of data.
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)
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:
ScanViewInitializationParameters initParams = new ScanViewInitializationParameters();
initParams.CorrelationId = Guid.NewGuid().ToString();
_scanView.Init(jsonConfigFilePath, initParams);
iOS:
ALScanViewInitializationParameters initParams = new ALScanViewInitializationParameters();
initParams.CorrelationID = Guid.NewGuid().ToString();
_scanView = ALScanViewFactory.WithConfigFilePath(configPath, initParams, _resultDelegate, out error);
For the Anyline React Native Plugin, you can now use a new method called setupPromiseWithInitializationParameters in place of setupPromise in order to pass in additional initialization parameters, including a correlationId value, which can be used to associate related scanning sessions.
For example:
const result = await AnylineOCR.setupPromiseWithInitializationParameters(
"{\"correlationId\": \"0d4e794b-272f-45f4-b8ca-07dd84975a7d\"}",
JSON.stringify(config),
'scan'
);
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.
PLEASE NOTE:
The AdditionalContext is an optional property which allows you to provide more context to a scan. This makes sense in a workflow, where a scan is connected to other Tire Tread scans or other information in a larger context. For more information about AdditionalContext and what it requires, please visit our Tire Tread SDK Documentation Page.
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:
{
"useDefaultUi": true,
"useDefaultHaptic": true,
"defaultUiConfig": {
"distanceIndicatorConfig": {
"visible": true,
"textOk": "Mantenha a distância.",
"textMoveCloser": "Chegue mais perto.",
"textMoveAway": "Aumente a distância."
},
"focusPointTooltipConfig": {
"visible": true,
"text": "Mova o dispositivo para frente e para trás para detectar o pneu."
},
"howToScanTooltipConfig": {
"visible": true,
"text": "Alinhe o pneu com o overlay."
},
"tapToStartScanningTooltipConfig": {
"visible": true,
"text": "Toque na tela para iniciar o processo."
},
"tireOverlayConfig": {
"visible": true
},
"uploadViewConfig": {
"visible": true,
"text": "Enviando imagens, aguarde."
},
"progressTimerConfig": {
"visible": true
},
"lineProgressBarConfig": {
"visible": true
},
"orientationWarningConfig": {
"visible": true,
"text": "Please rotate the phone to landscape mode"
}
},
"scanSpeed": "Fast",
"measurementSystem": "Metric",
"additionalContext": {
"tirePosition": {
"axle": 1,
"side": "Left",
"positionOnAxle": 1
},
"correlationId": "00000000-0000-0000-0000-000000000000"
}
}
@Composable
fun TireTreadScanViewWithTireTreadScanViewConfig() {
// Define the values for your config
val tireTreadScanViewConfig = TireTreadScanViewConfig().apply {
additionalContext = AdditionalContext().apply {
correlationId = "00000000-0000-0000-0000-000000000000"
}
}
// Invoke the TireTreadScanView composable with the TireTreadScanViewConfig above
TireTreadScanView(context = this,
config = tireTreadScanViewConfig,
callback = object : TireTreadScanViewCallback {
// override callbacks for events needed during your scans
}) {
// handle initialisation error
}
}
private func setupTireTreadScanView() {
let config = TireTreadScanViewConfig()
let additionalContext = AdditionalContext()
// set correlation ID
additionalContext.correlationId = "00000000-0000-0000-0000-000000000000"
config.additionalContext = additionalContext
TireTreadScanViewKt.TireTreadScanView(context: UIViewController(), config: config, callback: self) { [weak self] error in
// handle initialisation error
}
self.dismissViewController = { [weak self] in
self?.navigationController?.popViewController(animated: true)
}
addScanViewControllerAsChild()
}
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.
For Cloud API v1, add the correlationId the same way you would add the config, license and blob parameters to your request:
For the Tire Tread Instant App, you can now provide the correlationId to the Instant App Integration SDK. This parameter will be handed to the Instant App to correlate scan data across multiple scans and platforms. When starting the scan from the Instant App Integration SDK just pass it the correlationId: