AnsweredAssumed Answered

Javascript split string method is not working in javascript operator

Question asked by Rafael_Anoto Employee on Jan 12, 2016
Latest reply on Jan 12, 2016 by Rafael_Anoto

Hi Community,

 

I have one javascript operator with the following code.

 

var jobssel = new Array();

var jobsstring = Process.jobs;

if (jobsstring.indexOf(",") == -1){

  jobssel.push(jobsstring);

}else{

  jobssel.push(jobsstring.split(/,/));

}

for (i = 0; i < jobs.length; i++){

  var jobsValueMapSelected = newValueMap();         // Crea valuemap de jobsSelected

  var items = jobssel[i].split("@");

  for(j = 0; j < items.length; j++){

    switch(j){

      case 0:

        jobsValueMapSelected.jobId = items[j];

        break;

      case 1:

        jobsValueMapSelected.jobName = items[j];

        break;

      case 2:

        jobsValueMapSelected.domainName = items[j];

        break;

      case 3:

        jobsValueMapSelected.Server = items[j];

        break;

      case 4:

        jobsValueMapSelected.domainUrl = items[j];

        break;

      case 5:

        jobsValueMapSelected.packageName = items[j];

        break;

      case 6:

        jobsValueMapSelected.packageVersion = items[j];

        break;

      case 7:

        jobsValueMapSelected.procedureName = items[j];

        break;

    }

  }

  Process.size = Process.ListJobsSelected.length;

  Process.ListJobsSelected[Process.ListJobsSelected.length] = jobsValueMapSelected; // Agrega valuemap a array de objetos

}

Process.e=0;

 

When I run the process this operator cancel with the following error "Failed to execute code:  -- TypeError: Cannot find function split. (#11)".

 

I test also with jobsstring.split(",") with the same behaviour.

The value of Process.jobs is:

 

B7F919D67E774DD1BB803104CB4364A1@DummyPackage 1.0:Install@W12R2SQLSDM141@W12R2EEMITAM141@http://192.168.159.62/DSM_WebService/mod_gsoap_utf8.dll@DummyPackage@1.0@Install,B7F919D67E774DD1BB803104CB4364A1@DummyPackage 1.0:Install@W12R2SQLSDM141@W12R2EEMITAM141@http://192.168.159.62/DSM_WebService/mod_gsoap_utf8.dll@DummyPackage@1.0@Install

 

Anybody could you help me about this error?

 

Thanks in advance,

Rafa

 

 

 

Outcomes