Variables allows you to create and use the variables in data pipelines as per the scope. If you have a running pipeline and you want to update the variable value at runtime that is where you can use it to edit and continue.
You can understand the same through the following example:
If you create the following variables:
Then by calling the following code you will get all the variables in the varMap in its implementation class.
|Map<String, ScopeVariable> varMap = (Map<String, ScopeVariable>) configMap.get(“svMap”);|
If you want to use the “Name” variable which you created by calling the following code you will get all the details of the scope variable. The variable object has all the details of the variable Name, Value, Datatype and Scope.
|ScopeVariable variable = varMap.get(“Name”);
String value = variable.getValue();