<div class="socmaildefaultfont" dir="ltr" style="font-family:Arial;font-size:10.5pt" ><div dir="ltr" >You all sort of touched on what I am about to reiterate:</div>
<div dir="ltr" > </div>
<div dir="ltr" >1. The scope was intended to be used as a way to propagate events up and down the chain (from table controller to step controller) since there was no real way to share information between controllers (remember that a modal dialog launches an entirely different fragment of HTML with no relationship to the current controller). Furthermore, we needed to use initScope to explicitly set the scope so that $modal does not use the $rootScope (which it does by default if scope is not set). As a side bonus, we were also able to use events to share data between the steps. The idea behind was to <strong>make steps independent</strong> <strong>and reusable</strong> in multiple workflows. The reality is that the event propagation required both an $emit and a $broadcast to actually share data between steps, this makes it much less desirable.</div>
<div dir="ltr" > </div>
<div dir="ltr" ><strong>The root of the problem is, how does my table know to update once the form is submitted?</strong> Since then, a lot more work has been done in this area and I have not followed all of them (Matt and Tyr, feel free to chime in). I understand that Tyr made it so that events were no longer required, instead we can depend on promises via the result-handler function. This function gets triggered once the action is completed and would allow the table controller to do something after the action goes through. With the introduction of the generic table and registry, I am no longer certain how the data is updated in tables. If tables are notified of changes without the use of events, then the first step is to make this the standard.</div>
<div dir="ltr" > </div>
<div dir="ltr" >2. Going with Richards idea of a shared workflow.model idea.</div>
<div dir="ltr" > </div>
<div dir="ltr" ><div><em>"So, here's my rough thought: workflow.model is an object with properties named for each of the workflow steps - using the step formName as the name (hell, schema form could probably make this a doddle). The workflow model is passed to the controller for each step, which uses its own named model to store the data captured by the step - and as a side effect it can poke at (and watch) the data captured by other steps, which is often useful. Workflow $modal resolution supplies the workflow model for the consumer of the workflow to then to something with all that data."</em></div>
<div> </div>
<div>Event if we get rid of the events model completely, how are we planning on watching objects without scope? The main reason initScope existed is to act as a glue to allow sharing of data between the various controllers. This is the direct result of us using the $modal widget. While I agree that this introduces a sticky situation concerning the purity of services, I am unsure how we can resolve this.</div>
<div> </div>
<div>I believe that the workflow should just be a list of steps. The model should instead reside in the create-volume service where it truly belongs. Each step can store a reference to the model and we are still able to poke/watch the data as Richard suggested.</div>
<div> </div>
<div>To me there are two questions we should answer before we jump and do another rewrite.</div>
<div>1. How are we going to glue the various controllers together if we don't use scope.</div>
<div>2. How is data between the steps going to be shared.</div></div>
<div dir="ltr" > </div>
<div dir="ltr" >I agree the solution we have isnt perfect, but at some point, we have to ask, is it good enough? And if it is, is it worth the cost of a rewrite when it can potentially break plugins and external code? To be clear, I am not against it, just adding my 2c.</div>
<div dir="ltr" > </div>
<blockquote data-history-content-modified="1" dir="ltr" style="border-left:solid #aaaaaa 2px; margin-left:5px; padding-left:5px; direction:ltr; margin-right:0px" >----- Original message -----<br>From: Richard Jones <r1chardj0n3s@gmail.com><br>To: "OpenStack Development Mailing List (not for usage questions)" <openstack-dev@lists.openstack.org><br>Cc:<br>Subject: Re: [openstack-dev] [Horizon] Angular action services and initScope<br>Date: Mon, Jul 18, 2016 3:05 PM<br> 
<div dir="ltr" ><div><div>On 18 July 2016 at 11:49, Rob Cresswell <span dir="ltr" ><<a href="mailto:robert.cresswell@outlook.com" target="_blank" >robert.cresswell@outlook.com</a>></span> wrote:

<blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex" ><div><div dir="ltr" >Maybe I'm missing the point, but the schema stuff just defines a model and passes it to the schema directive via ctrl; doesn't that remove any issues with workflows? ui-bootstraps modal and modalinstance already provides a way to pass that data back to the initial location (table etc) again</div></div></blockquote>
<div> </div>
<div>In a nutshell, yes this is the goal I'm aiming for, though some of the details might vary.</div>
<div> </div>
<div> </div>
<div>      Richard </div></div></div></div>
<div><font face="Default Monospace,Courier New,Courier,monospace" size="2" >__________________________________________________________________________<br>OpenStack Development Mailing List (not for usage questions)<br>Unsubscribe: OpenStack-dev-request@lists.openstack.org?subject:unsubscribe<br><a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank" >http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a></font></div></blockquote>
<div dir="ltr" > </div></div><BR>