Copy CCM process template changes to all project
One answer
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]
[/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 ...
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.
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.
Comments
Ralph Schoon
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Aug 24 '21, 2:50 a.m.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.