It's all about the answers!

Ask a question

Stop execution participant operation in case of error, having more operation participant running one after another

Emi Liano (135) | asked Mar 19 '18, 9:58 a.m.

 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.

Small postilla, I noticed that even if there is text in the error message this is not displayed directly, (I'm using the RTC 6.0.5 version), but if I place myself with the cursor on the error on the screen, I see a popup with the error message.
P.S. How do you set the severity of the problem? I know that by default it has a value of 4, but if I wanted to increase it, do I have to go up or down? Thank you.

3 answers

permanent link
Ralph Schoon (63.2k33646) | answered Mar 19 '18, 12:10 p.m.
edited Mar 19 '18, 12:11 p.m.

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.

Emi Liano commented Mar 19 '18, 12:38 p.m. | edited Mar 31 '18, 4:20 p.m.


Grazie mille per la tua risposta, è come pensavo. Ma puoi darmi dei link che parlano di questa "comunicazione" tra i plugin perché non ho trovato nulla a riguardo, ma sicuramente ci provo male. Approfitta della disponibilità per chiederti un altro paio di cose: 1) I messaggi di errore che vengono visualizzati mostrano solo il riepilogo e non il testo che viene visualizzato se si posiziona il mouse sul riepilogo o si fa clic su di esso. È una funzionalità della versione 6.0.5? 2) Puoi spiegare come funziona l'impostazione della gravità del problema? Lasciami spiegare meglio di default ha valore 4 ma se volessi aumentarlo o diminuirlo ?? Grazie mille ancora per la risposta.

Ralph Schoon commented Mar 19 '18, 12:44 p.m.

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.

Emi Liano commented Mar 20 '18, 4:38 a.m. | edited Mar 20 '18, 5:35 a.m.

 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.

Emi Liano commented Mar 20 '18, 4:39 a.m.

I'm sorry, I answered correctly again.  

Ralph Schoon commented Mar 20 '18, 5:49 a.m.

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. 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.

Ralph Schoon commented Mar 26 '18, 4:29 a.m.

You can use packaging to share code. Otherwise I have no great idea.

Emi Liano commented Mar 26 '18, 4:38 a.m.

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. 

Ralph Schoon commented Apr 03 '18, 2:26 a.m.

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.

Emi Liano commented Apr 03 '18, 5:42 a.m.

Thank you very much, I immediately throw an eye: D 

showing 5 of 9 show 4 more comments

permanent link
Emi Liano (135) | answered Mar 26 '18, 3:39 a.m.
edited Mar 26 '18, 3:40 a.m.

 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.


permanent link
Geoffrey Clemm (30.1k33035) | answered Apr 01 '18, 12:32 a.m.

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.   

I have submitted work item to get this behavior documented.   

Emi Liano commented Apr 03 '18, 5:42 a.m.

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

Ralph Schoon commented Apr 03 '18, 6:30 a.m.

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.

Emi Liano commented Apr 04 '18, 4:58 a.m.

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.

Ralph Schoon commented Apr 04 '18, 5:33 a.m.

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.

Emi Liano commented Apr 04 '18, 5:50 a.m. | edited Apr 04 '18, 5:50 a.m.

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.

Your answer

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