The ArchestrA Attribute Wrangler

One frustration that I often have with ArchestrA is wanting to do bulk updates to attributes on one or more objects.  Things such as,

  • Updating a the description on an attribute that has a typo for all objects descending from a template
  • Change all the alarm priorities on objects hosted in a particular area
  • Changing the IO references for all objects using a particular topic name



To use it, first select the objects you want to include in the search.  You can either pick objects out of the derivation tree or search for them using the advanced search function (recommended).  You can search by area, template, and object name.  All object search options are regex pattern matched, so if you want to match a template remember to escape the $ character (i.e. \$).

Once you have found your objects, set the attribute name pattern (also regex aware).  Then select the action you want to perform, the options are:

  • Find:  List the matched attributes in the log.  You can also match values against a regex pattern if you fill out the find value.
  • Find-Replace: Perform a find and replace operation in the value of the attribute.  This can only be performed on attributes of type string and MxReference.
  • Find-Update: For attributes that have a value matching the find-value (exactly), replace the entire value with the replace-value.  Applies to strings, floats, doubles, integers and references.
  • Update: Update the value of all matching attributes with the replace-value.  Applies to the same data types as Find-Update.
  • Set-Lock: Set the lock status for the attribute.
  • Set-Security:  Set the security classification for the attribute.

The find and replace value text fields are not regex aware (except in Find mode), although they do support the token '~%obj', which will be replaced with the object name.

Multiple operations can be done at once to save time on checkout and checkin operations, use the Add/Delete buttons to add or remove extra operations.  The Load/Save buttons can load or save the parameters to a file.  This is useful when reusing complex expressions.

If you only want to preview the operations that would be performed, check the whatif box.  This will log all the operations that would occur if not for the box being checked.  Note that the GRAccess SDK is not fast, so if you are performing operations on many objects, expect it to take some time (checkout time via GRAccess is about as slow as through the IDE).

Additional info:

  • If your galaxy uses OS security, you don't need to fill out the username and password fields when logging in.
  • The tool accesses the galaxy database using integrated security, so ensure that the current user has access to the database.
  • This tool will not stop you from doing stupid things.  I strongly suggest you backup your galaxy before using this tool.  Use the whatif option to test your operations.

Bulk updating IO references via csv file

The Wrangler can bulk  update IO references via csv file.  This is primarily designed to be used in conjunction with the aaIOChecker tool, which can automatically produce these files, but any valid csv file can be used.  The csv file should contain at least the following columns,

  • Address - the new IO reference
  • Attribute - the name of the attribute (not including the object name)
  • Object - the object that the attribute belongs to

The Attribute Wrangler can be downloaded from github.

| February 1st, 2018 | Posted in SCADA, Software |

8 Responses to “The ArchestrA Attribute Wrangler”

  1. ZigoZago Says:

    Hi raggles.wiki congratulations for the tools made. Is there a possibility to extract the alarms / area / priorities with this tool? Or do you have any idea how it can be done? There is a view in the galaxy database but without priority. Thanks.

  2. Raggles Says:

    Yes you can get anything that is available in the object viewer, including alarm and area configuration. (open image in new tab to see full size) wrangler

  3. ZigoZago Says:

    Hello Raggles,
    really very kind in answering me so quickly. My question is related to being able to export all the alarms and the priority, without having any idea what they are. Should I add all the instances and then do the search? In the end export the csv file? Thanks so much.Regards.

  4. Raggles Says:

    I get the impression you are looking for the runtime alarms? If so you can't do that with this tool you want to be using the alarm toolkit, there are plenty of code samples around the web that can help you with that.
    If you do want the configured alarms then yes you could add all the object instances and search for "\.Priority$". This tool can't export the log to csv but that functionality would be easy to add yourself.

  5. ZigoZago Says:

    Morning i looking for a toolkit which allows me to export all galaxy alarms with priorities. If you say there are toolkits on the net I will try to search.
    Thanks.
    Regards.

  6. ZigoZago Says:

    If you have any suggestions on where to look it would be appreciated.
    Thanks.
    Regards.

  7. Raggles Says:

    There used to be plenty of examples online but I can't find them either - I have a c# example at https://gist.github.com/Raggles/ff2c4e218f896044fdf9410f4c14c213 and you can basically translate that into quickscript to use in an object

  8. ZigoZago Says:

    Thanks.
    Regards.

Leave a Reply