Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Copy CCM process template changes to all project

We have 500 ccm projects. Some of the projects don't refer to a shared process template.

New Precondition is added the template project. How to programmatically implement those changes in all projects, particularly to the projects that don't use shared process template.

0 votes

Comments

 I am not aware of anything. Technically it might be possible to manipulate the process XML using the internal rich client platform or even using some Plain Java Client Libraries, but all the discussions I remember, suggested that to not really be supported. I would suggest to approach support. I think there should be some kind of automation capability to do this. 



One answer

Permanent link

Hi, I have a similar problem also I found this in the various open links:
[code]

// get it
IProjectArea project = (IProjectArea) (repo.itemManager().fetchCompleteItem(iparenthandle,IItemManager.DEFAULT, sPm));
System.out.println("have parent project name = "+ project.getName());
// get the process data
@SuppressWarnings("unchecked")
Map<string, object=""> pd = ip.getProcessData();
////  here is the xml extract
// 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);
}                
[/code]
Unfortunately, however, there is also the saveXmlSource method, it is not described or at least I have not found it ...
If I can tell you, however, "massive" changes to the aforementioned file, even manually, are often counterproductive, so I would advise you, in my knowledge which is few, to change your approach if you can ...

1 vote

Comments
Note that being able to automate something could also mean to accidentally destroy many things. Excessive testing and backup etc are obvious.

Manipulating your process configuration can render your process broken. This could be subtile, so you might not recognize it immediately.

The missing code looks like this. Don't tell anyone I provided it.


    // save the process source for the project
    /*
     * @param ip
     * @param ic
     * @param icm
     * @param name
     * @param monitor
     /
    private static void saveXMLSource(IProjectArea ip, IContent ic, IContentManager icm, String name,
            IProgressMonitor monitor) {
        // make an output stream for the content manager
        OutputStream os = new ByteArrayOutputStream();
        // get the content of the content object.
        try {
            icm.retrieveContent(ic, os, null);

        // write xml content to file
        // project name + data name
        FileOutputStream fo = new FileOutputStream(ip.getName() + name + "." + "xml");
        // write
        fo.write(os.toString().getBytes(), 0, os.toString().length());
        // close
        fo.close();
    } catch (Exception e) {
        e.printStackTrace();
    }
}
</pre>

 Thank you very much, I immediately get down to the studio.

Good evening and sorry for the delay.
I used your method and I have been successful but unfortunately it is not useful for the purpose even if I use it to make a backup copy of the same in "local" so at least if you need it you always have a backup ready to use.
I thought that the js were "traceable" also by the processConfiguration but unfortunately this is not the case for those but I found the solution as I wrote to you .... So thank you very much as always you are always a great help, I hope I can help someone too 'other with all my doubts.

Your answer

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

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,938

Question asked: Aug 24 '21, 2:15 a.m.

Question was seen: 1,403 times

Last updated: Sep 07 '21, 7:23 a.m.

Confirmation Cancel Confirm