It's all about the answers!

Ask a question

Using RTC Work Item Encapsulation To Replace instead of Inserting a field?


Joel Lonneker (391016) | asked Dec 03 '15, 6:22 p.m.
 With this short snippit of xml I can insert a field in to a child project area while allowing it to consume the other 99% of the shared fields defined in the parent (master) project area: (Note that this is the entire XML for a new child project area with encapsulation)
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2010 IBM Corporation. All rights reserved.
This file is part of a process template created for use with the Jazz Process Framework.
Your use of the process template (and hence this file) is subject to the following terms and conditions found in the process attachment named process_template_license.html.
-->
<process-specification xmlns="http://com.ibm.team.process">
<project-configuration>
<data>
     <configuration-data-delta configuration-data-id="com.ibm.team.workitem.editor.configuration.presentations">
          <add-element>
               <path> 
                    <section id="com.ibm.team.workitem.section.FutureRight">
                         <presentation attributeId="com.ibm.team.lmac.workitem.attribute.workaround">
                          </presentation>
                    </section>
               </path>
               <addition location="before">
          <presentation attributeId="com.ibm.team.lmac.workitem.attribute.DomainWorkaround" kind="com.ibm.team.workitem.kind.enumeration" />
               </addition>

          </add-element> 
     </configuration-data-delta>
</data>
</project-configuration>
     <team-configuration>
     </team-configuration>
</process-specification>

What this does to the local project area is inject a field (domainWorkaround) above the Workarounds text box that is shared with all of our other projects.  I wish to not insert before but replace the Workaround field with the DomainWorkaround field for this one project area where I am encapsulating.  Any thoughts that might help here?

I can only find options for:
               <addition> and <path>
Which allow for <addition location="before/after/first-child/last-child"> or <addition merge-depth="0/1/2/3/4/unlimited".  
I do not find any options for <path> as it directs to the point in the form for insertion.

Any thoughts as to whether I can replace an existing field using this encapsulation format instead of simply inserting around?

Accepted answer


permanent link
Donald Nong (14.5k614) | answered Dec 03 '15, 10:31 p.m.
I don't think you can do it. To remove the "Workaround" text box from the editor, there would have been several options - remove the field directly from the editor, hide the field, and duplicate an entire section but without the "Workaround" field. But, the hope was dashed when I tried to make it work.

Firstly, "remove" is not supported.
https://jazz.net/wiki/bin/view/Main/ConfigurationDataDeltaExamples#Remove_field_from_editor_not_imp

And it turned out "modify" is not supported for "com.ibm.team.workitem.editor.configuration.presentations" as well. This is the error that I got when trying with the second and third options.
CRRTC0324E The following configuration-data-delta section could not be validated: com.ibm.team.workitem.editor.configuration.presentations. Using a delta to modify child elements in <configuration-data id = "com.ibm.team.workitem.editor.configuration.presentations"> is not supported at this time.

My testing was done in RTC 5.0.2.
Joel Lonneker selected this answer as the correct answer

Comments
Joel Lonneker commented Dec 04 '15, 12:40 p.m.

 Fantastic!  I took from your "remove" example and implemented a <remove-element> section and it worked.  Due to character limit of a reply, here is what I added above <add-element>:

<remove-element>
      <path>
        <section id="com.ibm.team.workitem.section.FutureRight">
                         <presentation attributeId="com.ibm.team.lmac.workitem.attribute.workaround">
                          </presentation>
</section>
</path>
</remove-element>





Donald Nong commented Dec 06 '15, 5:53 p.m.

That's interesting! When I saw the unsupported statement, I didn't even think of giving it a try. Persistence and determination are always rewarded. :-)

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.