How to modify process XML in a process configuration aspect editor
![]()
We're implementing a process configuration aspect editor and need to change process configuration XML outside of the configuration element associated with the aspect. We can call getAspect().getConfigurationRoot() to get the root of the process configuration XML and then search the process configuration XML to find the XML element(s) that we need to modify. The problem is that getAspect().getConfigurationRoot() returns a ModelElement, which doesn't have any modification methods. So, how do we modify and save the process configuration XML once we've found the ModelElement(s) we want to modify?
|
3 answers
![]()
As you mentioned the Model returned from getAspect().getConfigurationRoot() returns a model that is not writable. Configuration data editors update the process specification by calling getAspect().update(), passing in the source of the XML for the model. The typical aspect editor for configuration data will call getAspect().getConfigurationRoot() to get the configuration data and convert that data into a data structure which is easier for the editor to work. When it comes time to save the modified data the data is written out in XML format and passed to getAspect().update().
One consequence of this design is that it is not easy for a configuration data editor to make modifications outside of the configuration data associated with the aspect. It is possible for aspect editors to cooperate with one another, for example the aspect editors used in work items share the same underlying data so that when you add an entry in types and attributes that type becomes available in the Editor Presentations tab. We don't however encourage a configuration data editor to make changes to other sections of the process specification such as permissions or roles.
Comments Moved to an separate answer due 1200 character limitation in comments.
Chris, thanks for your answer. I have a couple follow up questions:
1. I'm pretty sure that getAspect().update() requires you to supply xml for the complete configuration-data section, not just the part you changed,
2. I'll take a look at the source of the work items configuration data editors and see what they are doing.
Chris, I'm confused by your answer to question 1. In your original answer, you said
The typical aspect editor for configuration data will call getAspect().getConfigurationRoot() to get the configuration data and convert that data into a data structure which is easier for the editor to work. When it comes time to save the modified data the data is written out in XML format and passed to getAspect().update().I read that to mean that getAspect().update() could update the entire process model since you said the typical use is to pass getAspect().update() updated XML derived from the full process model, that is from getAspect().getConfigurationRoot(). But in your answer to question 1, you say getAspect().update() requires you to supply xml for the complete configuration-data section, not just the part you changedwhich implies that getAspect().update() can only update the configuration data associated with the aspect. So, can getAspect().update() parts of the process model outside of the configuration data associated with the aspect? Or is it limited to just the configuration data associated with the aspect? What I meant to say was that when you call update you would pass all of the xml for that specific aspect, not the entire process specification. The configuration data is divided into different <configuration-data> sections and the internal class ConfigurationDataAspect corresponds to one configuration data section. Chris, thanks for your latest response. This means that your original answer doesn't really answer my original question. My original question asks how from within process aspect editor (extension of the abstract ProcessAspectEditor class) does one update a process model element that occurs outside of the process model element associated with the aspect.
showing 5 of 6
show 1 more comments
|
![]()
Ralph Schoon (62.7k●3●36●43)
| answered Sep 27 '13, 6:31 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER edited Sep 27 '13, 6:31 p.m.
https://jazz.net/library/article/1000 explains how aspect editors work.
Comments Ralph, thanks for the pointer to the Rational Team Concert 4.0 Extensions Workshop. I've been thru the workshop (though some time ago), and I along with others on my team have written a few process aspect editors. We're trying to get an answer to a specific question, which I don't remember being answered (at least directly) in the Extensions Workshop. Did I happen to miss the answer somewhere? If so, could you point me to where I should look?
![]() FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
As far as I can tell, the aspect editor can only modify the schema it is responsible for and not anything outside of this context. No, the workshop does only modify in the configuration for the participant. You are correct. |