Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

[PUB] Does RPE Studio supports ArrayList, HashMap (Collections)

 Hello Team,


 I have a use case probably it can be solved in different way. 
  • Does RPE Studio supports List, Map ... ?

 Use Case :
 
 Assume for a requirement , it can be linked to multiple test cases using validated by Link. But while printing I have to print in a different way. 
My starting point of retrieving / printing is Doors Next Generation 
  • Test Case ID     Test Summary      Requirement ID      Requirement Summary 
Could you please support if any alternate solution?

Regards,
Chandan

0 votes


Accepted answer

Permanent link
Yes. Most of the standard Java classes can be used inside the java script. The following will work fine in RPE template:


//ElementsList and TypesMap are template variable
if (ElementsList == null || ElementsList == ""){
    ElementsList = new java.util.ArrayList();
}

TypesMap = new java.util.HashMap();
TypesMap.put("Type1", new java.util.ArrayList());
var val = TypesMap.get("Type1");

Chandan M B selected this answer as the correct answer

0 votes

Comments

Thanks Prasad.

From which RPE version it is supported ?
Could you please confirm that ?

I have tried it in 7.0.2. You can try in RPE 6.0.6.1 as well.


2 other answers

Permanent link

javascript des not support ArrayList or HashMap.

json data structure is an option.

0 votes


Permanent link

 You can use array of objects.


var obj = new Object();
obj['name'] = 'Tom';
obj['surname'] = 'Smith';
var array = [];
array.push(obj);

0 votes

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,927

Question asked: Aug 02 '21, 1:07 a.m.

Question was seen: 1,204 times

Last updated: Aug 20 '21, 1:53 a.m.

Confirmation Cancel Confirm