Get a Aria Automation Orchestrator (former vRealize Orchestrator) Configuration Element by Global Tag name
In the post I will show you how to can get an Attribute from a Orchestrator Configuration Element. this is very useful, if you need a Attribute wich is stored in a Configuration element in an Orchestrator Action.
Steps are:
Create a Orchestrator Configuration Element
Navigate to Configuration
![](https://hferch.de/wp-content/uploads/2023/01/image-41.png)
Create a NEW Folder or use an existing Folder where you create a new Configuration Element
![](https://hferch.de/wp-content/uploads/2023/01/image-42.png)
Create a new Configuration Element
![](https://hferch.de/wp-content/uploads/2023/01/image-43.png)
Tag the Configuration Element
Enter a name for the new Configuration Element and create a Tag like this ceID:< ID of Configuration Element>
![](https://hferch.de/wp-content/uploads/2023/01/image-44.png)
Create a variable
![](https://hferch.de/wp-content/uploads/2023/01/image-48.png)
SAVE the Configuration Element
Create a Action to get a Attribute from the Configuration Element
Navigate to Actions -> Select a Modul -> Create a new Action
![](https://hferch.de/wp-content/uploads/2023/01/image-45.png)
Navigate to Script
Add the following Script:
if(tagName && tagValue && attributeName){
var tagQuery = new TagQuery();
addTagFilter(tagName, tagValue, true)
var cfgElements = Server.queryByTags(tagQuery, null);
if(cfgElements != null && cfgElements.length == 1){
for (attribute in cfgElements[0].attributes){
if(cfgElements[0].attributes[attribute].name == attributeName){
if(cfgElements[0].attributes[attribute].value){
return cfgElements[0].attributes[attribute].value;
}
}
}
}else{
throw("Configuration with Tag Name: '" + tagName + "' and Tag Value: '" + tagValue + "' not found or not unique!");
}
}
function addTagFilter(tag, value, isGlobal ){
if (tag != null && tag.length > 0) {
if (isGlobal) {
tagQuery.hasGlobalTag(tag,value);
} else {
tagQuery.hasTag(tag,value);
}
}
}
Create the following Input variables: and return type
![](https://hferch.de/wp-content/uploads/2023/01/image-46.png)
CREATE / SAVE the Action
Test the Action
Run the created Action and click on RUN
![](https://hferch.de/wp-content/uploads/2023/01/image-50.png)
The Action Result should be as shown below
![](https://hferch.de/wp-content/uploads/2023/01/image-51.png)
This Action can be used in other Actions as follow and you can get a Configuration Element Attribute in a Action. For example you can also add a REST Host Object as variable in a Configuration Element and can get this REST Host and use it inside the Action.
System.getModule(“<module Name>”).<Action Name>(<Action inputs, comma separated)>