Integrate CSD 2.0 with other software providers

  • Release version: Yokohama
  • Updated January 30, 2025
  • 6 minutes to read
  • Integrate CSD 2.0 with client software distribution providers, such as Casper, Altiris, or LANDesk.

    Note:
    Extending CSD 2.0 is an advanced procedure intended for use by experienced ServiceNow AI Platform developers only.

    Create provider tables

    Identify and create tables to store discovered data from the provider server.

    For example, Application, Collection, and Deployment tables are provided with the Microsoft Endpoint Configuration Manager spoke. Similarly, create tables to store the discovered data. You must create your application table that extends the Client Software Distribution Application (sn_csd_application) table.
    • Create a provider server table that extends the Configuration Item [cmdb_ci] table.
    • Create a software configuration table that extends Client Software Distribution Software Configuration [sn_csd_software_config] table.

    Create subflows

    Create subflows in Workflow Studio to discover and store data, and deploy application.

    Create these subflows in Workflow Studio as per your requirement.
    • Discover and Store Data Subflow:

      Subflow to discover the provider server, retrieve the data from provider server, and store that data in the ServiceNow instance. This data should be stored in the tables you had earlier created for storing the server data.

    • Deploy Application Subflow:

      Subflow to deploy software from the provider server. This subflow provides information to the provider regarding deploying an application requested from the service catalog.

    • Revoke Application Subflow:

      Subflow to revoke an installation from the provider server. This subflow that provides information to the provider regarding the user or device from which the application should be removed.

    • Look up Configuration Data Subflow:

      Subflow to retrieve configuration data for the specified requested item or software configuration record.

    The Deploy Application Template, Look up Configuration Data Template, and Revoke Application Template subflows are provided with CSD 2.0. You can use these subflows as reference and create subflows as per your requirement.

    Create a provider record

    Create a provider record to configure the flows.

    Before you begin

    Role required: admin

    Procedure

    1. Navigate to Client Software Distribution 2.0 > Providers.
    2. Click New.
    3. On the form, fill these values.
      Field Description
      Name Name to identify the provider record.
      Software configuration table Software configuration table you had created. This table extends Client Software Distribution Software Configuration [sn_csd_software_config] table.
      Provider server table Provider server table you had created. This table extends the Configuration Item [cmdb_ci] table
      Discovery Flow Subflow you had created to discover the provider server, retrieve the data from provider server, and store that data in the ServiceNow instance.
      Deployment Flow Subflow you had created to deploy software from the provider server.
      Revocation Flow Subflow you had created to revoke an installation from the provider server.
      Configuration Flow Subflow you had created to retrieve configuration data for the specified requested item or software configuration record.
      Source List List of discovery sources separated by a comma.
      Figure 1. Example provider record
      Sample provider record.
    4. Click Save.

    Create UI actions

    Create UI actions to discover data, create software model, create software configuration, and create catalog item.

    Before you begin

    Role required: admin

    About this task

    See UI actions for more information about creating a UI action.

    Procedure

    1. Create a UI action to discover data.
      1. Navigate to System Definition > UI Actions.
      2. Click New.
      3. On the form, fill these values.
        Field Description
        Name Name to identify the UI action record. For example, Discover Now.
        Table Provider server table you had created. This table extends the Configuration Item [cmdb_ci] table.
        Script Script to run when the UI action is executed. For example, enter
        sn_csd.CSDUtil.startDiscovery(current);
      4. Specify other fields as per your requirements.
      5. Click Save.
    2. Create a UI action to create and link software model to your provider application or software.
      1. Navigate to System Definition > UI Actions.
      2. Click New.
      3. On the form, fill these values.
        Field Description
        Name Name to identify the UI action record. For example, Create Software Model.
        Table Application table you had created. This table extends the Client Software Distribution Application (sn_csd_application) table.
        Note:
        You can use either SAM or CSD 2.0 software model and license tables. Depending upon how the Determines whether to use SAM plugin(SAM Foundation or SAM Professional) tables for managing software models and licensing information system property (sn_csd.useSAMPlugin) is configured, use the corresponding software model table.
        Condition Defines the conditions that restrict when the UI action appears. For example, if software model is associated with the application or software, you may want to hide this UI action. So, enter (gs.getProperty("sn_csd.useSAMPlugin") == 'true' && current.model=="" && (GlidePluginManager().isActive("com.snc.sams") || GlidePluginManager().isActive("com.snc.samp.core"))) || (gs.getProperty("sn_csd.useSAMPlugin") == 'false'&& current.csd_model=="").
        Script Script to run when the UI action is executed. For example, enter
        var newModel = '';
        var tableName = '';
        if (gs.getProperty("sn_csd.useSAMPlugin") == 'true' && current.model == "" && (GlidePluginManager().isActive("com.snc.sams") || GlidePluginManager().isActive("com.snc.samp.core"))) {
            tableName = 'cmdb_software_product_model';
        
        } else {
            tableName = 'sn_csd_software_product_model';
        }
        newModel = new sn_csd.CSDModelUtil().generateModel(current, tableName);
        
        if (newModel != '')
            gs.setRedirect(tableName + ".do?sys_id=" + newModel);
      4. Specify other fields as per your requirements.
      5. Click Save.
    3. Create a UI action to create software configuration.
      1. Navigate to System Definition > UI Actions.
      2. Click New.
      3. On the form, fill these values.
        Field Description
        Name Name to identify the UI action record. For example, Create Software Configuration.
        Table Application table you had created. This table extends the Client Software Distribution Application (sn_csd_application) table.
        Note:
        You can use either SAM or CSD 2.0 software model and license tables. Depending upon how the Determines whether to use SAM plugin(SAM Foundation or SAM Professional) tables for managing software models and licensing information system property (sn_csd.useSAMPlugin) is configured, use the corresponding software model table.
        Condition Defines the conditions that restrict when the UI action appears. For example, you may want to show the UI action only if the software model is configured. So, enter (gs.getProperty("sn_csd.useSAMPlugin") == 'true' && current.model!="" && (GlidePluginManager().isActive("com.snc.sams") || GlidePluginManager().isActive("com.snc.samp.core"))) || (gs.getProperty("sn_csd.useSAMPlugin") == 'false' && current.csd_model!="").
        Script Script to run when the UI action is executed. For example, enter
        var softwareConfig = createConfig(current);
        action.setRedirectURL(softwareConfig);
        
        function createConfig(appGr) {
            var gr = new GlideRecord("<Provider-software-configuration-table>");
            gr.initialize();
            gr.application = appGr.sys_id;
            gr.name = appGr.display_name;
            gr.insert();
            return gr;
        }

        In this example, replace <Provider-software-configuration-table> with the provider server table you had created. This table extends the Configuration Item [cmdb_ci] table.

      4. Specify other fields as per your requirements.
      5. Click Save.
    4. Create a UI action to create catalog item.
      1. Navigate to System Definition > UI Actions.
      2. Click New.
      3. On the form, fill these values.
        Field Description
        Name Name to identify the UI action record. For example, Create Catalog Item.
        Table Application table you had created. This table extends the Client Software Distribution Application (sn_csd_application) table.
        Note:
        You can use either SAM or CSD 2.0 software model and license tables. Depending upon how the Determines whether to use SAM plugin(SAM Foundation or SAM Professional) tables for managing software models and licensing information system property (sn_csd.useSAMPlugin) is configured, use the corresponding software model table.
        Condition Defines the conditions that restrict when the UI action appears. For example, you may want to show this UI action only if software model is configured and there is at least one software configuration. So, enter sn_csd.CSDUtil.isCSDSoftwareModelAndConfigurationSet(current, "<provider software configuration table>", "<internal name of software configuration table's column that refers to provider's application table>").
        Script Script to run when the UI action is executed. For example, enter
        var catItemHandler = new sn_csd.CSDCatItemHandler(current);
        var catItem = catItemHandler.createCatalogItem(current);
        
        
        
        //first parameter - provider's software configuration table
        //second paramter - internal name of software configuration table's column that refers to the provider's application table
        var sfConfig = catItemHandler.getSoftwareConfig('<provider software configuration table>', '<internal name of software configuration table's column that refers to provider's application table>);
        var gr = new GlideRecord('sn_csd_cat_item_fulfilment_config');
        gr.initialize();
        gr.cat_item = catItem.sys_id;
        gr.provider = '<provider's Sys ID from sn_csd_provider table record>'; //provider's Sys ID from sn_csd_provider table record
        gr.software_config = sfConfig; //populating software configuration
        gr.insert();
        action.setRedirectURL(catItem);
      4. Specify other fields as per your requirements.
      5. Click Save.