Default language.

Information
Important This documentation space contains information about the SaaS version of BMC Helix Discovery. If you are using the on-premises version of BMC Helix Discovery, see BMC Helix Discovery 25.2 (On-Premises).

Creating a service model or rules template by using a visual query


You create a a service model or rules template by using a visual query in BMC Helix Discovery. Visual queries provide an intuitive way to create complex queries without needing to use the query language, though you should have some understanding of the BMC Helix Discovery model. The visual query builder that is part of the UI for creating a service model or rules template has much in common with that used for searching, and familiarity with the visual query builder tools will be helpful. 

To open the visual query builder

 
The visual query builder provides a way of selecting the nodes that you want in your rules-based service model or template by using the visual query builder. To do this:
  

  1. From the modeling home page (Model > Services & Applications), click Create/Import.
    CreateImport.png

  2. Click Create with Visual Query to open the visual query builder.

To create a service model by using a visual query

 
From the visual query builder:

  1. Select a starting node kind, and continue from there.
    Model-query-builder.png

  2. Enter a name for the model.
  3. Click Add a starting node kind.
    The Node Kinds selector panel is displayed.
    Node-kind-selector.png
    • The default panel is the Common node kinds list.
    • You can also select a list of nodes by category or search the kinds displayed by using the Search box.
    • You can also select a 'wildcard' node that matches any node kind.
  4. Select a starting node kind, For example, Host.
    Host-selected.png
  5. Click Apply to save the changes.
  6. Mousing over the node shows controls available for that node:
    node-controls.png

    Information
    Info

    At any stage in the development of the model, you can add notes or attributes to the model. For example, you might choose to add notes on the development of the model, and an attribute stating the name of the model author. Click Attributes or Notes on the left of the UI.

  7. Click Add or modify a filter. See Filters for information on how to use the filters. In this example, we selected an OS containing the word "Windows".
  8. Click Add a related node. A new node, with a link from the previous node is displayed, with a Node Kinds selector. 
  9. Choose the kind of related node.
    Second-node-kind-selector.png
  10. Click Add or modify a filter, and select the Filter tab. See Filters for information on how to use the filters. In this example, we selected an SI name containing the word "Outpost".
    panel.png
  11. You can also use named values to provide an identity in human-readable naming conventions that help you differentiate between instances. A named value is a text variable whose value is derived from a starting attribute on the node by a transformation. For example, hosts have a naming convention of hostname-prod or hostname-qa depending on whether they are in the Production or Quality Assurance environment. The transformation creates the value prod from the hostname helix490-prod.
    1. Select the Named Values tab, and click Define a New Named Value.
    2. Enter a name for the named value. For example, Environment.
    3. Select a starting attribute. For example hostname.
    4. Enter a test value for the attribute.
    5. To use the named value to identify instances (Production or Quality Assurance environment) select Use to identify instances.
    6. To use the named value to name instances, select Use for instance name.
    7. The environment is defined by the part of the hostname after the dash in hostname-prod or hostname-qa.
    8. To add the logic that creates the resulting name, click Add Transformation, and select split on [delimeter, index].
    9. Enter a dash in the delimeter row, and number for the group. In this case, the second (index 1) is the required group. 
    10. To convert the resulting prod or qa into a more readable description we can use a table. Click Add Transformation, and select table [default, (key,value)...].
    11. Enter:
      • A default: unknown
      • prod for the from value and Production for the to value.
        Click Add another row.

      • qa  for the from value and Quality Assurance for the to value. 
    12. The bottom section of the panel shows sample values and their transformations. Modify the transformations until the results are satisfactory, and click Save Definition.
      named-values.png

  12. Click Apply to save the changes. 

    Information
    Info

    See Using and manipulating named values for a more detailed explanation of the options, parameters and examples of transformations in named values. The topic is in the context of Legacy CAM, though the principles are the same.

  13. The relationship between the two nodes does not have a kind. It is labelled Any Relationship. Click the relationship's context menu and select Edit relationship.
    relationship-picker.png
  14. Select the required relationship.
    select-relationship.png
  15. Click Apply to save the changes.
     

To create a rules template by using a visual query

 
You create a rules template in exactly the same way as a service model. The only difference is that a rules template has one or more parameters. To add a parameter: 

  1. Add a node kind, for example a host.
  2. Click Add or modify a filter
  3. Either:
    • from the Select attribute drop down, select Define an attribute parameter.
      or:

    • choose an attribute from the list and from the Filter Operator drop down, select Define a parameter.
  4. Once you have added a parameter, the Save button becomes a Save template button. Once saved, the template cannot be changed back into a model, although you can go on to make many models from that template.

    attribute-parameter.png filter-parameter.png

To create a service model from a rules template

 

A rules template provides a starting point for creating a rules-based service model by using the visual query builder.

  1. Click Create with Visual Query to open the visual query builder.
  2. Click Choose a rules templatestarting node kind
    select-template.png

  3. Select a template from the list, and click Apply.
    • To help find the template you are looking for, enter text in the Filter rules templates dialog.
    • Select Show only favorites to reduce the number of templates in the list.
  4. Enter a name for the model and click Save.
  5. Continue to create your model from the steps in To create a service model by using a visual query

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*

BMC Helix Discovery (SaaS)