Hi Daniel, <br><br>* A workflow is set of transitions.<br><br>* If you want to go from a Step X to a Step Y, a transition is required to exists<br><br>* For conditional workflow, there is the concept of branch. <br><br>* Each time you click on finish, the pipeline (or workflow) is executed. Upon success, it returns to the step from where the transition to the &quot;finish&quot; step was done.  Having a different behavior would make sens. I propose the following:<br>

   * Add a property named &quot;GoBackToOriginStepUponSuccess&quot; to workflow.  (also open to suggestion regarding the name)<br>   * By default, this property would be False<br>  <br>Would be great if you could implement the described behavior. To do so:<br>

   1) fork CTK on github<br>   2) Create a topic branch named &quot;add-GoBackToOriginStepUponSuccess-workflow-feature&quot; of master<br>   3) Commit both feature and updated test<br>   4) Check that test run locally<br>

   5) Send an email to the list asking for review with a pointer to your topic<br>   6) Danielle or myself will review your topic and integrate it into master<br><br>Note: Make also sure the property is exposed in python. You could play with the following example to make sure everything is working as expected. See <a href="https://github.com/jcfr/SlicerPy/blob/master/slicer-visual-workflow-example.py">https://github.com/jcfr/SlicerPy/blob/master/slicer-visual-workflow-example.py</a><br>

<br>Thanks<br>Jc<br><br><div class="gmail_quote">On Fri, Jun 3, 2011 at 3:52 PM, Danielle Pace <span dir="ltr">&lt;<a href="mailto:danielle.pace@kitware.com">danielle.pace@kitware.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

Hi Daniel,<div><br></div><div>CanGoToStep checks to see if a path exists between two steps - so it is not helpful in your case.</div><div><br></div><div>Right now, there is no method to go to a specific step without transitioning back.  We could add a property that dictates whether to go back to the starting step after successfully getting to a &#39;finish&#39; step...</div>


<div><br>Thanks,<br><br>Danielle</div><div><br></div><div><br></div><div><br></div><div><div><div></div><div class="h5"><br><br><div class="gmail_quote">On Fri, Jun 3, 2011 at 3:45 PM, Daniel Haehn <span dir="ltr">&lt;<a href="mailto:haehn@bwh.harvard.edu" target="_blank">haehn@bwh.harvard.edu</a>&gt;</span> wrote:<br>


