Is there a way to check if global-module exists or not.

Solution Unverified - Updated -

Issue

I have a global-modules section in the ee subsystem in my standalone.xml that looks like this.

<subsystem xmlns="urn:jboss:domain:ee:1.2">
 <global-modules>
     <module name="sample"></module>
 </global-modules>

How do I check to see if this module named "sample" exists under global module using the CLI if statement?

We want to check if certain module name exists in global module or not. For this we are trying with if-else command but its not working.

[standalone@localhost:9999 /] if (result.name =="sample") of /subsystem=ee:read-attribute(name=global-modules)
[standalone@localhost:9999 /] echo "Module added in global module"
[standalone@localhost:9999 /] else 
[standalone@localhost:9999 /] echo "Module not added in global modules"
[standalone@localhost:9999 /] end-if 
"Module not added in global modules"  


[standalone@localhost:9999 /] /subsystem=ee:read-attribute(name=global-modules)
{
    "outcome" => "success",
    "result" => [{"name" => "sample"}]
}

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 6.2.x+

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.