Skip to tutorial content
Rate module Not yet rated

Choosing an Existing CI Class Before Creating One

4 min read
On this page

In this lesson, you will learn:

  • Why reuse existing classes first
  • When a new class is justified
  • SNWR’s SNWR Mail Archiver class

πŸ” Quick look back: Last time: Checking Current ServiceNow Pattern Content First. You learned how to search current content before building.

1 The Problem: New Classes Add Work Forever

A new CI class is easy to create. But each one needs:

  • Identification rules.
  • Health rules and reports.
  • Someone to maintain it.

🎯 The problem: New classes add work forever.

πŸ‘‰ The fix: Use an existing class if one fits. Create a new one only when you must.

Compare using an existing class vs a new class.
Figure 1. Choosing a class for the archiver.

2 Reuse first

  • Look for a class for the same kind of software.
  • A generic Application class may be enough.
  • Add fields to a new class only when they’re needed.

3 Creating a class

Create it in CI Class Manager, under the right parent, such as Application. Add only the fields you need, and an identification rule.

πŸ’‘ Good to know: Need a refresher? See Fundamentals β€Ί CMDB Essentials β€Ί CI Classes & Relationships for class basics.

4 Project Clear View: How We Implemented It

πŸ“ Situation: The archiver needed a home in the CMDB.

🧭 Decision: Check existing classes, then create one only if needed.

πŸ› οΈ Steps we took:

  1. Looked for an existing class. Only generic Application fit.
  2. Hana needed port and archive path fields.
  3. Created SNWR Mail Archiver under Application in CI Class Manager on snwrdev.
  4. Added three fields: version, port, archive path.

βœ… What we verified:

  • The class exists with three fields.
  • It’s recorded in DD-D06.

πŸ“ Evidence: The class definition, listed in the migration matrix.

5 Quick recap

  • New classes add work forever.
  • Use an existing class if it fits.
  • Create a new class under the right parent.
  • Add only the fields you need.

6 Check yourself

Think of your answer first. Then tap to check.

1 Why not create classes freely? Show answer

Each needs rules, health settings and maintenance.

2 Which parent did the archiver class use? Show answer

Application.

3 Which three fields were added? Show answer

Version, port and archive path.

Nice work! The archiver has a class. πŸŽ‰
Next up: Deciding Between an Extension and a Custom Pattern

Was this lesson helpful?

Have a question or doubt?

Ask here and get help from instructors and fellow learners.

0 / 300

Only logged-in learners can post.