Quantcast
Channel: TechNet Blogs
Viewing all articles
Browse latest Browse all 17778

Creating TypeProjections for System Center Service Manager 2012

$
0
0

A common issue I see with Service Manager deployments are Queues, Views, etc created with unnecessary TypeProjections.  This can cause huge delays in processing workflows and causing issues with Console performance.  The biggest culprit I see is within Service Requests. Below I will discuss this briefly, also attached is a copy of an example Management Pack with a generic TypeProjection for Service Requests with just the Affected User and Assigned to User relationship.s

Let's take a quick look at the out of box TypeProjections for Service Requests.  As you can see below there are 4 out of box Type Projections. You have in order from top to bottom

  1. Service Request (advanced)
  2. Service Request (typical)
  3. Serivce Request and Activity
  4. System.WorkItem.ServiceRequest.View.SLAProjectionType (This one doesn't have a display string)

 So let's say you want to create a queue or a view that refers to the Affected User, the only choice you have is Service Request (Advanced) which has 15 relationships and even some nested ones. 

      <TypeProjections>

        <TypeProjectionID="System.WorkItem.ServiceRequestProjection"Accessibility="Public"Type="CoreService!System.WorkItem.ServiceRequest">

          <ComponentPath="$Target/Path[Relationship='WorkItem!System.WorkItemAssignedToUser']$"Alias="AssignedTo"/>

          <ComponentPath="$Target/Path[Relationship='WorkItem!System.WorkItemClosedByUser']$"Alias="ClosedBy"/>

          <ComponentPath="$Target/Path[Relationship='WorkItem!System.WorkItemCreatedByUser']$"Alias="CreatedBy"/>

          <ComponentPath="$Target/Path[Relationship='WorkItem!System.WorkItemAffectedUser']$"Alias="AffectedUser"/>

          <ComponentPath="$Target/Path[Relationship='WorkItem!System.WorkItemRelatesToConfigItem']$"Alias="RelatedConfigItems"/>

          <ComponentPath="$Target/Path[Relationship='WorkItem!System.WorkItemAboutConfigItem']$"Alias="AboutConfigItem"/>

          <ComponentPath="$Target/Path[Relationship='WorkItem!System.WorkItemAboutConfigItem' TypeConstraint='System!System.Service']$"Alias="AffectedServices"/>

          <ComponentPath="$Target/Path[Relationship='WorkItem!System.WorkItemRelatesToWorkItem']$"Alias="RelatedWorkItems">

            <ComponentPath="$Target/Path[Relationship='WorkItem!System.WorkItemAssignedToUser']$"Alias="RelatedWorkItemAssignedTo"/>

          </Component>

          <ComponentPath="$Target/Path[Relationship='WorkItem!System.WorkItemRelatesToWorkItem' SeedRole='Target']$"Alias="RelatedWorkItemSource">

            <ComponentPath="$Target/Path[Relationship='WorkItem!System.WorkItemAssignedToUser']$"Alias="RelatedWorkItemAssignedTo"/>

          </Component>

          <ComponentPath="$Target/Path[Relationship='WorkItem!System.WorkItemHasFileAttachment']$"Alias="FileAttachments">

            <ComponentPath="$Target/Path[Relationship='SupportingItem!System.FileAttachmentAddedByUser']$"Alias="FileAttachmentAddedBy"/>

          </Component>

          <ComponentPath="$Target/Path[Relationship='CoreKnowledge!System.EntityLinksToKnowledgeDocument']$"Alias="RelatedKnowledgeArticles"/>

          <ComponentPath="$Target/Path[Relationship='Catalog!System.WorkItemRelatesToRequestOffering']$"Alias="RelatedRequestOffering"/>

          <ComponentPath="$Target/Path[Relationship='WorkItem!System.WorkItemHasActionLog' TypeConstraint='WorkItem!System.WorkItem.TroubleTicket.ActionLog']$"Alias="ActionLog"/>

          <ComponentPath="$Target/Path[Relationship='WorkItem!System.WorkItemHasCommentLog' TypeConstraint='WorkItem!System.WorkItem.TroubleTicket.AnalystCommentLog']$"Alias="AnalystCommentLog"/>

          <ComponentPath="$Target/Path[Relationship='WorkItem!System.WorkItemHasCommentLog' TypeConstraint='WorkItem!System.WorkItem.TroubleTicket.UserCommentLog']$"Alias="EndUserCommentLog"/>

        </TypeProjection>

        <TypeProjectionID="System.WorkItem.ServiceRequestViewProjection"Accessibility="Public"Type="CoreService!System.WorkItem.ServiceRequest">

          <ComponentPath="$Target/Path[Relationship='WorkItem!System.WorkItemAssignedToUser']$"Alias="AssignedTo"/>

        </TypeProjection>

        <TypeProjectionID="System.WorkItem.ServiceRequestAndActivityViewProjection"Accessibility="Public"Type="CoreService!System.WorkItem.ServiceRequest">

          <ComponentPath="$Target/Path[Relationship='CoreActivity!System.WorkItemContainsActivity']$"Alias="Activity"/>

          <ComponentPath="$Target/Path[Relationship='WorkItem!System.WorkItemAssignedToUser']$"Alias="AssignedTo"/>

        </TypeProjection>

        <TypeProjectionID="System.WorkItem.ServiceRequest.View.SLAProjectionType"Accessibility="Public"Type="CoreService!System.WorkItem.ServiceRequest">

          <ComponentPath="$Target/Path[Relationship='WorkItem!System.WorkItemAssignedToUser']$"Alias="AssignedTo"/>

          <ComponentPath="$Target/Path[Relationship='SLACore!System.WorkItemHasSLAInstanceInformation' SeedRole='Source' TypeConstraint='SLACore!System.SLA.Instance.TimeInformation']$"Alias="SLAInstances">

            <ComponentPath="$Context/Path[Relationship='SLACore!System.SLA.Instance.InformationRefersToSLAConfiguration']$"Alias="SLAConfiguration"/>

          </Component>

        </TypeProjection>

      </TypeProjections>

By using the Service Request (Advanced) TypeProjection above you could put your environment is a poor shape that it doesn't need to be in.  To remedy this we will create some new TypeProjections that can be used as (Combination Classes) in the console.

  1. Below is an example of a TypeProjection with just Assigned to User and Affected User, this will drastically reduce the time it takes to query the object due to all the other relationships not being in the query.  Note this does not affect the Tickets/etc later as you can query an EnterpriseManagement object based on any TypeProjection that is related to it, this is for another topic though.  From here you can add more components or remove them.  

  <TypeDefinitions>

    <EntityTypes>

      <TypeProjections>

        <TypeProjectionID="CustomServiceRequestBasicProjection"Accessibility="Public"Type="CoreService!System.WorkItem.ServiceRequest">

          <ComponentPath="$Target/Path[Relationship='WorkItem!System.WorkItemAssignedToUser']$"Alias="AssignedTo"/>

          <ComponentPath="$Target/Path[Relationship='WorkItem!System.WorkItemAffectedUser']$"Alias="AffectedUser"/>

        </TypeProjection>

      </TypeProjections>

    </EntityTypes>

  </TypeDefinitions>


Viewing all articles
Browse latest Browse all 17778

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>