Accessing Custom Attributes in condotion-Objects

Started by gkaudewitz, August 09, 2016, 01:41:15 PM

Previous topic - Next topic

gkaudewitz

Is there a possibility accessing custom attributes within the script of a condition Attribute?

Best regards

Georg

tomaskir

If you have a $node object available (which should be in EPP Condition scripts), you have multiple options:

Get a single known attribute:
https://wiki.netxms.org/wiki/NXSL:GetCustomAttribute

Get all custom attributes of a node:

attributes = $node->customAttributes;
foreach(attrib : attributes->keys) {
  // name
  println(attrib);

  // value
  println(attributes[attrib])
}