Relations between Objects

Sometimes it can be useful to group different objects together. One requirement could be, to group a Computer, a Monitor and a Printer Object together to form a Workplace Object. This could be useful to easily recognize which objects belong to a specific workplace. This example uses an Object Class “Monitor” to group Monitors together with Computers and Printers.

However, Monitor-Objects do not exist out-of-the-box in Service Manager. It is necessary to create a new Class for managing those kind of objects. Details on how to do this can be found here. I’m using an unsealed Management Pack which already contains a “Monitor”-Class. Start the Service Manager Authoring Tool and open the Management Pack.

clip_image002

Next, I’m going to create a new Class called “Workplace”. The Base Class for this is “Configuration Item”.

clip_image004

clip_image006

After the successful creation of the new Class, I’m going to delete the automatically created Key Property.

clip_image008

Now, I create a new property called “Workplace Number” and mark it as key property.

clip_image010

clip_image012

Next, we will add some relations to the new class. I will call this “Monitor_to_Workplace” to link a specific Monitor to a Workplace-Object.

clip_image014

clip_image016

In the Details of the new relation, I define a meaningful name as well as the “the other end” of the relation, means the “Monitor”-Class.

clip_image018

clip_image020

Now, I repeat the steps for relations to other object types. The procedure is exactly the same.

clip_image022

As a last step, I add all needed properties to the Workplace-Class.

clip_image024

For managing objects in the Service Manager Console, generic forms are used. If you want to use specific relations to other objects like we want to use, you have to create a specific form. Such forms can be created directly in the Authoring Tool.

clip_image026

Select the Class that the new form should be used to. Select “Workplace” and define an ID for the new form afterwards.

clip_image028

clip_image030

The Forms Toolbox should be displayed and you can drag the needed Elements directly onto the form. I will use Labels, Textboxes (for attribute values) and Single Instance Pickers (for relations).

clip_image032

clip_image034

After the different fields are placed on the form, the binding have to be configured. This is done through the details pane. Select the Attributes and/or relations for all the fields.

clip_image036

clip_image038

Now it’s time to import the Management Pack. For the management of the Workplace-Objects I create a new view that shows all instantiated objects in the Workplace-Class.

clip_image040

If a new Workplace-Object is created, the new form is automatically loaded. You can now easily configure Workplaces and select the related Objects like Monitors, Computers and Printers by using the object picker.

clip_image042

clip_image044

clip_image046

About Marcel Zehner

Microsoft Azure MVP
This entry was posted in SCSM and tagged , , , , , , . Bookmark the permalink.

11 Responses to Relations between Objects

  1. Pingback: System Center Service Manager information(blog) overview - System Center Service Manager

  2. Pingback: System Center Service Manager information(blog) overview … | The People Search System

  3. aleem qureshi says:

    how can i added multiple monitors or a collection of monitor in Workplace from?

    • Marcel Zehner says:

      Hey

      Can you pls clarify a little bit what you want to achieve?

      Thanks!

      • aleem qureshi says:

        I would like to use you example of Workplace class and create 1 to many relationship with monitor class. Is there a way to multi select monitors in the workplace form using (or similar fashion) instance picker control?

        My goal is to create relationship classes where end user can bind multiple related class objects to the source class instance via form. Not sure, if it is possible.
        Thanks for the reply

      • Marcel Zehner says:

        This is indeed possible. But for displaying multiple values in a 1:n relationship you need a list view control, and this is not available in the authoring tool. that means after creating the class and all the relationships, you must build your form in visual studio.

        cheers
        Marcel

  4. Frank says:

    Any examples available on how to add a 1:n relation and create a form in Visual Studio with a list view control

  5. Hazeeb says:

    Hi, If i create a multiple checker boxes (for eg:type of connectivity available 1.ethernet 2. iscsi 3.wifi 4.vga). is it possible? what is the feature called as , and how can i bind it in authoring tool.
    Thanks in advance.

    • Marcel Zehner says:

      Hey

      If you want to user/analyst to select only 1 value, then you can use a list. Otherwise you can use multiple checkboxes.

      Cheers
      Marcel

  6. Karol says:

    Great example! But I need on more function in console. I need in Configuration Item view show my Relationship, now i see only normal field. In Create View form in Criteria options where is related classes i have only Monitor, no Workplace, ist normal?

    • Marcel Zehner says:

      Hey

      If you want to display related items in a view you need to create a type projection and use this instead of a class to create the view. However, for 1:n relationships there is no OOB way to present those objects.

      Cheers
      Marcel

Leave a Reply to Frank Cancel reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s