IT Process Automation

  • 1.  ERROR : System variables can not be modified.

    Posted Mar 02, 2015 09:39 AM

    (Hi All,

     

    I have an Interaction request form, where i am using a 'Table' inside two Field sets.

    have a loop in my process where conditionally the same Interaction request form (Assigned Task ) will have to run more than One time,

    For the first time the Initialization data to the form is successful with out an error after that if it has to run the more that one time it is giving an error as "Failed to execute to line no XX System Variables can not be modified".

     

    I am using PAM ValueMap to represent /Process the data to the table.

     

    any suggestions why Assigned task (IRF) failed to run in second time in the loop.

     

    --Venkat



  • 2.  Re: ERROR : System variables can not be modified.

    Posted Mar 02, 2015 12:30 PM

    Mind posting the javascript in the loop? Sounds like you are trying to modify a process's system variable.  Take note that system variables of processes are not modifiable, for example, in a loop CurrentLoopIteration and OverallLoopDuration cannot be modified.



  • 3.  Re: ERROR : System variables can not be modified.

    Posted Mar 02, 2015 02:41 PM

    Yes,I am not using or trying to modify any system variables. when i am assigning a values to a table in Field set it is giving an error.



  • 4.  Re: ERROR : System variables can not be modified.

    Posted Mar 03, 2015 03:39 AM

    Form.FS1  is First field set .

    Form.FS2 is Second field set.

    Form.FS1.FS2.Table1 is a table.

     

     

    // Error Message: Start //

    Failed to execute code:

    Form.FS1 = Process.FS1;

    Form.FS2 = Process.FS2;

     

    var myarr = [];

     

    for ( var i = 0; i < Process.rows; i++) {

      var myarry = newValueMap();

      myarry.var1 = Process.var1[i];

      myarry.var2 = Process.var2[i];

      myarry.var3 = Process.var3[i];

      myarr.push(myarry);

    }

     

    Form.FS1.FS2.Table1 = myarr;

     

    -- Editing of system variable "Table1" not allowed. (#15)

     

    // Error Message: End//

     

    Below is the preview of IRF.

     

    Untitled picture.png



  • 5.  Re: ERROR : System variables can not be modified.

    Posted Mar 09, 2015 11:51 AM

    Sorry for the delay in my response, but looks like your issue is actually because you are trying to reassign a variable vs replace the contents of the variable.  For example, here is some sample code.  The first one will fail if you run it through jsLint, while the second will pass and is the recommended way of reassigning the contents of your array:

     

    Example 1 -- NOT GOOD --:

     

    if(GetAlertIds.ticketIds.length > 0) {

      var cleanedArray = new Array(GetAlertIds.ticketIds.length);

     

      // Scrape out the 'Handle' part of the ticket id

      for(var i = 0; i < GetAlertIds.ticketIds.length; i++) {

      var andIndex;

      if((andIndex = GetAlertIds.ticketIds[i].indexOf('@')) > -1) {

      cleanedArray[i] = GetAlertIds.ticketIds[i].substring(andIndex + 1);

      }

      }

     

      GetAlertIds.ticketIds = cleanedArray;     // <-- You cannot do this, you are technically re-assigning the ~obj1~ to ~obj2~

    }

     

    Example 2 -- THE PROPER WAY --:

     

    if(GetAlertIds.ticketIds.length > 0) {

      var cleanedArray = new Array(GetAlertIds.ticketIds.length);

     

      // Scrape out the 'Handle' part of the ticket id

      for(var i = 0; i < GetAlertIds.ticketIds.length; i++) {

      var andIndex;

      if((andIndex = GetAlertIds.ticketIds[i].indexOf('@')) > -1) {

      cleanedArray[i] = GetAlertIds.ticketIds[i].substring(andIndex + 1);

      }

      }

     

      Array.prototype.splice.apply(GetAlertIds.ticketIds, [0, cleanedArray.length].concat(cleanedArray));  // <-- Here we replace the contents of ~obj1~ with the contents of ~obj2~

    }

     

    If you use example 2, you should be able to fix your issue.



  • 6.  Re: ERROR : System variables can not be modified.
    Best Answer

    Posted Mar 14, 2015 11:54 PM

    Thanks paimon.soror  for your suggestion,

     

    The actual reason for this error , All the PAM elements inside the Inner Filed Set are declaring as 'System Variables',If  we try to assign or change the variables its giving an error.

     

    Using Parent Field Set , we can reach to Inner Filed Set elements. This helps to avoid this error.

     

    Process.FS1 = Process[OpName].Process.FS1;

     

    // In another IRF Data Initialization

    Form.FS1 = Process.FS1;

     

    Here Process.FS1 (Field Set) contains all the elements.

     

    Thanks,

    Venkat