---
sourceDocument: Yokohama IT Operations Management
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/yokohama/it-operations-management

 Release :

    - yokohama

ft:locale :

    - en-US

ft:publication_title :

    - Yokohama IT Operations Management

ft:clusterId :

    - itom

bundleId :

    - itom

workflow :

    - Technology


---

# On classification script objects for Discovery

# On classification script objects for Discovery {#ariaid-title1}

* Release version: Yokohama
* 
* Updated March 26, 2026
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 2 minutes to read

Summarize  
![AI sparkle icon](https://servicenow.com/docs/portal-asset/ai-sparkle-icon) Summarized using AI  
This content was generated using new OpenAI-powered functionality. Results are provided on an as is basis and are not guaranteed to be accurate or complete.  

## Summary of On classification script objects for Discovery

On classification scripts in ServiceNow Discovery enable customization of application records identified by process classifiers.
By default, application names follow the format@, but these scripts allow you to tailor naming conventions and pass additional parameters to probes, aligning Discovery data with your business requirements.
Show full answer Show less  

## Customizing Application Names

* You can modify the default application name by using the **On classification script** field within a process classifier record.
* Common customizations include appending suffixes or including process parameters to create more descriptive names. For example:
  * Appending a numeric suffix: `mysql999@machineA` instead of `mysql@machineA`.
  * Including process parameters such as command-line arguments to distinguish instances, e.g., `eclipse-psn01884620@machineA`.

## Passing Parameters to Probes

You can use the **gprobeparameters** object within the script to define name/value pairs that pass context-specific values (like process commands) to probes triggered during classification. This enhances the flexibility of probe execution based on runtime information.

## Key Script Objects

* **current**: Represents a JavaScript object for updating properties of the application record (not a GlideRecord).
* **gsensor**: The DiscoverySensor object, providing access to the deviceGR, which references the computer CI where the process runs.
* **gclassification** : The process classifier record object, granting access to process attributes such as `name`, `command`, `parameters`, `PID`, and table name.
* **name** , **command** , **parameters**: Variables representing the process's name, command, and parameters respectively.
* **gprobeparameters**: A JavaScript object used to pass parameters to probes invoked during classification.

## Practical Application for ServiceNow Customers

Using On classification scripts, you can ensure that application names in Discovery accurately reflect your environment and business logic, improving clarity and manageability of your CMDB data. The ability to pass dynamic parameters to probes enhances Discovery's adaptability to complex process environments, enabling more precise and flexible data collection and dependency mapping.  
Use an On classification script in a process classifier to customize an application record.

## Renaming the default application name

By default, application names are in this format: `<name of the process classifier>@<the name of the computer CI where the process resides>; `
For example, for a MySQL server running on a computer called machineA, the application is named `mysql@machineA`.

You can use the On classification script field in the [process classifier record](https://servicenow-prod.fluidtopics.net/Y0kJlJBBOBgJb1_WpeIZlg "A process classification allows Discovery to create a particular CI type from information gathered during the identification and exploration phases.") to change the default application name to match your business needs. For example, the following script changes the default application name to include a
suffix after the process classifier:

    var computerName = g_sensor.deviceGR.name;
    var processClassifierName = g_classification.name;
    current.name = processClassifierName + "999" + "@" + computerName;

In this example, the name of the application record becomes `mysql999@machineA`.  
Another common technique is to set the application name based on the name, command, and parameter variables. For example, an Eclipse process might have the following values in these variables:

|-|-|
| name | "eclipse" |
| command | "/glide/eclipse/Eclipse.app/Contents/MacOS/eclipse" |
| parameter | "-psn_0_1884620" |
[ ]

{#r_OnClassificationScriptObjects__table_kdz_jgv_1q} If an Eclipse application runs on a computer called machineA, ServiceNow names the application eclipse@machineA. The following script appends the parameter value as part of the application name.

    var computerName = g_sensor.deviceGR.name;
    var processClassifierName = g_classification.name;
    current.name = processClassifierName + parameters + "@" + computerName;

In this example, the name of the application record becomes eclipse-psn_0_1884620@machineA.  
Sometimes it is useful to pass values to the triggered probes in the process classification. You can do this by creating a custom script that defines a name/value pair for the `g_probe_parameters` object. For example:

    g_probe_parameters['processCommand'] = command;

In this example, when a classification record triggers a probe, the script passes the probe a parameter called
`processCommand` with the value of the `command` variable.

## Script objects {#r_OnClassificationScriptObjects__section_mfx_qpc_fcb}

Use these objects in the script:{#r_OnClassificationScriptObjects__table_frt_zdv_1q__entry__2}

| Script object | Description |
|-|-|
| current | Points to a JavaScript object with its \[property:value\] pair to update the application record. It is not an actual GlideRecord object of the application. |
| g_sensor | Points to the DiscoverySensor object defined in the DiscoverySensor script include. This object contains a deviceGR object, which points to the computer CI record on which the process resides. |
| g_classification | Points to the process classifier record. This object is set in the Application Dependency Mapping sensor and is available in the On Classification script field. Use it to access the classified process properties: name, command, parameters, PID, and table name. |
| name | Points to the process name. |
| command | Points to the process command. |
| parameters | Points to the process parameters. |
| g_probe_parameters | A JavaScript object that enables parameter passing to the triggered probes. |
[ ]

{#r_OnClassificationScriptObjects__table_frt_zdv_1q}
**Related tasks**   

* [Create a Discovery process handler](https://servicenow-prod.fluidtopics.net/McZJhsBzsxBkjMOHJDCcOQ "Process handlers prevent the creation of duplicate CIs by filtering out parameters known to have inconsistent values before process classification occurs. You can create new classifiers or edit existing ones.")

