Jump to content

Set an environment variable for Script Filter


Recommended Posts

Hi everyone. I have a simple workflow with a script filter. The executed script reads environment variables for the run configuration. Since the Script Filter is an input object, it ignores the variables set upstream. So what I can do is set the Workflow's global variables. However, I want to duplicate the script filter to have different configuration for different keywords, and global variables won't allow me this. IS there a way to do this per script filter?

Link to comment
4 hours ago, sigito said:

Since the Script Filter is an input object, it ignores the variables set upstream.

 

It doesn't. You're likely doing something wrong.

 

4 hours ago, sigito said:

IS there a way to do this per script filter?

 

The simplest solution would be to prefix the variables with the keyword, and have a different set of variables for each Script Filter.

Link to comment

I hope I do something wrong, but in my understanding the upstream variables are only applied if I trigger the wofrkflow with an input element before the variable element. E.g., if I put a Keyword before. But in case the variables are dangling, like on an attached screenshot, it doesn't work.

Знімок екрана 2020-09-20 о 21.08.13.png

Link to comment

I think I would specify the desired variable values as options to the script filter, and parse them in the binary. That seems to be the easiest solution, which does not require hardcoding of the prefixes as you suggested. Thanks.

Edited by sigito
Link to comment
2 hours ago, sigito said:

the upstream variables are only applied if I trigger the wofrkflow with an input element before the variable element. E.g., if I put a Keyword before.

 

Yes. If your entry point is a Script Filter, then anything upstream of that doesn't get run.

 

2 hours ago, sigito said:

I think I would specify the desired variable values as options to the script filter

 

If they don't need to be edited by the user, that's also perfectly fine.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...