We don&#39;t need, but that was my initial question. <div>We wrap the Runtime Exception of the server and we propagate TaskException, which should not longer extends Runtime Exception and we add the Exception to the interface, or we keep using RuntimeExceptions <div>

and strongly documents that the user will need to call all these methods in a try/catch block if they want to build real apps, which I believe that is not as good as the IDE forcing them to catch TaskExceptions.</div><div>

<br></div><div>I will definitely check the Script solution and then we will need to decide if documenting that is enough or we move the exception to the TaskService and AsyncTaskService interface. </div><div><br></div><div>

Cheers</div><div><br><br><div class="gmail_quote">On Fri, May 11, 2012 at 9:31 AM, Kris Verlaenen <span dir="ltr">&lt;<a href="mailto:kris.verlaenen@gmail.com" target="_blank">kris.verlaenen@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Having a specific exception definitely would be useful, as it would<br>
allow you to add context, like doing a getTask() or getCommand() or<br>
whatever we believe is valid (as the user might not know anymore what<br>
he asked).  Note that we recently did something similar in master for<br>
exceptions when executing a script, where we then add info about what<br>
process instance etc.<br>
<br>
If TaskException extends RuntimeException, I suppose we don&#39;t really<br>
have to declare it in the interfaces?<br>
<span class="HOEnZb"><font color="#888888"><br>
Kris<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
On Fri, May 11, 2012 at 2:05 PM, Mauricio Salatino &lt;<a href="mailto:salaboy@gmail.com">salaboy@gmail.com</a>&gt; wrote:<br>
&gt;<br>
&gt;<br>
&gt; On Thu, May 10, 2012 at 4:20 PM, Mauricio Salatino &lt;<a href="mailto:salaboy@gmail.com">salaboy@gmail.com</a>&gt;<br>
&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; Hi guys,<br>
&gt;&gt; I was reviewing the Human Task Module and more specifically the HornetQ<br>
&gt;&gt; implementation.<br>
&gt;&gt; I was writing some tests to check the behavior after a logical failure in<br>
&gt;&gt; the server side and I reach a point where some design questions appear:<br>
&gt;&gt;<br>
&gt;&gt; The following line tries to start a task which doesn&#39;t exist in the<br>
&gt;&gt; server:<br>
&gt;&gt;<br>
&gt;&gt; client.start(3, &quot;&quot;);<br>
&gt;&gt;<br>
&gt;&gt; Where client is -&gt; TaskService.<br>
&gt;&gt;<br>
&gt;&gt; This leads to a Runtime Exception in the client side with a clear<br>
&gt;&gt; message:<br>
&gt;&gt; &quot;Command OperationRequest faild due to No Task with ID 3 was found!.<br>
&gt;&gt; Please contact task server administrator.&quot;  &lt;-- not sure about the<br>
&gt;&gt; administrator part<br>
&gt;&gt;<br>
&gt;&gt; I understand that we are throwing a Runtime Exception to be able to not<br>
&gt;&gt; declare the exception inside the TaskService interface, but...<br>
&gt;&gt; For real implementations the user will be forced to do the following:<br>
&gt;&gt;<br>
&gt;&gt;       try{<br>
&gt;&gt;             client.start(3, &quot;&quot;);<br>
&gt;&gt;         }catch(Exception e){<br>
&gt;&gt;               assertEquals(&quot;Command OperationRequest faild due to No Task<br>
&gt;&gt; with ID 3 was found!. Please contact task server administrator.&quot;,<br>
&gt;&gt; e.getMessage());<br>
&gt;&gt;               // or notify the UI about the error using that message.<br>
&gt;&gt;         }<br>
&gt;&gt; No matter the method that the user calls in the client UIs the try/catch<br>
&gt;&gt; block will need to be included in order to not break the app.<br>
&gt;&gt; So my question is: we already have the TaskException class which extends<br>
&gt;&gt; RuntimeException, there are not too many implementations, but we surely can<br>
&gt;&gt; add<br>
&gt;&gt; the TaskPersistence exception, logical exceptions, etc.<br>
&gt;&gt; In my perspective adding the exception to both interfaces (TaskService and<br>
&gt;&gt; AsyncTaskService) will provide a more clear approach to the users that in<br>
&gt;&gt; the end will<br>
&gt;&gt; need to add the try catch no matter why.<br>
&gt;&gt;<br>
&gt;&gt; In my opinion, this is just the first step of providing our clients a way<br>
&gt;&gt; to notify the errors to their UIs.<br>
&gt;&gt;<br>
&gt;&gt; Looking forward for your comments and feedback!<br>
&gt;&gt;<br>
&gt;&gt; Cheers<br>
&gt;&gt;<br>
&gt;&gt; --<br>
&gt;&gt;  - MyJourney @ <a href="http://salaboy.wordpress.com" target="_blank">http://salaboy.wordpress.com</a><br>
&gt;&gt;  - Co-Founder @ <a href="http://www.jugargentina.org" target="_blank">http://www.jugargentina.org</a><br>
&gt;&gt;  - Co-Founder @ <a href="http://www.jbug.com.ar" target="_blank">http://www.jbug.com.ar</a><br>
&gt;&gt;<br>
&gt;&gt;  - Salatino &quot;Salaboy&quot; Mauricio -<br>
&gt;&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt;  - MyJourney @ <a href="http://salaboy.wordpress.com" target="_blank">http://salaboy.wordpress.com</a><br>
&gt;  - Co-Founder @ <a href="http://www.jugargentina.org" target="_blank">http://www.jugargentina.org</a><br>
&gt;  - Co-Founder @ <a href="http://www.jbug.com.ar" target="_blank">http://www.jbug.com.ar</a><br>
&gt;<br>
&gt;  - Salatino &quot;Salaboy&quot; Mauricio -<br>
&gt;<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br> - MyJourney @ <a href="http://salaboy.wordpress.com" target="_blank">http://salaboy.wordpress.com</a><div> - Co-Founder @ <a href="http://www.jugargentina.org" target="_blank">http://www.jugargentina.org</a><br>

 - Co-Founder @ <a href="http://www.jbug.com.ar" target="_blank">http://www.jbug.com.ar</a><br> <br> - Salatino &quot;Salaboy&quot; Mauricio -</div><br>
</div></div>