How to extend workitem to store additional data consisting of many key/value pairs java api
The additional information consists of the up to 10 different key/value pairs . i think it would look clumsy adding them as custom attributes but I want to store them and have them available to users for review and or be able to programmatically retrive them later in another part of my project .
I also need to be able to store those key value pairs programmatically via the java api
Is this possible ? May be using workitem extensions? Not sure how/where to begin
Please advise
Thanks
2 answers
Comments
Valli,
Well it would be constant in that we have a total of 8keys( and scores). Each workitem will store a max of 4 keys/value pairs but those 4 keys will be a subset of the 8. I hope I am not confusing you but basically we need to create 8keys . The keys strings will remain constant
Each work item will store only 4 keys and value pair
For now I am sort of showing all the 4 keys and values(8 fields in all ) for each workitem and display it in the default presentation and itr looks really clumsy ...
I have something like this
Firstkeyname
Firstscore
SecondKeyname
Secondscore .....
I want to be able to link to it , store it and programmatically retrieve it in a nicer manner .
Any ideas?
you can choose to display it in a
Valli,
Thanks for your response . The choices are not exactly clear to me . Here are a few notes.
The most important factor is that I need to be able to programmatically store the keys/value pairs with the workitem and later to be able to retrieve them programmatically. Each work item will have 4 of 8 possible keys and each for any work item will have its own hvalue
Concerning your mentioned options
1. Will using a different tab still keep it attached to the workitem ? Are you saying just add a new tab/section for the presentation and simply have users tab over to see the scores?
Options 2 interesting and clean but will each key(relevant to the specific workitem) have its own value? When I click for more details, does it take me to another page/tab?
Any links to start investigating this ? I am fairly new to JAZZ/RTC
Comments
Yes, I am no 4.0.0.1 . Stringlist attribute? I have used enumeration but not stringlist . Will investigate . Up till now(your comments) ,, my best option looked like putting the various key/values on a separate tab , per earlier comments,
Any link to the encoding activities ? That sounds interesting and I do need it for password that I may be storing also so it would be handy
Thanks for any input
With encoding, I mean storing it as a string. You can usually do that. As URL, whatever. Serialized it. With respect to the presentation, you can put it on a separate tab and potentially make it read only in the UI. It is possible to add own value providers and representations. It is also possible to extend the storage service. I would advise against it.
Ralph,
For now I will avoid value providers . I just need to store and retrieve pro-grammatically. I will testing now with supplying separate field for each value and each key. Not ideal but will see how far I can get with it
I have attached a screen shot of adding them to separate tab. Thanks
If you want to avoid one attribute for each key, use a string list and encode the entries for example as D4_FIRSTCLASSIFIER=<value> where <value> is the data to store. It is easy enough to get the value list of the attribute and manage the data in an extension or Plain Java Client.
Ralph,
Thanks , I am not quite getting your explanation but I will review the stringlist type further and see how it fits .Or Are you saying each workitem will have a stringlist of the 4 classifier keys ( out of 8 ) and the values will just be the scores? My confusion is should I have defined/listed all 8 possible keys before I called them or I can just go ahead and add a stringlist attribute to the workitem and that should accommodate the keys/.values.
Note that D4_FIRSTCLASSIFIER,etc are just the labels to hold the key name. Then D4_FIRSTCLASSIFIERSCORE will hold the actual value
Sound like I just need to know how to use the stringlist
Mark, in 4.x you can define one attribute to contain a list of strings. The strings stored in the attribute are accessible as a list in Java. Each string can contain arbitrary strings. So you can stuff as many as you want in there. Since the value is not enough in your case you would store the identifier and the value in one string and you will have to split the string later into its parts, to be able to interpret it.