Using Variables in RubiPython

Using Variables in RubiPython

The variables defined at the workbook/pipeline level can be used in the RubiPython custom component.

To use a user-defined variable in RubiPython, follow the steps given below.
  1. Create your algorithm flow. Refer to Building Algorithm Flow in a Workbook Canvas.
  2. Drag and drop RubiPython on your workbook canvas.

  3. If required, connect other nodes to the RubiPython node in your algorithm flow.

  4. Select RubiPython and in the Properties pane, click Configure.

  5. The configuration page is displayed.


Write the code in the RubiPython Code Editor. Refer to Writing Custom Code using RubiPython.

 


  1. For example, if the variable name is var1, you can use it in RubiPython as : Var1Value = getVariable(@@var1@@).
  2. To set the variable value to use it further in the flow, use setVariable function as below:
  3. To assign or update the var1 variable value as that of the other variable value var2 where var2 is taken from the rubipython code flow, use below code using function of setVariable(@@var1@@, var2) as :



  1. After execution, the current value of var1 variable is set as 15.


The updated value of the variable can be referred to in the further tasks.