It's all about the answers!

Ask a question

Changing Attribute size (Medium to Large HTML)


VK L (8177155159) | asked May 21 '12, 5:25 a.m.
Hi All,

Currently we have a requirement - where we are changing the data type of a particular attribute from "Medium HTML" to "Large HTML". So in this case, i think we need to create a new attribute and map it back to the presentation? How can we retain the previous data after the mapping?

Thanks

8 answers



permanent link
Geoffrey Clemm (30.1k33035) | answered May 21 '12, 2:13 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
You could use the work item API to write your own little "upgrade" program, but it of course would be better if there were a way to do this without writing code. Unless someone else comes up with a suggestion, it would be worth submitting this as an Enhancement work item on jazz.net.

Cheers,
Geoff

Hi All,

Currently we have a requirement - where we are changing the data type of a particular attribute from "Medium HTML" to "Large HTML". So in this case, i think we need to create a new attribute and map it back to the presentation? How can we retain the previous data after the mapping?

Thanks

permanent link
Gabriel Enriquez (3463) | answered May 21 '12, 2:47 p.m.
JAZZ DEVELOPER
Here is a suggestion:

1. Create the new custom attribute (Large HTML).
2. Create a new presentation mapped to the new attribute.
3. On the deprecated attribute presentation (Medium HTML), check the "Hide if Empty", to avoid showing it in the "new" work items.

--Gabriel Enriquez, IBM Rational, Jazz Tracking & Planning

permanent link
VK L (8177155159) | answered May 23 '12, 11:08 p.m.
Hi Gabriel,
The only problem doing it this way would be:
Existing WorkItems cannot be updated with a large text. -> since they will have the old attribute in their presentation.

I could not find the synchronize attributes option - i am using 3.0.1.1

Thanks.

permanent link
Millard Ellingsworth (2.5k12431) | answered May 24 '12, 1:25 a.m.
FORUM ADMINISTRATOR / JAZZ DEVELOPER
Hi Gabriel,
The only problem doing it this way would be:
Existing WorkItems cannot be updated with a large text. -> since they will have the old attribute in their presentation.

I could not find the synchronize attributes option - i am using 3.0.1.1


Synchronize Attributes is available from the context menu if and only if you bring it up from the Type column (which is unlabeled but has the type icon in it) -- usually the first column of the query results).

Actually I think Gabe's suggestion (unless I misunderstand it) works fine from a display perspective. You add the new attribute and create a presentation for it on the work item type. You synch it to all relevant items.

When you bring up an "old" item with the old attribute that has data, you see both -- the old attribute and its data and the new, empty attribute. If you don't want the old attribute to be changed anymore, you can mark it read-only. And so that the old attribute isn't used in the future, mark it as "Hide if Empty" so that it can't be used on newly created items or items that didn't use it before. That way if the data needs to be added to an "old" item, it will go into the new attribute.

