Name

global.MLUpdater

Description

Utilities to update similarity models on node and database

Script

var MLUpdater = Class.create();
MLUpdater.prototype = {
  ML_SOLUTION_DEFINITION : 'ml_solution_definition',
  initialize: function() {
  },

  type: 'MLUpdater',
  
  update: function(solutionName) {
  	var ml_schema =  new global.MLSchemaHelper().getMLSchema();
  	var solutionDef = new GlideRecord(ml_schema.schema_table);
  	solutionDef.addQuery('solution_name', solutionName);
  	solutionDef.addActiveQuery();
  	solutionDef.query();
  	if(!solutionDef.next()) {
  		return;
  	}

      var finder = new sn_ml.SolutionFinder();
      var solution = finder.getSolution(solutionName);
      if (gs.nil(solution) || !solution.isActive()) {
  		return;
      }
      solution.updatePV();
   }
};

Sys ID

af8c43f157231300cc25b7d4ef94f9cc

Offical Documentation

Official Docs: