Authoring Friday

Every friday, adventures in System Center authoring

SCSM–SCOM Business Service Extension

With the integration of  SCOM and SCSM we can leverage our DA (Distributed Applications) created in SCOM into SCSM. Which is great but how can you extend the properties of a Business Service?

When you first start with this synchronization the first part you get stuck would be how to setup the connection which is a different topic. This post will describe what to do when you have your Services in SCSM and want to add custom properties to these services.

This post is created and dedicated to the famous Anders Asp Hot smile  http://www.scsm.se/ aka. @SCSMSE  (Famous…Yes!….They even named a framework after him Smile)

Understanding the “Business Service” in SCSM When you look at the business services in SCSM it all looks really simple, right?

You can either create the Business Service Manually from within SCSM or synchronize them form SCOM. It is the same, right?

Well for the end users yes they are the same! But for us the guys needing to create extensions add forms, and eating XML…..that’s another story:

To answer this question you need to open up the MP’s and put on your XML gear and dive in!

To understand what exactly happens on the back ground I have added the class structure. The figure below shows the classes the top is the base class “Object” below are all “child” classes al the way to the business service:

image

This is the structure let’s take a look at SCSM and synchronize a Distributed Application from SCOM to SCSM.

After checking the DA was synchronized now create a second “Business Service by clicking the Task “create Service”.

When you review the Business Service View from the SCSM console you see 2 “Business Services”.

This all looks really transparent, right? Or maybe there something more to it? Yes up until now this is what a user would experience. To the user this is all transparent and he will see 2 business services.

This is perfectly correct since to the user a business service is a business service. From our world as authoring freaks there is far more to it.

Let’s take a look how it really is designed in SCSM:

image

Unlike what it looks like to the user above picture shows how all components really live in SCSM. This is where the difference between both components lives, I will explain each component:

Business Service View

The view in SCSM is target at System.Service which makes it possible to show both child classes beneath the System.Service Class. This gives the console user the experience of looking at one “Business Service”. While in reality he is looking at multiple classes.

SCOM Distributed Applications Synchronized

In SCOM a Distributed application “Manually created in SCOM” lives in the class User Created Distributed Application. (Not manually created, really depends on the management pack. Most of the times it will live as a system.service. But this will bring in the same problem.)

SCSM Business Service Manually created

A manually created Business Service in SCSM (Created by the task “Create Service”) will live as a business service in SCSM.

Now why did they create a new class Business Service Class?

Why didn’t they re-used the already existing class and extended this one?

The answer to both these questions lies a little deeper and to understand you need to really examine the classes and their properties.

First remember an abstract class is not extendable nor can you add an abstract class instance manually in SCSM!

The picture below shows you exactly which classes are abstract and which are not. So basically state which classes you can extend and which classes you cannot extend:

image

Now you understand why they needed to create the extra class. All other classes are abstract and therefore you cannot create an instance of this class from SCSM by using the task “Create Service” nor can you extend them.

So basically you cannot extend the Distributed applications which are synchronized from SCOM!

This is a fact which we cannot change but there are solutions to work around this problem.

I will describe the solution to “Extend” the Synchronized DA’s from SCOM!

Extend Synchronized Business Services From SCOM

Since we cannot really extend the abstract class we are going to create a solution which is based on a new class and a type projection.

For extra read on type projections I strongly recommend reading below and just test:

Travis Wright – Creating Views That Use Related Property Criteria (Type Projections) : Software Views Example

Travis Wright – Creating Queues and Groups Using Type Projections

Travis Wright – Having More Fun with Type Projections Using ObjectProjectionCritera

The end goal is again a transparent solution to the user looking at the business services.

Here is the end result shown where the end user or service desk employee using the console experiences a single form with extended properties:

image

 

Create Extended.Business Service Class

Open the Authoring console and create a new Class with the following properties :

image

Make Sure the relationship “ExtendedBusinessRelatesToService” has a Source Max Cardinality of 1.

This is required to be able to use this relationship in a later phase.

image

Create a custom form for this class:

image

You have now created a Management pack with a new class and properties.

Trick the Default Service Form with a Type Projection

Next we are going to edit the default Service Form.

Simply edit the default Service Form in the Authoring Console and add an extra Tab Item containing extra properties, just add them don’t bind them to targets yet:

image

After creating this form in your management pack, save the management pack and close the authoring console.

Now we are going to extend the Type projection target at the customized service form by using a XML editor.

In the XML there are two type projections and two forms:

<TypeProjection ID="Extended.Business.Service.Form_TypeProjection" Accessibility="Public" Type="ExtendedBusinessServiceClass">

 

<TypeProjection ID="CustomForm_8a075e3c_dd8f_4b29_9e63_d73c2c76ee0d_TypeProjection" Accessibility="Public" Type="System!System.Service">

 

<Form ID="Extended.Business.Service.Form" Accessibility="Public" Target="Extended.Business.Service.Form_TypeProjection" Assembly="CustomFormTemplates" TypeName="CustomFormTemplates.HistoryOnlyTemplate">

 

