IBM Support

PM79183: 'for linkModDesc in fTmpFolder do{' is unable to loop through more than 2 link module descriptors

Subscribe

You can track all active APARs for this component.

APAR status

  • Closed as program error.

Error description

  • 'for linkModDesc in fTmpFolder do{' is unable to loop through
    more than 2 link module descriptors
    
    Problem Description:
    
    If we have multiple link modules and more than 3 modules then
    the below script throws Diagnostic log error. (Refer to the
    Screenshot)
    
    Steps to reproduce:
    
    - Create a folder
    - Created 3 modules A,B and C
    - Create 3 link module descriptors in the folder with
    - Select any 2 link module descriptors, create linkset pairing
    from A to B , B to A and A to C
    - Run the following Script:
    
    ================
    // Example for ' for link module descriptor in folder' loop not
    works correctly at all cases
    // Folder: /99 - Sandbox/lg project
    // Source Module: /99 - Sandbox/lg project/xxx_lg have 2 defined
    linksets
    // see output
    
    string sSrc
    string sTgt
    Module mSrc
    Module mTgt
    Object oSrc
    Object oTgt
    string sLMD
    LinkModuleDescriptor linkModDesc
    
    Folder fTmpFolder
    Item it = getSelectedItem()
    if(type(it) == 'Folder')
    {
      fTmpFolder = folder(it)
      for linkModDesc in fTmpFolder do
      {
        sLMD = getName(linkModDesc)
        print('name lmd: ' sLMD '\n')
        sSrc = getSourceName(linkModDesc)
        sTgt = getTargetName(linkModDesc)
        if(null(sSrc) || null(sTgt))
        {
          print('null name\n')
          halt
        }
        print('src: ' sSrc '\ntgt: ' sTgt '\n')
        mTgt = read(sTgt, false) //open target module in read mode
        mSrc = edit(sSrc, false) //open src module in edit mode
        if(!null(mTgt) ?? !null(mSrc))
        {
          oSrc = current(mSrc) // *** only simple for the example,
    all modules must have objects at the example
          oTgt = current(mTgt)
          // oSrc -? oTgt
          oSrc -? sLMD -? oTgt // *** less crashes by using 'link
    module name'
          print(oSrc.'Absolute Number' ' -? ' oTgt.'Absolute Number'
    '\n')
          save(mSrc)
        }
        close(mTgt, false)
        close(mSrc, false)
      }
    }
    ======================
    
    Observation:
    
    - The script is failing because it not able to loop through the
    for loop:
    'for linkModDesc in fTmpFolder do{'
    
    - The problem is intermittent and I was not able to reproduce it
    consistently.
    
    - The scenario where I got the error was when you have more than
    2 module and more than 2 link module.
    

Local fix

Problem summary

  • ****************************************************************
    * USERS AFFECTED:                                              *
    ****************************************************************
    * PROBLEM DESCRIPTION:                                         *
    ****************************************************************
    * RECOMMENDATION:                                              *
    ****************************************************************
    'for linkModDesc in fTmpFolder do{' is unable to loop
    through more than 2 link module descriptors
    
    Problem Description:
    
    If we have multiple link modules and more than 3 modules
    then the below script throws Diagnostic log error. (Refer to
    the Screenshot)
    
    Steps to reproduce:
    
    - Create a folder
    - Created 3 modules A,B and C
    - Create 3 link module descriptors in the folder with
    - Select any 2 link module descriptors, create linkset
    pairing from A to B , B to A and A to C
    - Run the following Script:
    
    ================
    // Example for " for link module descriptor in folder" loop
    not works correctly at all cases
    // Folder: /99 - Sandbox/lg project
    // Source Module: /99 - Sandbox/lg project/xxx_lg have 2
    defined linksets
    // see output
    
    string sSrc
    string sTgt
    Module mSrc
    Module mTgt
    Object oSrc
    Object oTgt
    string sLMD
    LinkModuleDescriptor linkModDesc
    
    Folder fTmpFolder
    Item it = getSelectedItem()
    if(type(it) == "Folder")
    {
      fTmpFolder = folder(it)
      for linkModDesc in fTmpFolder do
      {
        sLMD = getName(linkModDesc)
        print("name lmd: " sLMD "\n")
        sSrc = getSourceName(linkModDesc)
        sTgt = getTargetName(linkModDesc)
        if(null(sSrc) || null(sTgt))
        {
          print("null name\n")
          halt
        }
        print("src: " sSrc "\ntgt: " sTgt "\n")
        mTgt = read(sTgt, false) //open target module in read
    mode
        mSrc = edit(sSrc, false) //open src module in edit mode
        if(!null(mTgt) ?? !null(mSrc))
        {
          oSrc = current(mSrc) // *** only simple for the
    example, all modules must have objects at the example
          oTgt = current(mTgt)
          // oSrc -? oTgt
          oSrc -? sLMD -? oTgt // *** less crashes by using
    "link module name"
          print(oSrc."Absolute Number" " -? " oTgt."Absolute
    Number" "\n")
          save(mSrc)
        }
        close(mTgt, false)
        close(mSrc, false)
      }
    }
    ======================
    
    Observation:
    
    - The script is failing because it not able to loop through
    the for loop:
    'for linkModDesc in fTmpFolder do{'
    
    - The problem is intermittent and I was not able to
    reproduce it consistently.
    
    - The scenario where I got the error was when you have more
    than 2 module and more than 2 link module.
    

Problem conclusion

  • The code has been changed so that this issue no longer
    occurs.
    

Temporary fix

Comments

APAR Information

  • APAR number

    PM79183

  • Reported component name

    TLOGIC DOORS

  • Reported component ID

    5724V61DR

  • Reported release

    930

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2012-12-14

  • Closed date

    2014-03-03

  • Last modified date

    2014-03-03

  • APAR is sysrouted FROM one or more of the following:

  • APAR is sysrouted TO one or more of the following:

Fix information

  • Fixed component name

    TLOGIC DOORS

  • Fixed component ID

    5724V61DR

Applicable component levels

  • R930 PSN

       UP



Document information

More support for: Rational DOORS

Software version: 9.3

Reference #: PM79183

Modified date: 03 March 2014