how to assigning a BuildEngine to a BuildDefinition using the plain java API
Hello,
I have created a IBuildDefinition and a IBuildEngine with the plain java api. The GUI allows me to add "supported build definition" to a build engine or to add a "supporting build engine" to a build definition. How can I do the same in the java api? A code spinet would be great. thanx in advance, Steffen
showing 5 of 7
show 2 more comments
|
3 answers
Exception in thread "main" com.ibm.team.repository.common.internal.Immutable...
unless you explicitly request it, all objects are really read-only. (Immutable) to get a modifiable version, you must get is workingcopy.. then you have to save the changed object. buildClient.save(buildEngine,null); |
this is one of the bad side effects apis..
IBuildEngine.getSupportedBuildDefinitions().add(IBuildDefinitionHandle); the build engine will update the build definition list with the supplied id. Comments This is how EMF works. Like it or not. All this is based on EMF and EMF is efficient but uses these side effects for multiplicity.
sam detweiler
commented Nov 28 '14, 3:34 p.m.
I disagree. But moot point now. |
@Sam, I also try to solve this out.
ITeamBuildClient buildClient = (ITeamBuildClient) jazzapi.repo.getClientLibrary(ITeamBuildClient.class);
IBuildDefinition buildDefinition = buildClient.getBuildDefinition("MyBuildDefinition", null);
Exception in thread "main" com.ibm.team.repository.common.internal.ImmutablePropertyException
at com.ibm.team.repository.common.internal.util.ItemUtil$ProtectAdapter.notifyChanged(ItemUtil.java:2070)
at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:380)
at org.eclipse.emf.ecore.util.EcoreEList.dispatchNotification(EcoreEList.java:255)
at org.eclipse.emf.common.notify.impl.NotifyingListImpl.addUnique(NotifyingListImpl.java:310)
at org.eclipse.emf.common.util.AbstractEList.add(AbstractEList.java:307)
at dk.test.Snippet.main(Snippet.java:53)
What am I missing?
Thanks, Steen
|
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.
Comments
It would be great if someone had an answer to this one. I am running into the same issue.
Remember to post "please answer" requests like this as a "comment", not as an "answer". When you posting this kind of comment as an "answer", you actually decrease the chance you'll get a real answer, since it takes the question out of the "unanswered question" queue. (I've converted your "answer" to be a "comment").
ugly system.. I comment.. sometimes that IS the answer.. sometimes not.
that distinction should go away (IMHO)
Without the distinction between a comment and an answer, there would be no way to run the query for unanswered questions. In most cases, the poster knows whether or not they are posting a proposed answer. In those cases where the poster thinks they are making a comment, but the comment turns out to be an answer, the poster or a moderator can easily retype the comment to be an answer.
they should all be called replies, and there should be a checkbox to 'accept' one as THE answer.
then you could still query for topics without an answer.
the size restriction on todays 'comments' also should be eliminated.
you keep making it sound like the forums are for your benefit, instead of ours.
In practice, only a minority of the answers are marked as "accepted", probably because neither the questioner or the answerer is sure at the time of posting whether a particular answer is the "right" or "best" answer. But most responders do seem to be aware of whether their response is an answer, or just a comment. What problem are you thinking would be addressed by not distinguishing between comments and questions? (Other than avoiding the embarrassment of having Ralph point out when you have neglected to do so :-).
"Our benefit" or "your benefit"? Really? The query for whether there are unanswered questions is a way to make it easier to check whether there are unanswered questions. I believe "we" all benefit when unanswered questions are identified and answered.
"In practice, only a minority of the answers are marked as "accepted", probably because neither the questioner or the answerer is sure at the time of posting whether a particular answer is the "right" or "best" answer. "
exactly.. I try to help in as many ways as I can. Many times I want to post some content for the benefit of the requestor, but the 'comment' object content limit is too small.
I don't KNOW that my content is AN or THE 'ANSWER'
converting a comment to an answer changes the order of the responses..
your or our benefit... I don't EVER search for questions without an answer.. I assume that is an admin function. I also never search for a question with AN accepted answer.. that distinction is generally useless for me. I learn something from EVERY post I read. and I hope that I contribute content back on every post I make. Even if it is to help all of us understand the requestors issue more clearly.