    

 ## On this page

  

 

 # addVariable

 Last update: 16.07.2025 

public [addVariable](add-variable.md)(name: [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html), type: [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html), state: [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html)): [Variable](../-variable/index.md)

Adds the variable from the script component.

#### Return

the IVariable added to the component

#### Throws

[ModelCenterException](../-model-center-exception/index.md)