GitHub user mattcasters created a discussion: Dynamic variables

So, what if we had a way to dynamically resolve variables.  That was the main 
theme of the discussion under issue #3454.
The idea is simple enough but perhaps hard to explain in text form and so it 
got snowed under for a while.

Well, suppose you would be able to build plugins to resolve variables with 
metadata.
We could introduce a new syntax: `#{resolver-name:variable}`.

For example: `#{pipeline:hop}` with 
* `pipeline` : being the name of the Variable Resolver metadata object
* `hop` : the name of the variable or expression you would like to see resolved.

![image](https://github.com/user-attachments/assets/2bc99663-86ba-427b-a309-3f43c1383b75)

The pipeline variable resolver would look something like this:

![image](https://github.com/user-attachments/assets/b8aca871-d9ad-4808-b31e-a5d5587be303)

You could then make a pipeline to resolve a variable value.  Here is an example 
with static data...

![image](https://github.com/user-attachments/assets/5bc5a3a7-afc4-430b-949e-48145e5707ba)

The pipeline gets the expression (or variable name) via the specified variable 
and looks up the actual value.  In the simple scenario above we're using 
hardcoded value.  You could also store the names and values in a database table 
or a file somewhere.
Other use cases would include the lookup of JSON Web Tokens, interactions with 
secret vaults and so on.

If you want to try this out, build [pull request 
4761](https://github.com/apache/hop/pull/4761) 

What resolver plugins or features did you think of?  Let me know!

Cheers,

Matt

GitHub link: https://github.com/apache/hop/discussions/4763

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: [email protected]

Reply via email to