It's all about the answers!

Ask a question

where xml file of project area is located in rational team concert.


Parveen Patel (771427) | asked Jan 09 '15, 6:12 a.m.
Hi,
    I have just started to extend rational team concert.I am currently trying to develop plugin for follow up action for operation save work item, In that I want an XML structure containing all of the work item attribute values as they exist in the database after the save.

Any advice would be much appreciated, very stuck at this stage.

Thanks in advance.

Accepted answer


permanent link
sam detweiler (12.5k6195201) | answered Jan 09 '15, 6:29 a.m.
could you explain a little more please..  not quite sure what you want.

the project XML does not have any VALUES of the attributes.
in the followup extension, you can get the CURRENT values (they were saved just before the extension was called). but you do not have an XML  structure, just the attributes, their values, and the attribute type (object). from that you could construct an xml document.

you can get the project XML from the project area
you can see code to get the xml structure here
https://jazz.net/forum/questions/159700/is-it-possible-to-migrate-an-rtc-project-area-to-a-different-process-parent-programmatically
in the accepted answer
                    // get the process data
                    @SuppressWarnings("unchecked")
                    Map<object, Object=""> pd = ip.getProcessData();

                    // get the content Manager
                    IContentManager icm = repo.contentManager();
                    // get the process config content object
                    IContent processSource = (IContent) pd.get(keyname);
                    if (processSource != null)
                    {
                        System.out.println("have xml source");
                        saveXMLSource(ip, processSource, icm, sPm);
                    }                   
Parveen Patel selected this answer as the correct answer

Comments
Parveen Patel commented Jan 09 '15, 6:46 a.m.

Hi Sam,
           Thanks for your response,I want to retrieve work item attribute values during work item save operation and want to add that attribute values in xml format in  log file which i have created.
How I can achieve this.



sam detweiler commented Jan 09 '15, 7:05 a.m.

you would have to loop thru all the attributes and build your xml doc..
the workitem is the NewState

the accepted answer here https://jazz.net/forum/questions/94776/assertionfailedexception-problem-with-getting-the-values-of-attributes has code that shows how to loop thru all the attributes of a workitem and get their types and values (most of them)

see
static void printAttributes(IWorkItem workItem, 

// loop thru all the workitem attributes in the project
            for (IAttribute ia : workItemCommon.findAttributes(projectArea,
                    monitor))
            {

                // if this workitem has this attribute and
                // its NOT an internal use attribute
                if (workItem.hasAttribute(ia) && !ia.isInternal())

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.