The Set_value plugin allows setting values to data and metadata descriptors from the yaml file.
Here are main features of the plugins:
At its root, the Set_value configuration is made of:
key | value |
---|---|
"logging" (optional) | a logging |
"on_init" (optional) | a list of value operation |
"on_event" (optional) | an on_event |
"on_data" (optional) | an on_data |
"on_finalize" (optional) | a list of value operation |
Specifies a list of operation to do in PDI_init function. on_init
is a list of value operation s.
Specifies a map of events that will trigger the values set. on_event
is a map with event name as a key and value operation list as map value.
key | value |
---|---|
".*" (optional) | a list of value operation |
Specifies a map of data that on share will trigger the values set. on_data
is a map with data/metadata name as a key and value operation as map value.
key | value |
---|---|
".*" (optional) | a list of value operation |
Specifies a list of operation to do in PDI_finalize function. on_finalize
is a list of value operation s.
A value operation is specified as a key-value pair (a mapping whose content is a single key-value pair). It defines an operation to execute inside a value list.
key | value |
---|---|
"set" (optional) | a value list |
"share" (optional) | a value list |
"expose" (optional) | a value list |
"release" (optional) | a list with data to release |
"event" (optional) | an event name to call |
"logger" (optional) | a logger map |
Share warning
Share is always done with read and write rights. Plugin allocates memory by malloc
. If you reclaim the data, you should free it with free
instruction.
Is a list of the
as elements. The order of the elements is important. The descriptors will be set in the same order as given in the yaml file.
Is a map of descriptor name as a key, and a value to set as a value:
key | value |
---|---|
".*" (optional) | a scalar value to set |
Is a map of descriptor name as a key, and a list of values to set as a value:
key | value |
---|---|
".*" (optional) | a list of value to set |
Is a map of descriptor name as a key, and a list of members to set as a value. Each member consist of an inner value_list
. The order of the members is unrestricted, but the plugin will set the values to the members in the same order.
key | value |
---|---|
".*" (optional) | a map with member name as key and a value to set as value |
Defines settings for global PDI logger.
key | value |
---|---|
"level" (optional) | level to set to the logger |
"pattern" (optional) | pattern to set to the logger |
"evaluate" (optional) | if true evaluate the logger pattern |
The set_value plugin allows to use the old values to set new values, you can use even the same descriptor, for example to increment a scalar.
After calling init
and increment
event, value_int
will be equal 1, and int_array
to [2, 3, 4].
The new value is set at the end of processing the whole descriptors. This means, that if you want to update the array element depending on other element, the old value will be set:
After calling init
and increment
event, all values in int_array
will equal 1
. This is because the int_array[0]
was updated after setting all the elements.
After calling init
and increment
event, all values in int_array
will equal 1
. This is because the int_scalar
is set and then the int_array
is updated after the int_scalar
has a new value.