Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA Pipeline Operations for Liquids

Map the custom correctionLibrary_enum to your plugin

Map the custom correctionLibrary_enum to your plugin

  • Last UpdatedApr 24, 2025
  • 2 minute read

Extending correctionLibrary_enum

Each plugin corresponds to a unique correctionLibrary_enum value. With each plugin created, you must create a corresponding value in correctionLibrary_enum by extending the enum in the schema. Refer to the following correctionLibrary_enum_override.json example:

{

"name": "correctionLibrary_enum",

"values": [

{

"name": "AT_CORRECTLIB_PLUGIN",

"description": "AT Custom Plugin",

"value": 100

}

]

}

Place the file in %DNADataRoot%\RealTime\database\schema\enumerations\your_volume_correctionLibrary_enum_override_file_name.json.

Note: The name of the file does not matter if it does not conflict with an existing file in the same directory.

When deciding on the value of your custom correctionLibrary_enum, make sure it does not conflict with any values in the baseline schema. For example, in the baseline, schema API_2004 has a value of 0, and API_1980 has a value of 1; REFPROP_VOL has a value of 2, and REFPROP_MAS has a value of 3.

Make sure to space out your custom values from the baseline in case new baseline values are added in the future. For example, if you create 3 correctionLibrary_enum values with the values 100, 101, and 102, and the baseline schema eventually adds CORRECTION_LIBRARY_NEW with a value of 4, there will not be any conflicting values.

Applying the schema extensions

After you have included your schema extensions, you can apply them by executing %DNAInstallRoot%\RealTime\bin\SchemaConverter.exe with RealTime shut down. Once applied, execute the following Advanced Database Editor (ADE) initialization commands in order to see the new enumeration values in ADE:

dbeditdisplayschemamerge -v -f schema

dnatreelayoutschemamerge -p ADE -f schema

Extending LMS.RealTime.json

To map your custom correctionLibrary_enum value to your plugin, you need to add a settings file that links the correctionLibrary_enum name to the assembly and class that implements IVolumeCorrectionPlugin. Place the settings file in the %DNADataRoot%\RealTime\config\Settings\ directory. For an example, refer to LMS.RealTime_override.json.

Note: The name of the file does not matter if it does not conflict with an existing file in the same directory.

{

"LMS": {

"Common": {

"VolumeCorrectionPluginAssemblies": {

"AT_CORRECTLIB_PLUGIN": {

"AssemblyName": "OASySDNA.LMS.SDKTests.RealTime.Common.VolumeCorrectionPluginExample",

"ObjectName": "OASySDNA.LMS.SDKTests.RealTime.Common.VolumeCorrectionPluginExample.ExamplePlugin"

}

}

}

}

}

Extending LMS_Extensions.json

The plugin is loaded using the standard OASyS extension architecture. To load your custom assemblies, create a .json file in the %DNADataRoot%\RealTime\config\Settings\ directory. For an example, refer to LMS_Extensions_override.json.

Note: The name of the file does not matter if it does not conflict with an existing file within the same directory.

LMS_Extensions_override.json

{

"LMS": {

"Extensions": {

"Common": {

"OASySDNA.LMS.SDKTests.RealTime.Common.VolumeCorrectionPluginExample.dll": true

}

}

}

}

Applying the changes

After extending LMS.RealTime.json and LMS_Extensions.json, you need to restart the RealTime service for changes to take effect.