Stop execution participant operation in case of error, having more operation participant running one after another
Hi all, as object, I need to be able to block the execution of an OpertationParticipant, in case of error, without going to the execution of the next. I try to explain myself better, I have a series of Operation participant, which carry out targeted checks, but in case one enters a condition that I have defined that is not good (type control over format and format not respected) use problem = collector. createProblemInfo (...) and then collector.addInfo (problem); but the execution is not blocked but passes to the next Operation participant, which I do not need to do, also because I would face unhandled errors because I took it for granted that I could stop the execution.
3 answers
Your assumption to be able to stop the other advisors or participants is incorrect so you can not stop their evaluation. You will have to deal with the outcome. E.g. one issue can cause other issues.
Like any other extension you are called by the extension point and you can return an issue or success (or do something in a participant). You can not make any assumptions about other participants or advisors being active in your context before or after you.
As an administrator you can control the order of the behavior in the UI (order is from top to bottom).
As an extension developer you can try to communicate with other extensions you write. There is no general mechanism for that, but I have seen someone in this forum claiming to have succeeded. In this case you can test the communication in your extensions and stop their evaluation or let them return no error, if you want.
The operation results are shown in the process advisor view in Eclipse. In the Web UI, you only get the error bar and can expand that for details.
Comments
This is a forum that uses the English language. You don't want an answer in German or French or Japanese etc. either. So please use English.
You're right, I had prepared for the mistake.Thank you so much for your answer, arrived I thought. But you can give me some links that talk about this "communication" between the plugins because I have not found anything about it, but I definitely feel bad. Take advantage of the availability to ask yourself another couple of things: 1) Error messages that only look at the content and text that is displayed if you place the mouse on the summary or click on it. Is it a feature of version 6.0.5? 2) Can we choose the optimization of the severity of the problem? Let me explain better by default has value 4 but if I wanted to increase it or decrease it ?? Thank you so much again for the answer.
I'm sorry, I answered correctly again.
I remember remotely some discussion on this forum, where a user shared data. I can not point you anywhere. I think there would probably a lot of problems to overcome to do this kind of communication. E.g. how to know the operations are in the same context and who to communicate with whom? Usually you don't want this kind of design.
The error messages work like this since RTC 1. com.ibm.team.process.common.advice.IProcessReport defines the severities. It is an int. I don't know what happens if you use other values.
I also don't see what it would help.
You can use packaging to share code. Otherwise I have no great idea.
Excuse me how can I share the code? Then I do not know if it's possible, but I ask my manager, however, basically I try to explain myself I have two custom advisors (CA) that control one format and the other if the format is correct ie NNN (ie are three numbers with two points in half) check syntaxically the format ie if depending on the type of release is written following other rules. Now if someone misses an incorrect format I give an error message but then he / she sees me the correct message but also another unhandled exception, because the next CA expects that the format is correct, so (as in this case) I would like to bypass the execution of the next CA, because it would go into an unmanaged error (deliberately not to replicate the code). I hope I explained myself better. Thank you.
See the extensions workshop, where code is shared across projects. That is basically the mechanism you can use. You can have multiple extensions use the same code across projects.
Thank you very much, I immediately throw an eye: D
Hello, sorry for the delay, basically I'll explain. I would need to do some very specific Custom Advisors (CA), each one makes a certain control and in succession I have four that do very targeted and individual controls, so if a check is not right at the first CA I would need not to run the others , as I could go against unhandled error. I could handle them but I would have to replicate the code from one CA to another and we wanted to avoid it. Possible that there is no way to tell him not to run the rest of the CA if he already has an error in his stomach? Since it shows all the errors that it meets, it would be enough for me if you have at least one the other CAs have to be bypassed ..... You can not think of anything to help me? Thanks anyway.
</pre>
Based on simple testing with the built-in preconditions, all pre-conditions are executed in the order specified, whether or not any of them have failed. An argument in favor of executing them all is that the user is made aware of all of the ways in which their operation would have failed.
Comments
Thanks Geoffrey Clemm, but I do not understand a thing, the Enhancement 456094 you created is waiting for processing? I mean, did you put my doubt on another side? Excuse the question, if you fool, but it is the first time that I disturb you for these things: D. In the meantime I take the opportunity to ask for info on the collector, that is, since the errors are listed in order of execution all together (unlike the version 5.0.2, which at first stopped) there is no way to check the contents of this Collector in way to set that if there is at least one element is not executed ???? Thanks :D
I am pretty sure that there is no difference between 5.0.2 and later versions. I have worked with this all the time and I would likely have notice. You always get all the errors for an operation and not just the first. I am also pretty sure you don't have access to the results of the other operations before you. You can try to look into the data you get. I have never tried something like that.
Geoff filed a request - a work item - to document the behavior better. This is development. We have no magic here.
Hello, we would miss that you have the magic: D, I with previous versions I meant before 5.0.2 that at the first exception showed the errors due to the precondition, but I'm probably wrong. I'm trying to analyze the collector object and I have a question, there is the addInfoProblem method, but I can not find anything to check for the presence or not of some problems in the collector. Because I had imagined that since it has it (showing them all means that from the first onwards something inside must have) I wanted to check the presence or not to constrain the subsequent executions, but I do not find anything that can help me, you have some idea? Thank you very much in advance and sorry for all the questions, but I would like to understand if somehow it is possible to manage this behavior.
This mechanism is available since RTC beta 1 and has not changed for all I know.
The interface is designed in a way that the extension point you hook up to provides you with input data and usually some way to provide a result.
Such a design is usually done such that the extending part does not interfere with other extending parts. They usually even don't know anything about each other.
You can use a debugger, as explained in the Extensions workshop, to look at the classes and see if the classes you have provide interfaces you can use. I doubt it, a reasonable design would prevent that.
Actually I'm having a lot of problems on the recovery of this information, I'm trying to recover "extreme" but then I wonder, the collector is common to all because it is passed to the signature of the run method, but at this point between one and the other must to be reachable the content of the collector, as he then shows them all not? Do I miss something? Thank you so much again for everything.