Welcome Serena Central users! CLICK HERE
The migration of the Serena Central community is currently underway. Be sure to read THIS MESSAGE to get your new login set up to access your account.
jkfellin
New Member.
56 views

export multi-instance scriptlet counters

I have a multi-instance flow to verify ssh connections, on failure I need to count the different type of hosts. Host type is retrieved from a database and has 4 different values. I'm using scriptlet code to count the different types by this

flag = new java.lang.String (scriptletContext.get('dbflag');

if (flag.equals('type1') {

    aNumber = scriptletContext.get('cnt_t1');

    if (aNumber != null)

         aNumber++;

  else

        aNumber = 1;

    scriptletContext.put('cnt_t1', aNumber.toString());

} else if (flag.equals('type2') ...

 

My problem is I'm not able to get the local flow variables cnt_t1, cnt_t2,.. to the environment outside the multi-instance.

 

I found some documentation in HPOO studio guide that suggested a scriptlet in the multi-instance step to do

v = scriptletContext.get('cnt_t1');

scriptletContext.putGlobal('all_t1', scriptletContext.get('all_t1') + v);

 

However the global flow variable is not incremented, and has it's initial value.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.