Generic Resolver
The Generic Resolver component will resolve the configured fields from the incoming data to the corresponding migration.id based on the document found by the configured query.
Configuration
A MongoDB connection string.
Example: mongodb://<username>:<password>@localhost:27017/<databaseName>
Here <databaseName> is the database to do the look-up in.
Whether or not to use TLS in case your mongoDB requires TLS.
Allow Invalid CertificatesChecking this will disable certificate validation. Warning: specifying this option in a production environment makes your application insecure and potentially vulnerable to expired certificates and to foreign processes posing as valid client instances.
Certificate Authority FileOne or more certificate authorities to trust when making a TLS connection.
Example: .\ca.pem
When strict mode is turned on, every itemToResolve must be resolved for a given input. Else an error will be thrown and no output will be sent.
The configuration is an array of itemsToResolve. Each of these objects has a fieldToResolve, a query and a fallback value (optional).
Example:
{
"itemsToResolve": [
{
"fieldToResolve": "source.location",
"query": { "source.id": "{{source.location}}" },
"fallback": 23
},
{
"fieldToResolve": "source.properties.mainDep",
"query": { "source.id": "{{source.properties.mainDep}}" },
"fallback": 50
}
]
}
The key from the input data whose value will be modified. The value to resolve can be an array or a single value.
- single value: gets replaced by the migration ID of the document the query returns.
- array: each of the values gets replaced by the migration ID of the document each query returns.
The DB query to find a document whose migration.id we want to resolve with.
FallbackThe value that the field must be resolved with if no documents are found.
The Concept of Resolving
During migration, when creating folders or files, new IDs are generated in the target system for the designated folders or files. During migration these are saved in `migration.id`. These are not known beforehand, normally only the root object’s target ID is known at the start. When creating subfolders or files, their parent references must use the target-assigned ID, which may differ from the root object’s original migration.id. As a result, direct children cannot reliably reference the correct parent ID at creation time. The resolver simplifies this process by retrieving the target-assigned migration.id for a parent folder or file. This ensures that subsequent operations (e.g., creating children or constructing request URLs) use the correct target IDs. The following diagram explains this process with some examples how the resolver works.
Message 1:| Input | Processing Steps | Output |
|---|---|---|
| location: '205' | Found id: '205', resolved with: '5'. | '5' |
| mainDep: '1601' | Found id: '1601', resolved with: '48'. | '48' |
| deps: ['1601', '809'] | Documents found, resolved with ['48', '12']. | ['48', '12'] |
| Input | Processing Steps | Output |
|---|---|---|
| location: '206' | No query result, results in an error. Same applies to when there is a result but no migration.id. | Error: "Document not found." |
| Input | Processing Steps | Output |
|---|---|---|
| mainDep: '1602' | No query result, fallback is configured and used, resolved with: '50'. | '50' |
Inputs | Outputs
Input: the input that receives the actual data messages.
Example:
{
"source": {
"properties": {
"mainDep": "156"
}
}
}