[openstack-dev] [mistral][yaql] Addressing task result using YAQL function
Stan Lagun
slagun at mirantis.com
Mon Sep 7 13:18:10 UTC 2015
I believe this is a good change. $.task_name requires you that $ be
pointing to a tasks dictionary. But in the middle of the query like
[1.2.3].select($ + 1) "$" will change its value. With a function approach
you can write [1, 2, 3].select($ + task(taskName)). However the name "task"
looks confusing as to my understanding tasks may have attributes other than
result. It may make sense to use task(taskName).result instead.
Sincerely yours,
Stan Lagun
Principal Software Engineer @ Mirantis
<slagun at mirantis.com>
On Sun, Sep 6, 2015 at 12:14 AM, Dmitri Zimine <dzimine at stackstorm.com>
wrote:
> Yes meant to ask for consistency of referencing to task results. So it’s
> task(task_name) regardless of where.
>
> One use case in favor of this is tooling: I refactor workflow with an
> automated tool which wants to automatically rename the task name
> EVERYWHERE. You guys know well by now that renaming the task is a source of
> too many frustrating errors :)
>
> What other think?
>
> DZ.
>
> On Sep 3, 2015, at 4:23 AM, Renat Akhmerov <rakhmerov at mirantis.com> wrote:
>
>
> On 02 Sep 2015, at 21:01, Dmitri Zimine <dzimine at stackstorm.com> wrote:
>
> Agree,
>
> with one detail: make it explicit - task(task_name).
>
>
> So do you suggest we just replace res() with task() and it looks like
>
> task() - get task result when we are in “publish”
> task(task_name) - get task result from anywhere
>
> ?
>
> Is that correct you mean we must always specify a task name? The reason
> I’d like to have a simplified form (w/o task name) is that I see a lot of
> workflows that we have to repeat task name in publish so that it just look
> too verbose to me. Especially in case of very long task name.
>
> Consider something like this:
>
> tasks:
> *get_volumes_by_names*:
> with-items: name in <% $.vol_names %>
> workflow: get_volume_by_name name=<% $.name %>
> publish:
> volumes: <% $.*get_volumes_by_names* %>
>
> So in publish we have to repeat a task name, there’s no other way now. I’d
> like to soften this requirement, but if you still want to use task names
> you’ll be able to.
>
>
> res - we often see folks confused by result of what (action, task,
> workflow) although we cleaned up our lingo: action-output, task-result,
> workflow-output…. but still worth being explicit.
>
> And full result is being thought as the root context $.
>
> Publishing to global context may be ok for now, IMO.
>
>
> Not sure what you meant by "Publishing to global context”. Can you clarify
> please?
>
>
> Renat Akhmerov
> @ Mirantis Inc.
>
> __________________________________________________________________________
> OpenStack Development Mailing List (not for usage questions)
> Unsubscribe: OpenStack-dev-request at lists.openstack.org?subject:unsubscribe
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>
>
>
> __________________________________________________________________________
> OpenStack Development Mailing List (not for usage questions)
> Unsubscribe: OpenStack-dev-request at lists.openstack.org?subject:unsubscribe
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20150907/bba0cedd/attachment.html>
More information about the OpenStack-dev
mailing list