Topic
  • 2 replies
  • Latest Post - ‏2013-11-07T14:38:25Z by Bcam
Bcam
Bcam
6 Posts

Pinned topic Change properties of an object in another script

‏2013-10-30T20:20:04Z |

I'm using IBM ITCL framework where I have object map scripts, task scripts and a test scripts.  I need to create a method in a task script to change the property of an object in the object map script at run time.  My method looks like this:

public void setObjectProperty(String objName, String propName, int propValue, int propWeight)
{
    SpyMappedTestObject smto = getMappedTestObject(objName);
    smto.setProperty(propName, propValue, propWeight);

}

My question is how do I pass objName to the method because the task script does not have any objects in its object map (the objects are in the object map script which I declare in the task script).  I tried to pass the objName as objScript.getObjName() but that didn't work.  Is there another way to change the property of an object in another script?  I read in the forum that I may be able to make it work by changing the access to public in the SuperHelper class but I want to see if there's another way first.

 
  • cagin.uludamar
    cagin.uludamar
    66 Posts

    Re: Change properties of an object in another script

    ‏2013-11-07T11:56:32Z  

    Hi, why don't you create that method in the object map script?

  • Bcam
    Bcam
    6 Posts

    Re: Change properties of an object in another script

    ‏2013-11-07T14:38:25Z  

    Hi, why don't you create that method in the object map script?

    That's an idea I didn't think about.  I thought about adding the objects to the task script instead.  But then I thought that would violate the principle of the framework which is keeping the objects and tasks separate?  In addition, later on if I add new objects to the map and I run the Getter script, it deletes everything in the object map script.