<Form ID="CustomForm_8a075e3c_dd8f_4b29_9e63_d73c2c76ee0d" Accessibility="Public" Target="CustomForm_8a075e3c_dd8f_4b29_9e63_d73c2c76ee0d_TypeProjection" BaseForm="Alias_c47dbffb_8a79_48d7_a8d0_62b94f82d77f!ServiceMainForm" TypeName="Microsoft.EnterpriseManagement.ServiceManager.ServiceMaps.Forms.ServiceForm">

We need to focus on the Type Projection which is used in the ServiceMainForm, the form for viewing Services.

We are going to change this type projection to include our new class, After changing the Type Projection we can use the authoring tool to add the bindings.

<TypeProjection ID="CustomForm_8a075e3c_dd8f_4b29_9e63_d73c2c76ee0d_TypeProjection" Accessibility="Public" Type="System!System.Service">

          <Component Path="$Context/Path[Relationship='Alias_4631e730_74bb_49f3_9a11_d8ab92b69348!Microsoft.SystemCenter.ServiceDesigner.ServiceHasGroups']$" Alias="ServiceHasGroups" />

          <Component Path="$Context/Path[Relationship='System!System.ConfigItemContainsConfigItem' SeedRole='Target']$" Alias="UsedBy">

            <Component Path="$Context/Path[Relationship='Alias_b97cdc42_d94e_4c0e_ba0c_a0b3af25ff3e!System.WorkItemAboutConfigItem' SeedRole='Target' TypeConstraint='Alias_ce17648b_cb08_4401_8e4c_73099262a0ae!System.WorkItem.Incident']$" Alias="AffectedByIncidents" />

            <Component Path="$Context/Path[Relationship='Alias_b97cdc42_d94e_4c0e_ba0c_a0b3af25ff3e!System.WorkItemAboutConfigItem' SeedRole='Target' TypeConstraint='Alias_c5b0afe9_4b97_478b_af44_b878af41a801!System.WorkItem.ChangeRequest']$" Alias="AffectedByChanges" />

          </Component>

          <Component Path="$Context/Path[Relationship='System!System.ConfigItemOwnedByUser']$" Alias="ComponentServiceOwners" />

          <Component Path="$Context/Path[Relationship='System!System.ConfigItemServicedByUser']$" Alias="ComponentServiceContacts" />

          <Component Path="$Context/Path[Relationship='System!System.ServiceImpactsUser']$" Alias="ComponentImpactedByService" />

          <Component Path="$Context/Path[Relationship='System!System.ConfigItemImpactsCustomers']$" Alias="ComponentBusinessCustomers" />

          <Component Path="$Context/Path[Relationship='Alias_b97cdc42_d94e_4c0e_ba0c_a0b3af25ff3e!System.WorkItemRelatesToConfigItem' SeedRole='Target']$" Alias="ImpactedWorkItem" />

          <Component Path="$Context/Path[Relationship='Alias_b97cdc42_d94e_4c0e_ba0c_a0b3af25ff3e!System.WorkItemAboutConfigItem' SeedRole='Target']$" Alias="RelatedWorkItem" />

          <Component Path="$Context/Path[Relationship='Alias_e5d6f5cf_62d1_4210_bbdf_f67e3239c646!System.ConfigItemHasFileAttachment']$" Alias="FileAttachment" />

          <Component Path="$Context/Path[Relationship='System!System.ConfigItemRelatesToConfigItem']$" Alias="RelatedConfigItem" />

          <Component Path="$Context/Path[Relationship='System!System.ConfigItemRelatesToConfigItem' SeedRole='Target']$" Alias="RelatedConfigItemSource" />

          <Component Path="$Context/Path[Relationship='Alias_a34c42e2_3c61_4218_bb7f_31888ba93501!System.EntityLinksToKnowledgeDocument']$" Alias="RelatedKnowledgeArticles" />

        </TypeProjection>

Above is the entire type projection. we are going to add our newly created relationship to this type projection:

<Component Path="$Context/Path[Relationship='ExtendedBusinessServiceRelatesToService' SeedRole='Target']$" Alias="ExBusinessServiceRelatesToService">

            <Component Path="$Context/Path[Relationship='Tech1']$" Alias="Tech1RelatesToExBusinessService" />

          </Component>

 

The complete Type Projection will be:

