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

Can a JS value provider set an enumeration list attribute?

Is it possible to use a JavaScript value provider to automatically set an enumeration list attribute with a list of values (calculated according to some conditions)?
I am working with RTC 6.0.3.

0 votes

Comments

Hi Don,
the discussion does not really answer my question.
I need to know ho to set the values a multi-value attribute using a JavaScript value provider.
To set a single-value attribute, the script must return its (scalar) value.
What kind of variable must be returned when the attribute to set is a multi-value list?


Accepted answer

Permanent link

 As Don mentions from the https://jazz.net/wiki/bin/view/Main/AttributeCustomization documentation does state what is supported and list type attributes are mentioned nowhere. I think the list types appeared in RTC after the main JavaScript work was done.


I have never been able to set any list attributes in JavaScript. 

Luca Martinucci selected this answer as the correct answer

0 votes

Comments

Actually, I suspected that JavaScript was not able to set list attributes.
I will write a Java extension, instead.


One other answer

Permanent link

Try to set up a Script Based Value Set. And you need to set the attribute using this value set depend on the "condition"/attribute.
https://jazz.net/wiki/bin/view/Main/AttributeCustomization#Script_Based_Value_Set

0 votes

Comments

Donald, actually I am no trying to set a Value Set.
I am trying to set the values of an attribute, an enumeration list attribute.
If I want to insert 3 values into the attribute, what should I do?
I mean, the js Calculated Value script must return a variable containing the value to set.
For a scalar attribute, it is a scalar variable.
What kind of variable can set  a multi-value attribute?
Perhaps this is not possible using JavaScript, and I should instead write a Java extension using the server-side SDK.

Ah...sorry for misunderstanding your question. Now you reminds me. IIRC I also had a hard time setting a value of an Enumeration List attribute. I tried CSV, JSON and other imaginable formats but all failed. You don't use a variable, the Calculated Value provider returns a "value" directly. I may give it another crack a bit later.

Edit: Have another look at the API spec. Even Enumeration is "limited support", and Enumeration List is not mentioned at all. So I think it's no go for JavaScript.

1 vote

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,952

Question asked: Feb 15 '17, 2:41 p.m.

Question was seen: 2,755 times

Last updated: Feb 16 '17, 4:03 a.m.

Confirmation Cancel Confirm