Order management & Fulfillment

Order Management & Fulfillment

Come for answers, stay for best practices. All we're missing is you.

 View Only

Accelerating Sterling OMS Development: How to Test/Debug Locally in IntelliJ without Server Deployment

  • 1.  Accelerating Sterling OMS Development: How to Test/Debug Locally in IntelliJ without Server Deployment

    Posted Mon February 23, 2026 11:28 AM

    One of the biggest bottlenecks in IBM Sterling Order Management (OMS) development is the "Wait Time." Traditionally, testing custom Java code-whether it's a Property Provider, a Custom API, or a User Exit-requires a full rebuild and deployment to an Agent or Application Server.

    IntelliJ IDEA can be used to simulate the Sterling runtime, you can execute and debug your code locally in seconds. Here is how to set up your environment

    Pre-Requisites

    • Ensure you have the Foundation folder available locally. You can copy this directly from your dev environment (provided it is accessible and your company's policy allows) to a path such as <INSTALL_DIR>/FoundationV10

    Step 1: Configuring the Project Structure (Classpath)

    We need to ensure IntelliJ recognizes the Sterling engine and your custom logic.

    1. Open Project Structure (Ctrl+Alt+Shift+S) > Modules > Dependencies.

    2. Add Sterling Jars: Add all necessary OOB and Custom Jars from your codebase.

    3. Map Properties: Add your <INSTALL_DIR>/properties folder as a dependency.

    4. Map Foundation: Add the <INSTALL_DIR> directory itself.

    5. Prioritize Resources: > Crucial Step: Move resources.jar to the very top of the dependencies list. This ensures that the engine picks up the correct configuration files during initialization.

    Step 2: Creating the Run/Debug Configuration

    Instead of running an Ant script, we will create a standard Java Application configuration.

    • Main Class: Point this to your specific Test Class or the logic you are validating.

    • Working Directory: Set this to your local <INSTALL_DIR>/FoundationV10.

    • Program Arguments:

      • -class com.yantra.integration.adapter.IntegrationAdapter -f <INSTALL_DIR>/properties/AGENTDynamicclasspath.cfg

        <response-element class="" ng-version="0.0.0-PLACEHOLDER"></response-element>

    Step 3: JVM Bootstrapping (VM Options)

    This is the "Secret Sauce" that tricks the code into believing it is running inside a Sterling container. Copy these into your VM Options field (replacing <INSTALL_DIR> with your path):

    <response-element class="" ng-version="0.0.0-PLACEHOLDER"></response-element>

    -Dvendor=shell
    -Dyfs.instance=dev
    -Dyfs.home=<INSTALL_DIR>
    -DINSTALL_DIR=<INSTALL_DIR>
    -DRESOURCES_DIR=<INSTALL_DIR>/resources
    -Dsci.op_env=local
    -DvendorFile=<INSTALL_DIR>/properties/servers.properties
    -Dyfs.logging.defaultLevel=VERBOSE
    -Dyfs.logall=Y
    -DLOG_DIRECTORY=<INSTALL_DIR>/logs
    -DDLOCK_LOG_DIR=<INSTALL_DIR>/logs
    -Djava.io.tmpdir=<INSTALL_DIR>/tmp
    -Dfile.encoding=UTF-8
    -Dnet.sf.ehcache.skipUpdateCheck=true
    -Djava.util.Arrays.useLegacyMergeSort=true
    -DDISABLE_DS_EXTENSIONS=Y
    -Djavax.net.ssl.trustStoreType=jks
    -Djavax.net.ssl.trustStore=<INSTALL_DIR>/jdk/jre/lib/security/cacerts

    public class OMSTest2 {
    
        public static void main(String[] args) {
            try {
                YIFApi api = createApi();
                YFSEnvironment env = createEnvironmentObject(api);
    // Once environment is created you now you can invoke API/Service 
    //            Document docOut = api.invoke(env,"getCommonCodeList", docInput);
    
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    
        public static Document convertStringToDocument(String xmlString) throws Exception {
            DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
            DocumentBuilder builder = factory.newDocumentBuilder();
    
            InputSource inputSource = new InputSource(new StringReader(xmlString));
            Document document = builder.parse(inputSource);
    
            document.getDocumentElement().normalize();
    
            return document;
        }
    
    
        private static YIFApi createApi() throws YIFClientCreationException {
            YIFApi yifapi = null;
            yifapi = YIFClientFactory.getInstance().getApi();
            return yifapi;
        }
    
        private static YFSEnvironment createEnvironmentObject(YIFApi api) throws Exception {
            String envString = "<Environment userId=\"<userid>\" progId=\"<ProgId>\"/>";
            return api.createEnvironment(convertStringToDocument(envString));
        }
    
    }


    ------------------------------
    Sudheer Chadalavada
    ------------------------------