Blog Entry

tisenberg's picture
blog
Reads:

2787

Score:
0
0
 
Comments:

0

Computed property tips (enbedding java scripts into property fields)

(View Disclaimer)

When setting up custom property pages (attributes for an element), sometimes a field needs to be populated directly from the source system (IE: adapter integration point such as a management system, helpdesk, etc), in other cases, you may want to have a script embedded in the property in order to make it more real time updating, decision based updates and a slew of other situations. I thought I would provide a few script examples.

Assumptions:

  • You understand how to use custom property pages under Administration\Metamodel
  • You have a basic understanding of java script

    If you would like to have a count mechanism on the element as a property on the element such as Active Help desk tickets, Planned Change Requests, Outages, etc. For this use case, it is assumed that there are alarms under the element.

    Computed Property Script: element.alarms.length

    You could even have an element of server1.novell.com, which has three breakouts below it, one for change requests, one for helpdesk tickets and one for enterprise alarms. The children elements (help desk tickets, enterprise alarms, etc) have the element.alarms.length on them, then the parent server1.novell.com element has a script which pulls the totals up into specific roll up element properties.

    In anther example, you may want to use Service Configuration Manager to populate element property values periodically, in some other cases, you may require a more on demand based population. When you have a view set up where elements are correlated together, the properties are available on the main element, but you are required to drill into the correlated properties to see them. One option is that you can raise specific correlated properties to the main element without actually having to populate them. I know, confusing, think about it this way. There is an element called server1.novell.com. It is correlated with four different management tools and between those tools there are 50 different element property values, while all properties are useful, it might be nice to have a property page on the core element that shows only some of the specific important properties on that element and reduce the need of the end user to drill into the correlated elements.

    Computed Property Script: element[ "Netview.MAC_Address" ]

    For the example above, the first part is that the element within the view has elements correlated to it (matched within a Service Configuration Manager job). "Netview" is the reference to the adapter and MAC_Address is a reference to the property on the correlated element.

    You could even do a condition roll up panel (property page)

    Computed Property Script: element[ "Netcool.Condition" ]

    Again, "Netcool" being the adapter that was correlated against for server1 and Condition is the property that has the severity of the netcool server1 element.

    One use case I have used computed properties for is building SVG/Layout views. When you put important properties onto an element, you can then represent them in SVG/Layout views in interesting ways.

    Make sure to read the disclaimers below, then have fun with computed properties!

    Disclaimers:

  • Computed property fields are only pulled when they are accessed.
  • Values (results returned by script) of computed properties are not persisted to the database.
  • Big, complicated, etc scripts can cause performance impact to end users, automation, right-clicks, etc. Plan this out, for people or processes accessing the element properties, the computed property script is fired each time.
  • Test computed properties on a comparable development system with comparable use cases.

  • Disclaimer: As with everything else at Cool Solutions, this content is definitely not supported by Novell (so don't even think of calling Support if you try something and it blows up).

    It was contributed by a community member and is published "as is." It seems to have worked for at least one person, and might work for you. But please be sure to test, test, test before you do anything drastic with it.




    User Comments

    © 2013 Novell