Forum Discussion
Well message 20, updates and reads the list in the same script.
In our problem statement, we have a data driven groovy script that reads input xmls from a folder. For each xml, we take the payload information in an array/list (script1) which we want to use in script2 for validations with DB2. Since the input xmls will keep changing in this data driven setup, next time when we run script1, the list value is changed, which we now wants to read in script2.
The example in message 2, both changes and reads the values in same script. What we want is,Test.metaClass.myObject = new Expando(list: ['adfd',1,2,3]) in script 1 and log.info new Test().myObject.list in script 2. Later for testing purposes, when i change the value in script 1 of list, I wanted to be able to read it in script 2 with asme log.info new Test().myObject.list.
class Test {
}
Test.metaClass.myObject = new Expando(list: ['adfd',1,2,3])
log.info new Test().myObject.list
Test.metaClass.myObject = new Expando(list:['adfd',1,2,3,'new value'])
log.info new Test().myObject.list
2. from the above message, did not get the outstanding issue.
3. attaching a demo project to reproduce the issue would be helpful if possible.