Migrating customized applications to next-generation Order Hub

If you have existing applications that you have customized in Order Hub, you will need to migrate those customized applications to the next-generation Order Hub environment.

Procedure

  1. Extract the next-generation Order Hub code. For more information, see Getting started with customizing next-generation Order Hub.
    Note: The version parameter for the om-compose.sh extract-orderhub-code command must be oms to extract the next-generation Order Hub code. The version parameter omoc is not applicable to next-generation Order Hub.
  2. Open a console and go to the next-generation Order Hub code directory. The default location is devtoolkit_docker/orderhub-code.
  3. To bypass the SSL verification for interactions with registries, set strict-ssl to false by running the following command.
    npm config set "strict-ssl" false
  4. Access the module that contains the customizations that you want to migrate.
    For example, if you want to update the order module, then go to the buc-app-order folder.
    cd devtoolkit_docker/orderhub-code/buc-app-order
  5. Copy the /angular.json file from the existing customization.

Note: Do not copy the overrides.json or the module package.json files from the existing customization.

  1. Open the overrides.json file at the root of the module/folder. For example, devtoolkit_docker/buc-app-order/overrides.json.
  2. Update the routes for the pages that you are customizing by setting runAsCustomization to true.
    For example, if you want to edit the Order search page, set order-search to true.
        "order-search": {
          "runAsCustomization": true
        },
  3. For each route, copy the src/app and src/assets folders and any other custom code from the existing customization.

Note: Do not copy the src/environments folder from the existing customization.
Note: Do not copy the route package.json file from the existing customization.

  1. Copy the environments folder from <module-name>/packages/<route-name>/src into <module-name>/packages/<route-name>/src-custom.
    For example: Copy the environments folder from buc-app-order/packages/order-search-result/src into buc-app-order/packages/order-search-result/src-custom.
  2. Go to the <module-name>/packages/<route-name>/src-custom/environments directory.
    For example: buc-app-order/packages/order-search-result/src-custom/environments.
  3. Add the following line to the end of both the environment.ts and envrionment.prod.ts files.
    environment.customization = true;
  4. If next-generation Order Hub containers are not currently running, go to the devtoolkit_docker/compose directory and run the following command.

./om-compose.sh start orderhub

  1. Start the server by entering the following command.

yarn start-app
Note: You see the following message.
"** Angular Live Development Server is listening on localhost:<port>, 
open your browser on https://localhost:<port>/<module>/<route> **"
You can ignore this message.
Note: You see the following warning message.
"MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 close listeners added to [Server]. Use emitter.setMaxListeners() to increase limit"
You can safely ignore this warning. It appears that all of the modules started correctly.
Note: If you encounter an error similar to the following, you can ignore this message.
"Fatal: not a git repository" 
Note: If you encounter an error similar to the following message, increase the heap size before you start the new application.
Error command failed with exist code 134.
lerna ERR! yarn run start .... exited 134
Run the following command and then start the new application.
  • Windows CMD prompt:
    SET NODE_OPTIONS=--max_old_space_size=8048
  • Bash/Git Bash:
    export NODE_OPTIONS=--max_old_space_size=8048
  • Powershell:
    $Env:NODE_OPTIONS=--max_old_space_size=8048
If you need to stop the server, stop the server job and run the yarn stop-app command to verify that everything is stopped properly.

  1. To accept the self-signed certificate in the web browser, in a browser, open a tab to https://localhost:<port> and accept the certificate. Replace <port>with the applicable port number for the module that you are customizing.
    For example, for the buc-app-order module, the default port number is 8300.

Note: To accept the certificate, it is now https://localhost:<port> instead of https://bucgenerichost:<port>.

  1. Start next-generation Order Hub by opening a tab in a browser to https://localhost:7443/order-management. The default port is 7443. If you set the OH_BASE_HTTPS_PORT property in the devtoolkit_docker/compose/om-compose.properties file, use that port number.
  2. View your customizations. For more information, see Testing existing module customizations in next-generation Order Hub.

What to do next

Prepare for deployment, then build, test, and deploy your customizations. For more information , see Deployment process.