-
Notifications
You must be signed in to change notification settings - Fork 22
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
Support for binding workflow attributes to config element values #263
Support for binding workflow attributes to config element values #263
Conversation
Could you update CHANGELOG.md and Release.md |
|
This PR looks like containing changes from https://github.com/vmware/build-tools-for-vmware-aria/pull/261/commits |
if (id == null) { | ||
throw new Error(`Invalid syntax for attribute "${att.name}" in workflow "${workflow.name}". It is specified that its value is bound to configuration element with path "${path}" and variable "${key}"` | ||
+ `, but a configuration element with path "${path}" cannot be found in project at that stage. If you belive it is indeed really part of the project, ` | ||
+ `please try moving the file earlier alphabetically so it is processed earlier than the workflow that uses it. Currently available configuration elements are: ` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. Maybe is good idea to have feature task to extend processing of the workflows to be after configurations and resource elements - to avoid such errors.
Fair comment. I do not know how that slipped. |
…ents. This is done by providing the following annotation: ``` @workflow({ id: "<Some Id>", name: "<Some Name>", path: "<Some Path>", attributes: { attributeName: { type: "string", bind: true, value: "Some/Path/To/ConfigurationElement/variableName" } } }) ``` Please note that for the attribute, we have type, bind, and value. bind is a boolean showing if the attribute is bound to a configuration element. If so, then value shows the path to the ConfigurationElement and the variable inside it to bind to, so in the forkflow the attribute value would equal to the value specified in the ConfigurationElement variable. Signed-off-by: Yordan Nedelchev <ynedelchev@vmware.com>
Signed-off-by: Yordan Nedelchev <ynedelchev@vmware.com>
Signed-off-by: Yordan Nedelchev <ynedelchev@vmware.com>
dimitar-nikolov-lazarov Apr 12, 2024 Same as type definitions i other file. It would be better to specify exactly that the type is dictionary of key: string, any/string(value). { [key: string]: any } or { [key: string]: string } Signed-off-by: Yordan Nedelchev <ynedelchev@vmware.com>
befb2a9
to
c4bd92d
Compare
UPDATE: |
const key = value.substring(index+1).trim(); | ||
const path = value.substring(0, index).trim(); | ||
const id = context.configIdsMap[path]; | ||
if (id == null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the check should be if (id === null)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
akantchev I think the check should be if (id === null) ynedelchev Fixed :) Signed-off-by: Yordan Nedelchev <ynedelchev@vmware.com>
Description
This Pull Request is enabling the following feature for Aria Automation Orchestrator Workflows
Be able to bind attribute values to Configuration Element variables
To do that one have to provide the following annotation for the workflow ts file (SomeFile.wf.ts)
Here
bind: true
- means that we have to bind the value of the attribute to Configuration Element variable.value: "Some/Path/To/ConfigurationElement/variableName"
- points to the Configuration Element and variable inside the Configuration Element to bind to.Checklist