<div dir="ltr">Hi, <div><br></div><div>I also thought about that recently. So, I absolutely agree with this proposal. It would be nice to see this feature in Liberty.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Sep 2, 2015 at 2:17 PM, Renat Akhmerov <span dir="ltr"><<a href="mailto:rakhmerov@mirantis.com" target="_blank">rakhmerov@mirantis.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">FYI<div><span class=""><br><div>
<div>Renat Akhmerov</div><div>@ Mirantis Inc.</div><div><br></div><br>
</div>
</span><div><br><blockquote type="cite"><div>Begin forwarded message:</div><br><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px"><span style="font-family:-webkit-system-font,Helvetica Neue,Helvetica,sans-serif;color:rgba(0,0,0,1.0)"><b>From: </b></span><span style="font-family:-webkit-system-font,Helvetica Neue,Helvetica,sans-serif">Renat Akhmerov <<a href="mailto:rakhmerov@mirantis.com" target="_blank">rakhmerov@mirantis.com</a>><br></span></div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px"><span style="font-family:-webkit-system-font,Helvetica Neue,Helvetica,sans-serif;color:rgba(0,0,0,1.0)"><b>Subject: </b></span><span style="font-family:-webkit-system-font,Helvetica Neue,Helvetica,sans-serif"><b>[openstack-dev][mistral][yaql] Addressing task result using YAQL function</b><br></span></div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px"><span style="font-family:-webkit-system-font,Helvetica Neue,Helvetica,sans-serif;color:rgba(0,0,0,1.0)"><b>Date: </b></span><span style="font-family:-webkit-system-font,Helvetica Neue,Helvetica,sans-serif">2 Sep 2015 17:16:27 GMT+6<br></span></div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px"><span style="font-family:-webkit-system-font,Helvetica Neue,Helvetica,sans-serif;color:rgba(0,0,0,1.0)"><b>To: </b></span><span style="font-family:-webkit-system-font,Helvetica Neue,Helvetica,sans-serif">"OpenStack Development Mailing List (not for usage questions)" <<a href="mailto:openstack-dev@lists.openstack.org" target="_blank">openstack-dev@lists.openstack.org</a>><br></span></div><div><div class="h5"><br><div><div style="word-wrap:break-word">Hi,<div><br></div><div>I’d like to propose a few changes after transition to yaql 1.0:</div><div><br></div><div>We already moved from using “$.__execution” in DSL to "execution()” and from “$.__env” to “env()” where “execution()” and “env()" are registered yaql functions. We had to do it because double underscored are prohibited in the new yaql.</div><div><br></div><div><br></div><div>In the spirit of these changes I’m proposing a similar change for addressing task result in Mistral DSL.</div><div><br></div><div>Currently we have the syntax “$.task_name” that we can use in yaql expressions to refer to corresponding task result. The current implementation is of that is kind of tricky and, IMO, conceptually wrong because referencing this kind of key leads to DB read operation that’s requried to fetch task result (it may be big as megabytes so it can’t be stored in workflow context all the time. In other words, we create a dictionary with side effect and change the initial semantics of dictionary. Along with mentioned trickiness of this approach it’s not convenient, for example, to debug the code because we can accidentally cause a DB operation. </div><div><br></div><div>So the solution I’m proposing is to have an explicit yaql function called “res” or “result” to extract task result.</div><div><br></div><div><b>res()</b> - extracts the result of the current task, i.e. in “publish” clause.</div><div><b>res(‘task_name’)</b> - extracts the result of the task with the specified name. Can also be used in “publish” clause, if needed</div><div><br></div><div>This approach seems more flexible (cause we can add any other functions w/o having to make significant changes in WF engine) and expressive because user won’t confuse $.task_name with addressing a regular workflow context variable.</div><div><br></div><div>Of course, this to some extent breaks backwards compatibility. But we already changed yaql version which was necessary anyway so it seems like a good time to do it.</div><div><br></div><div>I’d very much like to have your input on this.</div><div><br></div><div><div>
<div>Renat Akhmerov</div><div>@ Mirantis Inc.</div><div><br></div><br>
</div>
<br></div></div></div></div></div></blockquote></div><br></div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><font size="2">Best Regards,</font></div><div><font size="2">Nikolay</font></div></div></div>
</div>