Help me with wildfly deployment pipeline script for pipeline project

stage(‘Deployment Mapping of Environment’) {
steps {
script {

        def tomcatUrl
        def warFileName
        def contextPathName
        def tomcatcredential
        if (params.ENVIRONMENT == '') {
            tomcatUrl = 'http://:9090'
            warFileName = '**/*.war'
            contextPathName = ' '
            tomcatcredential =  ' ' 
            deploy adapters: [tomcat9(credentialsId: tomcatcredential, url: tomcatUrl)], contextPath: contextPathName, war:warFileName

re write the above script for wildfly . got struck in a project … need answers asap

To deploy a WAR file to WildFly using a Jenkins pipeline, you can use the wildfly deployer in the following manner. Replace the placeholders like <<YOUR_WILDFLY_CREDENTIALS_ID>> , <<YOUR_WILDFLY_MANAGEMENT_URL>> , <<YOUR_CONTEXT_PATH>> , and <<YOUR_WAR_FILE_NAME>> with the actual values:

stage('Deployment Mapping of Environment') {
    steps {
        script {
            def wildflyCredentialId = '<<YOUR_WILDFLY_CREDENTIALS_ID>>'  // Replace with your WildFly credentials ID
            def wildflyManagementUrl = 'http://<<YOUR_WILDFLY_MANAGEMENT_URL>>/management'
            def contextPathName = '<<YOUR_CONTEXT_PATH>>'  // Replace with the context path for your application
            def warFileName = '<<YOUR_WAR_FILE_NAME>>'  // Replace with the name of your WAR file

                credentialsId: wildflyCredentialId,
                url: wildflyManagementUrl,
                hostname: 'localhost',  // You may need to adjust this
                port: 9990,  // The management port for WildFly
                fileName: warFileName,
                runtimeName: warFileName,
                enabled: true,
                contextPath: contextPathName,
                rollback: false,
                toDeployment: false

This script assumes that you’ve configured the WildFly credentials in Jenkins. Replace <<YOUR_WILDFLY_CREDENTIALS_ID>> with the actual ID of those credentials.

Make sure that the necessary Jenkins plugins are installed for WildFly deployment, and adjust the WildFly management URL, hostname, and port to match your specific WildFly setup.