interface - Configurations
This topic discusses the configuration classes of the PLANTA link API.
Classes

Config
The Config class is the base class that wraps a record from table 560
It allows you to query almost all of the attributes a configuration has
You can create new configurations by calling
Config.create()and new mappings by callingConfig.create_mapping()If you do not know wheter your task requires a
Configor aStaticConfig, then it's most likely you should use aStaticConfigfor better performance
Static variables
Variable | Description |
|---|---|
Config.DEFAULT_LOG_LEVEL | This configures the default Log-Level when a new |
Config.DEFAULT_LOG_TYPE | This configures the default Log-Typ when a new |
Methods
Function | Parameters | Return Value | Description |
|---|---|---|---|
Config.__enter__ |
| Enters the context. | |
Config.__eq__ | other: Another |
| Check whether a Config is equal to another |
Config.__exit__ | exc_details: Exception details | Deletes the instance when the context is left | |
Config.__hash__ | Integer | Returns a hash based on UUID | |
Config.__init__ | config_id: UUID |
| Initializes a new |
Config.copy | invoker_module: A module instance | Copied instance or | Makes a copy of a configuration. The class of the child is based on the class of the invoking config instance. When |
Config.create_mapping | type: ppms.interface.MappingType | Newly created mapping | Creates a new mapping that belongs to this configuration |
Config.delete | Deletes the configuration and all child objects | ||
Config.delete_logging | Deletes all logging records that belong to this configuration as well as the physical log file, if it exists | ||
Config.delete_mappings | Deletes all mappings that belong to this configuration | ||
Config.delete_parameters | Deletes all parameters that belong to this configuration | ||
Config.generate_and_clean_up_parameters | Populates the parameter table with the parameters defined by the source/pool/target module of this configuration. Superfluous parameters are removed. Note that this has no effect on a finished configuration. | ||
Config.generate_export_mapping | Generate a mapping based on the customizing of the source module | ||
Config.generate_import_mapping | Generate a mapping based on the customizing of the target module | ||
Config.generate_mapping_by_position | Generate a mapping based on the positions of the data items in the source and target module | ||
Config.generate_mapping_from_python_ids | Generate a mapping based on matching python ids in the source and target module | ||
Config.get_all_mappings | A list of mappings | Get a list of all mappings that belong to this config. | |
Config.get_function_mapping | A list of mappings | Get a list of all enrichers, converters, and validators that belong to this config. | |
Config.get_invalid_mappings | A list of mappings | Get a list of all mappings which the sanity check defines as invalid. | |
Config.get_mapping | A list of mappings | Get a list of all top level mappings, sorted by position. | |
Config.get_pool_mapping | A list of mappings | Get a list of all pool mappings. | |
Config.get_source_mapping | A list of mappings | Get a list of all source mappings. | |
Config.get_specific_mappings | mapping_type: ppms.interface.MappingType | A list of mappings | Get a list of mappings of a specific type |
Config.get_step_one_mapping | A list of mappings | Get all source mappings that are relevant for the source -> pool transfer step. The mappings returned by this function are a copy of the internal data structure with children that are not relevant for step one removed. | |
Config.get_step_two_mapping | A list of mappings | Get all the source and pool mappings that are relevant for the source/pool -> target transfer step. The mappings returned by this function are not a copy of the internal data structure. | |
Config.get_target_mapping | A list of mappings | Get a list of all target mappings | |
Config.get_validation_hash |
| Calculate a hash over all parts of an interface that can be modified by the user and sanity-checked by PLANTA link. | |
Config.modify_parameter | source: MOD of the module which defines the parameter | Modify a parameter of a configuration. When |
Classmethods
Function | Parameters | Return Value | Description |
|---|---|---|---|
Config.create | creation_parameters: Any python id from table 560 that should have a custom value | A instance of the newly created configuration. The class is based on the class which calls | Create a new configuration record. If the configuration could not be created a |
Properties
Property | Getter | Setter | Description |
|---|---|---|---|
Config.amount_of_log_records |
|
| Returns the number of log records associated with this config |
Config.cancel_threshold_percent |
|
| |
Config.cancel_threshold_seconds |
|
| |
Config.config_hash |
|
| |
Config.copy_of |
|
| |
Config.description |
|
| |
Config.finished |
|
| |
Config.has_log_records |
|
|
|
Config.has_pool_step |
|
|
|
Config.hidden |
|
| |
Config.is_valid |
|
|
|
Config.last_run_as_number |
|
| |
Config.locked |
|
| |
Config.log_content |
|
| Returns all logging associated with this configuration as one string. The rows are prefixed with a timestamp. |
Config.log_content_without_prefix |
|
| Returns all logging associated with this configuration as one string, but without a timestamp prefix |
Config.log_level |
|
| |
Config.log_type |
|
| |
Config.logfile_path |
|
| Returns the path where all logging of this configuration is written. Only makes sense when the |
Config.mapping_generator_type |
|
| |
Config.parameters |
|
| Returns all module parameters for this configuration depending on the active system |
Config.parent |
|
| Returns an instance of the configuration from which this configuration was copied. If the config has no parent, |
Config.pool_mod_class_name |
|
| |
Config.pool_module |
|
| |
Config.pool_table |
|
| |
Config.source_mod_class_name |
|
| |
Config.source_module |
|
| |
Config.target_mod_class_name |
|
| |
Config.target_module |
|
| |
Config.template |
|
| |
Config.transaction_type |
|
| |
Config.transferred_on |
|
| |
Config.validated_parameters |
|
| Only returns those module parameters for this configuration that have a |
StaticConfig
The StaticConfig class is a more performant version of the Config class
Instead of lazy-loading the mapping when it is requested, the
StaticConfigclass fetches all mappings when initializing the classThis means that if you make any modification to the mapping of the interface, the
StaticConfiginstance will not know about the changes until you callStaticConfig.refresh()This class is much faster for executing and sanity-checking interfaces, but slower when you create interfaces programmatically
Methods
Function | Parameters | Return Value | Description |
|---|---|---|---|
StaticConfig.refresh | Calling |
RegtestConfig
The RegtestConfig class is used for unittesting PLANTA link
By default it doesn't write its log data into the database or filesystem but instead it just keeps it in RAM
Instead of logging errors, it raises a
ValueErrorwhenRegtestConfig.error()is called
Static variables
Variable | Description |
|---|---|
RegtestConfig.DEFAULT_LOG_LEVEL | This configures the default Log-Level when a new |
RegtestConfig.DEFAULT_LOG_TYPE | This configures the default Log-Typ when a new |