Skip to main content

AF Attribute Template AF Attribute Template


AF Attribute Template ExportAF-Attribute-Template-Export


Input​

InputsTypeMandatoryDescription
PISystemstringY
DatabasestringY
NamestringY
FilterNamedynamicNIf not null, only export attributes that fit the name filter (full path)
FilterCategorydynamicNIf not null, only export attributes that have this category
ExportAllValuesdynamicNExport all values
ExportStaticValuesdynamicNExport values that have a null data reference
ExportValuesCategorydynamicNExport value for this attribute category

payload

Output​

OutputsTypeDescriptionExample
Attributesarray[1]
0object
AttributePropertiesobject
Name""enum""
IsATemplatetrue
Description""""
ValueType""AFEnumerationValue""
ConfigString""""
SimpleConfig""""
DataReferencePlugIn""""
DefaultUOM""""
DefaultValue""Value1""
DisplayDigits-5
IsConfigurationItem""False""
IsManualDataEntry""False""
IsExcluded""False""
IsHidden""False""
TypeQualifierThe Enumeration Set name""Tester""
IsTypeQualifierGlobalWhen the Enumeration Set is from Global rather than Database e.g ""System""false
Categoriesarray[0]
Valueobject
IsAnythingValueShould only be true when ValueType is ""Object"" & Value is Null. In AF this is equivalent tofalse
T""AFEnumerationValue""
V""Value1""
Attributesnull
Errornull
PrimaryPathundefined

Payload Example​

Replace PISystem and Database w/ strings    


msg.payload =
{
"PISystem": env.get("TestSystem"),
"Database": env.get("TestDatabase"),
"TemplateType": "ElementTemplate"
};

Full test sub flow​

[{"id":"c7c8162b.0a6178","type":"subflow","name":"TestADSNode_Export-Attribute-Templates","info":"## Description\nThis test includes refreshing the servers, databases and checking in.\n\n## Version\n1.0.0\n\n## Prerequsites\nElementTemplate \"Pump\" must exist\nAttributeTemplates in \"Pump\" otherwise it will be an empty array\n\n## Inputs\nTestServer\nTestDatabase\n\n## Expected Outcome\nPayload output of an array of AttributeTemplates, PrimaryPath will be undefined as the node will continue passing the PrimaryPath from before but there is not one.","category":"","in":[{"x":40,"y":80,"wires":[{"id":"ba1a1fd6.1f449"}]}],"out":[{"x":1140,"y":160,"wires":[{"id":"61a6aa3d.a01434","port":0}]}],"env":[{"name":"TestSystem","type":"str","value":"NodeADSTestSystem"},{"name":"TestDatabase","type":"str","value":"NodeTestCaseTarget"}],"color":"#DDAA99"},{"id":"fe6c098e.78d648","type":"debug","z":"c7c8162b.0a6178","name":"export-attribute-templates","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":970,"y":220,"wires":[]},{"id":"d3ff1f89.8078b","type":"function","z":"c7c8162b.0a6178","name":"RefreshTargetDatabases","func":"var server = env.get(\"TestSystem\");\nmsg.payload = {\n    \"ItemType\":\"AFDatabases\",\n    \"Input\":server\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":470,"y":120,"wires":[["8309875d.b205b8"]]},{"id":"8309875d.b205b8","type":"afserver-information","z":"c7c8162b.0a6178","name":"","x":540,"y":160,"wires":[["d92deb2.b039b18"]]},{"id":"ba1a1fd6.1f449","type":"function","z":"c7c8162b.0a6178","name":"Get and refresh servers","func":"msg.payload = {\"ItemType\":\"AFServers\",\"Input\":\"\"};\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":190,"y":80,"wires":[["b93b0fbd.4344"]]},{"id":"b93b0fbd.4344","type":"afserver-information","z":"c7c8162b.0a6178","name":"","x":240,"y":120,"wires":[["d3ff1f89.8078b"]]},{"id":"d92deb2.b039b18","type":"function","z":"c7c8162b.0a6178","g":"ec771ddf.d014b","name":"Payload","func":"msg.payload = \n{\n    \"PISystem\": env.get(\"TestSystem\"),\n    \"Database\": env.get(\"TestDatabase\"),\n    \"Name\": \"Pump\"\n};\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":780,"y":160,"wires":[["61a6aa3d.a01434"]]},{"id":"61a6aa3d.a01434","type":"export-attribute-template","z":"c7c8162b.0a6178","g":"ec771ddf.d014b","name":"","x":970,"y":160,"wires":[["fe6c098e.78d648"]]},{"id":"11cc4dcf.2d81b2","type":"subflow:c7c8162b.0a6178","z":"eca2482b.020608","name":"","env":[],"x":540,"y":900,"wires":[[]]}]