If you run SAP Product Configuration or SAP Solution Configuration for SAP Commerce on-premise, you will most likely need one day to check the version of the installed SAP Product/Solution Configuration Runtime Engine to either ensure its up to date or verify it was properly updated. You might also need to verify that all your SAP Commerce server nodes run the same version of SAP Product/Solution Configuration Runtime Engine. For example, I ran several times in the situation, where SAP Commerce ran multiple versions of the SAP Product/Solution Configuration Runtime Engine, causing weird issues in the product configurator. However, checking the installation and version of the SAP Product/Solution Configuration Runtime Engine can be tedious. It requires file system access, which is not always granted to SAP Commerce administrators for security reasons.

Solution

I built this little Groovy script, executable via hAC, to check if the SAP Product/Solution Configuration Runtime Engine is properly installed and secondly to show its version.

import com.sap.custdev.projects.fbs.slc.cfg.IConfigSession

Collection<URL> findSscMavenPomProperties() {
    return IConfigSession.class.getClassLoader().getResources("META-INF/maven/com.sap.custdev.projects.fbs.slc/com.sap.custdev.projects.fbs.slc.ssc/pom.properties").collect()
}

Set<String> findSscVersions() {
    return findSscMavenPomProperties().collect {
        it.withInputStream {
            final Properties pomProperties = new Properties()
            pomProperties.load(it)
            return pomProperties.getProperty("version")
        }
    }.unique()
}

List<URL> findSscJars() {
    return findSscMavenPomProperties().findAll { "jar".equalsIgnoreCase(it.protocol) }.collect { new URL(it.path.substring(0, it.path.indexOf('!'))) }
}

def sscVersions = findSscVersions()
if (sscVersions.size() > 1) {
    println "Multiple versions of SAP Product/Solution Configuration Runtime Engine found: ${sscVersions.join(", ")}"
    println "Mutliple SAP Product/Solution Configuration Runtime Engine JARs found:"
    findSscJars().each {
        println " - ${it.toExternalForm()}"
    }
} else if (sscVersions.size() == 1) {
    println "SAP Product/Solution Configuration Runtime Engine version is ${sscVersions.iterator().next()}"
} else {
    println "No SAP Product/Solution Configuration Runtime Engine found"
}

Run it from hAC > Console > Scripting Languages and click on the Output tab to see the results. If your SAP Commerce server node is properly configured, the script will return an output similar to this:

SAP Product/Solution Configuration Runtime Engine version is 3.2.21

On the other side, if your SAP Commerce node runs multiple versions of the SAP Product/Solution Configuration Runtime Engine, the script will return an output similar to this:

Multiple versions of SAP Product/Solution Configuration Runtime Engine found: 3.2.24, 3.2.21
Mutliple SAP Product/Solution Configuration Runtime Engine JARs found:
 - file:/[...]/hybris/bin/modules/sap-product-configuration-on-premise-edition/sapproductconfigruntimessc/lib/com.sap.custdev.projects.fbs.slc.ssc-3.2.24.jar
 - file:/[...]/hybris/bin/modules/sap-product-configuration-on-premise-edition/sapproductconfigruntimessc/lib/com.sap.custdev.projects.fbs.slc.ssc-3.2.21.jar

You have then to decide, which version should be retained and remove the JAR(s) for the other version(s).

Limitation

The SAP Product/Solution Configuration Runtime Engine 3.x release  is packaged within a unique JAR including Data Loader. The 2.x release, however, is packaged in 3 different JARs, excluding Data Loader. The script will only detect one of them, the one packaging the IConfigSession interface. Consequently, if the script detects multiple versions of the 2.x release, ensure to remove the unwanted version(s) for all JARs, not only the JAR(s) returned by the script.

Moreover, the script checks only the installation and version of SAP Product/Solution Configuration Runtime Engine installed on the SAP Commerce server node running it. If you have a cluster with multiple nodes, you will have to execute it on each server node.

Conclusion

This little script is a great companion for SAP Commerce administrators running SAP Product Configuration or SAP Solution Configuration. It helps to quickly validate that everything is installed properly, with the right version, in the entire SAP Commerce system and is in particular precious after updating or patching the SAP Product/Solution Configuration Runtime Engine.

Sara Sampaio

Sara Sampaio

Author Since: March 10, 2022

0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x