77 views

Description

 If both Discovery and Orchestration have synchronized versions of the Credentials.psm1 file existing in different paths, any attempt by either application to update their version of the file results in a duplicate file error.

The business rule "Prevent Duplicate,Spaces & Colon in name" is intended to prevent duplicate filenames, so that synchronized MID Server script files won't overwrite each other. However, the business rule incorrectly compares the file names only and does not recognize that the two script files have different paths.

Steps to Reproduce

  1. Synchronize the Credentials.psm1 file for both Discovery and Orchestration in different paths.
  2. Try to update the Credentials.psm1 for either of the applications.
  3. Note the duplicate file name error.
        For more information, see the Credentials.psm1 section in the product documentation topic MID Server PowerShell files.

Workaround

Use one of the following workarounds:

  • Disable (perhaps temporarily) the "Prevent Duplicate,Spaces & Colon in name" business rule.

  • Update the business rule to evaluate both the path and the file name by replacing lines 29 to 32 of the business rule with the following code:

    while(gr.next()){
      var path1 = getPath(current, 0);
      var path2 = getPath(gr, 0);
      if(path1==path2){
        current.setAbortAction(true);
        gs.addErrorMessage(gs.getMessage("Duplicate file name with same path is not allowed "));
      }
    } 
    function getPath(scriptRecord, level) {
      var parentField = "parent";
      for(var i=0;i<level;i++){
        parentField = parentField + ".parent";
      }
      var parent = scriptRecord.getDisplayValue(parentField);
      var path = "";
      if(parent){
        path = getPath(scriptRecord,++level)+"/"+parent;
      }
      return path;
    }

Related Problem: PRB934605

Seen In

There is no data to report.

Associated Community Threads

There is no data to report.

Article Information

Last Updated:2017-10-25 11:40:21
Published:2017-10-25