UuidTransformer
Generates a random Universally unique identifier
Notes
Generates a random Universally unique identifier (UUID) and stores it in the specified field. If no field is provided, the UUID will be added to document.uuid.
Storing values in an existing field
If a target field with the same name already exists for a document, values will be added to the end of the existing value list. It is possible to change this default behavior by supplying a PropertySetter.
Can be used both as a pre-parse or post-parse handler.
Examples
The following example generates a UUID and stores it in a "uuid" field, overwriting any existing values under that field.
- YAML
- JSON
- XML
handler:
class: UuidTransformer
toField: uuid
onSet: REPLACE
{
"handler": {
"class": "UuidTransformer",
"toField": "uuid",
"onSet": "REPLACE"
}
}
<handler>
<class>UuidTransformer</class>
<toField>uuid</toField>
<onSet>REPLACE</onSet>
</handler>
Usage
Full configuration skeleton, with every option and its default
- YAML
- JSON
- XML
class: UuidTransformer
label: string
onSet: APPEND
toField: string
{
"class": "UuidTransformer",
"label": "string",
"onSet": "APPEND",
"toField": "string"
}
<handler>
<class>UuidTransformer</class>
<label>string</label>
<onSet>APPEND</onSet>
<toField>string</toField>
</handler>
Properties
| Property | Type | Required | Default |
|---|---|---|---|
label | string | No | - |
onSet | enum | No | - |
toField | string | No | document.uuid |
Property Details
label
An optional, user-supplied label for this step in the importer pipeline. It has no effect on processing — it exists purely to help identify this step, for example in large configurations or in the visual configurator.
onSet
What to do if a target field of the same name already exist.
Allowed Values
APPENDPREPENDREPLACEOPTIONAL
toField
A target field name used to store the value.