<TypeProjection ID="CustomForm_8a075e3c_dd8f_4b29_9e63_d73c2c76ee0d_TypeProjection" Accessibility="Public" Type="System!System.Service">

         <Component Path="$Context/Path[Relationship='Alias_4631e730_74bb_49f3_9a11_d8ab92b69348!Microsoft.SystemCenter.ServiceDesigner.ServiceHasGroups']$" Alias="ServiceHasGroups" />

         <Component Path="$Context/Path[Relationship='System!System.ConfigItemContainsConfigItem' SeedRole='Target']$" Alias="UsedBy">

           <Component Path="$Context/Path[Relationship='Alias_b97cdc42_d94e_4c0e_ba0c_a0b3af25ff3e!System.WorkItemAboutConfigItem' SeedRole='Target' TypeConstraint='Alias_ce17648b_cb08_4401_8e4c_73099262a0ae!System.WorkItem.Incident']$" Alias="AffectedByIncidents" />

           <Component Path="$Context/Path[Relationship='Alias_b97cdc42_d94e_4c0e_ba0c_a0b3af25ff3e!System.WorkItemAboutConfigItem' SeedRole='Target' TypeConstraint='Alias_c5b0afe9_4b97_478b_af44_b878af41a801!System.WorkItem.ChangeRequest']$" Alias="AffectedByChanges" />

         </Component>

         <Component Path="$Context/Path[Relationship='System!System.ConfigItemOwnedByUser']$" Alias="ComponentServiceOwners" />

         <Component Path="$Context/Path[Relationship='System!System.ConfigItemServicedByUser']$" Alias="ComponentServiceContacts" />

         <Component Path="$Context/Path[Relationship='System!System.ServiceImpactsUser']$" Alias="ComponentImpactedByService" />

         <Component Path="$Context/Path[Relationship='System!System.ConfigItemImpactsCustomers']$" Alias="ComponentBusinessCustomers" />

         <Component Path="$Context/Path[Relationship='Alias_b97cdc42_d94e_4c0e_ba0c_a0b3af25ff3e!System.WorkItemRelatesToConfigItem' SeedRole='Target']$" Alias="ImpactedWorkItem" />

         <Component Path="$Context/Path[Relationship='Alias_b97cdc42_d94e_4c0e_ba0c_a0b3af25ff3e!System.WorkItemAboutConfigItem' SeedRole='Target']$" Alias="RelatedWorkItem" />

         <Component Path="$Context/Path[Relationship='Alias_e5d6f5cf_62d1_4210_bbdf_f67e3239c646!System.ConfigItemHasFileAttachment']$" Alias="FileAttachment" />

         <Component Path="$Context/Path[Relationship='System!System.ConfigItemRelatesToConfigItem']$" Alias="RelatedConfigItem" />

         <Component Path="$Context/Path[Relationship='System!System.ConfigItemRelatesToConfigItem' SeedRole='Target']$" Alias="RelatedConfigItemSource" />

         <Component Path="$Context/Path[Relationship='Alias_a34c42e2_3c61_4218_bb7f_31888ba93501!System.EntityLinksToKnowledgeDocument']$" Alias="RelatedKnowledgeArticles" />

         <Component Path="$Context/Path[Relationship='ExtendedBusinessServiceRelatesToService' SeedRole='Target']$" Alias="ExBusinessServiceRelatesToService">

           <Component Path="$Context/Path[Relationship='Tech1']$" Alias="Tech1RelatesToExBusinessService" />

         </Component>

       </TypeProjection>

 

Now save the XML and open the authoring console again.

Now you can add the bindings to the ServiceMainForm, just select the field and select the “…” to browse for the property you want to use:

image

Notice how you can now traverse the relationship “ExtendedBusinessRelatesToService” to select properties of our custom class.

Select the correct binding paths for all fields.

The path to the TECH 1 user you need to add this manually and can’t use the browse function wen using this binding path. This is because this relationship is three layers deep.

Just add the binding path like “ExBusinessServiceRelatesToService.Tech1RelatesToExBusinessService”.

This binding path now travels over the first relationship from Service To Extended Service (ExBusinessServiceRelatesToService) and two the second realtionship Extended Service clas to User (Tech1RelatesToExBusinessService).

After this you can save the management pack and seal it.

Now you can import the management pack in your environment,

Create a view for your new Class.

image

Create a Class and relate it to an existing business service.

image

And now you are finished:

image

Recap

This post describes how to “extend” a business Service in SCSM.

The idea behind it is you grant your CMDB manager rights on the Extended Service View and instruct him how to create this class and link it to an business service.

The other users using the console don’ have access to this view and this solution will be transparent to them. They experience simple editing and adding of custom properties to business services.Open-mouthed smile

If you want this  even fancier you could create a task to add the custom class and link them to a business service or use orchestrator to automatically create these for you !Hot smile

The example used uses a solution to show history tab, required for auditing purposes from Patrick Sundqvist – Part 1: Custom Form Templates for Service Manager 2012

Happy Authoring,

Oskar Landman

3 Responses to “SCSM–SCOM Business Service Extension”

  1. Very nice Oskar! Thanks for sharing.

    Comment by Marcel Zehner — April 28, 2013 @ 13:41

  2. +1
    great stuff, Oskar – as always!

    cheers,
    Stefan

    Comment by Stefan Koell — April 29, 2013 @ 07:54

  3. very nice stuff Oskar, have to test this!

    thanks for sharing!

    Comment by Holger Gerling — May 8, 2013 @ 14:53

RSS feed for comments on this post. TrackBack URL

Leave a Response