Page 1 of 1

process.get_option

Posted: Mon Mar 20, 2017 11:09 am
by darincook
Hi Louis,

In the human_setup template there is code under the "create_groups" process which has a module I can't seem to find anywhere in the website.

top_group = process.get_option('Top Group', 'Setup')

What is get_option?

Thanks

Re: process.get_option

Posted: Sat Mar 25, 2017 11:47 am
by louisVottero
Sorry for the late reply on this. If you continue to post often I will check the forum more often.


check this video out:

phpBB [video]


Note that you now have to press the edit button to customize options.

Vetala uses options to build variables that can be accessed without having to go into the code.

The video shows how to create these variables and access them in the code.

functions to be used with options workflow:

Good to use in code:
process.has_options() Checks if there are options for the process
process.get_option(name, group) name = the name of the variable. group = the name of the group it lives in. Check the video to see how this works.
process.get_options() this returns all the options


If you are looking to set and retrieve data that exists during a process run, you would use

set_runtime_value(name, value) name can be a string and is just used to retrieve the value later using get_runtime_value. value can be any python object, including string, int, float, list etc...
get_runtime_value(name)

Re: process.get_option

Posted: Sat Mar 25, 2017 1:46 pm
by darincook
Aah I see, thanks for the detailed reply Louis.