Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

what is the difference between 'provides' and 'results' ? #34

Closed
tarun29061990 opened this issue Aug 17, 2021 · 1 comment
Closed

what is the difference between 'provides' and 'results' ? #34

tarun29061990 opened this issue Aug 17, 2021 · 1 comment

Comments

@tarun29061990
Copy link

getDate: {
      provides: ['date'],
      resolver: {
        name: 'flowed::Echo',
        params: { in: { value: new Date() } },
        results: { out: 'date' },
      }
},

In the above configuration, what is the difference between provides and results ? Is it about task level and resolver level configuration?

@danielduarte
Copy link
Owner

provides are the values or "tokens" expected to be returned by a task in the flow.
They give a global name in the flow scope to the values that travel from task to task so any task that "requires" those values or tokens will be provided by any other task that "provides" it. Basically provides and requires fields form the edges in the flow graph.

And results is the instruction to map the desired results returned by a resolver into the values returned by the flow task to the rest of the flow. The left side of results have always the names returned by the resolver (no matter the flow where the resolver is being used, a resolver will always have the same possible values there since they are generated and returned internally in its code). And on the right side are a value/token name (one of the declared in provides) so the given resolver result is mapped to that value.

In your example using the resolver flowed::Echo (which always return a value called out) you're telling Flowed: "please name the 'out' result of this resolver as 'date' so any other task in the flow that requires 'date' will recibe that value.".

Hope my answer helps ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants