Questions RE: Behavior of Custom Providers in RTC 3.0?
I've become more acquainted with the various value providers in my RTC 3.0 beta (RC0).
https://jazz.net/wiki/bin/view/Main/AttributeValueProviders I've done a simple default provider, managed to get a sample value SET provider for a couple of custom enumerations (via the Process Config UI), and have a sample simple-type calculated value custom provider in javaScript (with the "dojo" structure). I have a couple of questions. First, I noticed that in the samples in the doc regarding the calculated value (valueProvider - javaScript), the provider configuration included custom configuration properties. Specifically, in the Risk Exposure sample, there are the impactAttribute and probabilityAttribute properties. I'm confused on the intended use of these. When I try to define these in my own sample, I cannot seem to properly reference them via configuration.getChild in my javaScript. Why is that? What exactly are the configuration methods supposed to return? It isnt clear to me. I set up my dependsOn and custom properties to custom attributes. I am seeing an "object", or undefined or null references. So I have to hard-code a reference to the ID of a custom attribute in my basic-type (string) calculated value javaScript. That gets me by for basic string types. My sample provider:
========== This brings me to my 2nd question. How can I use the calculated value custom provider for custom enumeration attributes? I know there is the ValueSetProvider, which can filter a set of enumeration choices. However, that does not automatically "select" a choice. I need to keep all choices possible, but select 1 of them based on a selection in another enumeration. Again, I have been attempting to define custom Provider config properties to reference the enumeration attributes, but the configuration.getChild or getString wont provide anything I can use within the custom provider javaScript. In this case, I think I even tried hard-coding the reference IDs, and still could not reference these attributes or changed values. Non-working sample with what I've tried so far -
|
5 answers
I am also interested in these questions. Anyone have any answers?
|
I have been told this should work in RTC 3.0 (GA), and that the doc may be out of sync. I opened defect 149859 to address this.
http://jazz.net/jazz/web/projects/Rational%20Team%20Concert#action=com.ibm.team.workitem.viewWorkItem&id=149859 |
Dear stawick,
I am trying to write a script to compute the value from multiple attribute and putting in to another attribute using calculated value option. But I am not succeed in that. If you have any such kind of script which will help me to complete my task, please share with me(sachin.nairy@gmail.com) Thanks in advance I've become more acquainted with the various value providers in my RTC 3.0 beta (RC0). |
Hi Friends,
I had created few custom attribute (integer type)in RTC work item form. I want to add ( arithmetic operation) those values using java script(calculated value option). dojo.provide("total"); var WorkItemAttributes= com.ibm.team.workitem.api.common.WorkItemAttributes; ( function() { dojo.declare("total", null, {getValue: function(attribute, workItem, configuration) { var i1=workItem.getValue(item1); var i2=workItem.getValue(item2); var i3=workItem.getValue(item3); i3=i1+i2; return i3; } } ); } ) (); This code is not working for me. I went through couple of link, but nothing is working for me. Please help me to resolve this issue. https://jazz.net/wiki/bin/view/Main/AttributeCustomization#Configuring_a_script_based_custo |
I'm not a jazz or RTC developer, just a somewhat experienced user now. Our scripts have changed quite a bit since the initial post and wont mean much here.
The first thing you may want to check is - From RTC wiki doc -
You also have to load your script into the Links section (Attachments) of your project area (or template). Although that is probably the same thing as the Reload button in the Calculated Value section of the Process Configuration.You also need to specify the path as - /workitem/scripts/common/your-script.js If you need to reference built-in work item attributes utilizing the WorkItemAttributes, you'll need to add a -
However, you shouldnt need that for customized attributes. The workItem.getValue(item*) references should refer to the attribute IDs (ie itemX = the ID for attribute itemX). You may hard code them in the script, or use configuration sub-elements of your provider (as we now do for reuse of script function), in which case you'll use the configuration.getChild calls. You'll need to add your calculated value provider to your resulting attrbute's definition. This is so that the "return i3" sets the value for that attribute.
Also, you'll want to add a dependsOn for each of the deriving attributes, so that a change will trigger a recalculation. That is about all of the advice I can offer. We havent used this for integers ourselves - just strings and enumerations so far. Hi Friends, |
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.