<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Hi Danielle,<br>
<br>
hm this does not make totally sense to me. What about the canGoToStep<br>
method - this only checks for next step?<br>
<br>
Wouldn&#39;t it make more sense to have the behavior I observed and you<br>
described for the canGoToStep call and do not go back when you call<br>
goToStep?<br>
<br>
Or is there another method I could use to go from step 1 to step 4, f.e.?<br>
<br>
Thanks<br>
<font color="#888888">Daniel<br>
</font><div><div></div><div><br>
On Fri, Jun 3, 2011 at 3:40 PM, Danielle Pace &lt;<a href="mailto:danielle.pace@kitware.com" target="_blank">danielle.pace@kitware.com</a>&gt; wrote:<br>
&gt; Hi Daniel,<br>
&gt; This is the intended behavior when using &#39;goToStep&#39;.<br>
&gt; The idea is that, partway through the workflow, you could execute the steps<br>
&gt; until a &#39;finish step&#39; was reached - using the default parameters for those<br>
&gt; steps.  Then you can evaluate the results that occur with default<br>
&gt; parameters.  If you get to the &#39;finish&#39; step successfully, it puts you back<br>
&gt; where you started - so that you can continue to step through and alter<br>
&gt; parameters if you like.<br>
&gt; If you do not get to the &#39;finish&#39; step successfully (i.e. default parameters<br>
&gt; produce errors on your data or because of the parameters you set in prior<br>
&gt; steps), it will stop at the error.<br>
&gt; Hope that helps,<br>
&gt;<br>
&gt; Danielle<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; On Fri, Jun 3, 2011 at 3:34 PM, Daniel Haehn &lt;<a href="mailto:haehn@bwh.harvard.edu" target="_blank">haehn@bwh.harvard.edu</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; Hi guys,<br>
&gt;&gt;<br>
&gt;&gt; if I use ctkWorkflow.goToStep(x), the workflow goes to the step x<br>
&gt;&gt; along the workflow (according to onEntry, validate and onExit calls).<br>
&gt;&gt;<br>
&gt;&gt; But then, after reaching step x, it goes directly back to where I am<br>
&gt;&gt; coming from - again along the workflow. This goes so fast so it seems<br>
&gt;&gt; there is no movement at all.<br>
&gt;&gt;<br>
&gt;&gt; I digged a little and it seems line 1035 in ctkWorkflow.cpp is not<br>
&gt;&gt; right? After reaching the &#39;finish step&#39; (which in my understanding is<br>
&gt;&gt; the target step), it goes back to the starting step.<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; 1019 //<br>
&gt;&gt; --------------------------------------------------------------------------<br>
&gt;&gt; 1020 void ctkWorkflow::goToStepSucceeded()<br>
&gt;&gt; 1021 {<br>
&gt;&gt; 1022   Q_D(ctkWorkflow);<br>
&gt;&gt; 1023<br>
&gt;&gt; 1024   logger.debug(&quot;goToStepSucceeded&quot;);<br>
&gt;&gt; 1025<br>
&gt;&gt; 1026   // after success, go back to the step at which we begin looking for<br>
&gt;&gt; 1027   // the finish step (will exit the current step and enter the<br>
&gt;&gt; starting step)<br>
&gt;&gt; 1028<br>
&gt;&gt; 1029   d-&gt;createTransitionToPreviousStartingStep(d-&gt;StartingStep,<br>
&gt;&gt; d-&gt;CurrentStep);<br>
&gt;&gt; 1030<br>
&gt;&gt; 1031   d-&gt;GoToStep = 0;<br>
&gt;&gt; 1032   d-&gt;StartingStep-&gt;setStatusText(&quot;Attempt to go to the finish<br>
&gt;&gt; step succeeded&quot;);<br>
&gt;&gt; 1033   d-&gt;StartingStep = 0;<br>
&gt;&gt; 1034<br>
&gt;&gt; 1035   this-&gt;goFromGoToStepToStartingStep();<br>
&gt;&gt; 1036 }<br>
&gt;&gt; 1037<br>
&gt;&gt;<br>
&gt;&gt; Is this correct behavior and I understand the goToStep(x) call wrong<br>
&gt;&gt; or is this a bug?<br>
&gt;&gt;<br>
&gt;&gt; Cheers,<br>
&gt;&gt; Daniel<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; Ctk-developers mailing list<br>
&gt;&gt; <a href="mailto:Ctk-developers@commontk.org" target="_blank">Ctk-developers@commontk.org</a><br>
&gt;&gt; <a href="http://public.kitware.com/cgi-bin/mailman/listinfo/ctk-developers" target="_blank">http://public.kitware.com/cgi-bin/mailman/listinfo/ctk-developers</a><br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; Danielle Pace, M.ESc.<br>
&gt; Research and Development Engineer<br>
&gt; Kitware Inc.,<br>
&gt; North Carolina Office<br>
&gt; <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt; <a href="tel:919-969-6990%20X%20319" value="+19199696990" target="_blank">919-969-6990 X 319</a><br>
&gt;<br>
</div></div></blockquote></div><br><br clear="all"><br></div></div>-- <br><div class="im">Danielle Pace, M.ESc.<br>Research and Development Engineer<br>Kitware Inc.,<br>North Carolina Office<div><br></div><div><a href="http://www.kitware.com" target="_blank">www.kitware.com</a></div>


<div><a href="tel:919-969-6990%20X%20319" value="+19199696990" target="_blank">919-969-6990 X 319</a></div><br>
</div></div>
<br>_______________________________________________<br>
Ctk-developers mailing list<br>
<a href="mailto:Ctk-developers@commontk.org">Ctk-developers@commontk.org</a><br>
<a href="http://public.kitware.com/cgi-bin/mailman/listinfo/ctk-developers" target="_blank">http://public.kitware.com/cgi-bin/mailman/listinfo/ctk-developers</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>+1 919 869 8849<br><br>