As to the read-onlyness of the old attribute, if someone really needs to change the value on an old item, they could copy the old attribute to the new one and make changes there (painful if it would likely happen often -- if that's the case, read-only might not be such a good idea, at first).

Over time, the "old" style will die away as those work items are closed. The main drawback is that if you query on this attribute, you'll need to query on both the old and new attributes for the same value in order to retrieve items from before and after the change.

permanent link
VK L (8177155159) | answered May 24 '12, 2:08 a.m.
Thanks Millarde. It works from the first column of query result.
As for maintaining same data in both the attributes, i have considered the below option:
1. create a new attribute - of type large html, and add it to presentation as well.
2. export workitems. copy all the data from the old attribute to the new attribute.
3. Import the workitems.
4. Delete the old attribute.

This way, only the new attribute is maintained in both the old and new items.

permanent link
Geoffrey Clemm (30.1k33035) | answered May 30 '12, 4:48 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
I believe I've run a better way to do this than my previous suggestion. I've only had a chance to do a simple test in RTC-4.0, so this may not work in releases before RTC-4.0 (but I'm guessing it does).

In particular, the trick is to use process inheritance.
I created two parent process areas: PPA1 and PPA2. In PPA1 I have a custom property with ID &quot;xyz&quot; and type &quot;large-string&quot; , while in PPA2, I have the custom property with ID &quot;xyz&quot; and type &quot;large-html&quot;. I created a child project area, PACHILD, and had it share process from PPA1. I then created a work item with the xyz property with value &quot;<b>value</b>&quot;. When I look at the work item in the webUI, I just see that string. If I then change PACHILD to share process from PPA2, and then look at that work item in the webUI, I then see the string &quot;value&quot;. (i.e. I see it as an html attribute).

So, it looks like process inheritance gives us a way to change the type of an existing property.

But what if you aren't using process inheritance?

That involves more work, but the basic idea is to:
- create a template from your existing project area
- instantiate that template to create a new master project area.
- clear out the processs of your existing project area (by editing the process source directly)
- make your existing project area share the process of the new master project area.

Then when you need to change the type of a string attribute, use the above process to create a new master project area that is a clone of the existing one, make the desired change to the new master project area, and then change the existing project area to share its process from the new master project area.

Cheers,
Geoff

Hi All,

Currently we have a requirement - where we are changing the data type of a particular attribute from &quot;Medium HTML&quot; to &quot;Large HTML&quot;. So in this case, i think we need to create a new attribute and map it back to the presentation? How can we retain the previous data after the mapping?

Thanks

Comments
Joel Lonneker commented Jul 24 '13, 1:53 p.m.

Thanks for this response, Geoff!


My scenario is similar in that we have Medium String attributes in Text fields that we need to update to Medium HTML attributes in SmallHTML fields. (For purposes of Tasktop syncing to/from RTC 4.0.2)

I was able to:
1 Export current process template to a deployment template
2 Alter the offending attributes from Medium String to Medium HTML
-- This retains ID as well as existing field data
3 Alter the offending fields from Text to SmallHTML type
- (testing shortcut) copy XML source from deployment template and overlay it in the current process template
-- Proper use is likely to deploy this template by creating a new project area and then sharing its processes with the existing project area.
--- Note: Have yet to experience issues in testing with copy/paste of xml
4 Sync attributes on existing work items
5 Reload existing work item and find my fields display existing data in SmallHTML field.

Cheers,
Joel Lonneker


Joel Lonneker commented Jul 24 '13, 2:25 p.m.
 Update on the following:

3 Alter the offending fields from Text to SmallHTML type
- (testing shortcut) copy XML source from deployment template and overlay it in the current process template
-- Proper use is likely to deploy this template by creating a new project area and then sharing its processes with the existing project area.
--- Note: Have yet to experience issues in testing with copy/paste of xml

Found an issue with the copy/paste XML method.  After completing the paste operation in the existing parent/source project area there were warnings in the Editor Presentations where by it thought the attribute behind the field was still a medium string (was a superficial warning, but in treating warnings as errors, discontinued this practice).  Deploying a new project area as a parent/source project area works like a charm, however.

Cheers,
Joel Lonneker

Dave Evans commented Feb 12 '14, 12:35 p.m.

I do not believe this method of tricking attribute types to change works. It appears that attribute facts may be stored in the repository, and no method of trickery from XML modifications can cause an existing project's work items to change. Though you could probably move existing work items into the new PA and get a new type, I do not believe existing work items will get an update. I am using 4.0.5 and have attempted to use the suggestions above many times to no avail. The new PPA, along with any Child PAs which did not previously have any work items get the new attribute type. But any Child PA with existing work items using the old attribute type are NOT changed. Running 'Check Attribute Usage' does nothing to remedy the situation.


permanent link
Geoffrey Clemm (30.1k33035) | answered May 30 '12, 5:10 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Note: This functionality was requested in work item 180112. Please feel free to add a comment in that work item to indicate your interest/support.

Cheers,
Geoff

Hi All,

Currently we have a requirement - where we are changing the data type of a particular attribute from &quot;Medium HTML&quot; to &quot;Large HTML&quot;. So in this case, i think we need to create a new attribute and map it back to the presentation? How can we retain the previous data after the mapping?

Thanks

permanent link
kavita herur (5876593) | answered May 03 '13, 2:17 a.m.

I agree with above solution only for making "Large String" to "Large Html" but If I want to increase size of data type  like "medium Html" to "Large Html" in that case it wont work.

Your answer


Register or 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.