MBuild — JDA/RedPrairie

Jawad Khan
3 min readJan 7, 2020

--

MBuild, or MOCA Build — that’s what I call it, is one of the JDA WMS core applications/utilities used for server side purposes. In Windows, it would be an exe file under %MOCADIR%/bin but in actual, it is a Java class which is called when a user executes the mbuild command.

Purpose

Primarily mbuild is used to build the MOCA memory file (.mem). This file contains information and references to all commands which are under src/cmdsrc directory.

One important thing is mbuild will only scan src/cmdsrc directories for those Product Directories which are defined in Registry with key server.prod-dirs. If there is no Product Directory, mbuild will throw an error as “ERROR: No product directories are defined in the registry.”

When mbuild gets the list of Product Directories, it will start scanning each command repository under src/cmdsrc and will look at each and every .mcmd & .mtrg file (Commands & Triggers). mbuild will start with validating command repositories and then commands and triggers. When this process is complete, a summary will be displayed.

If mbuild finds any issue with any command, trigger or repository level, either it will be displayed as a WARNING, or an ERROR depends on the nature and severity i.e. Referenced command not found. For further mbuild errors and warnings, you can refer to the MOCA Developers Guide.

How to use

Open Windows Command Prompt, navigate to %LESDIR%/data, or %LESDIR% depends on where the env.bat file is located. Run env.bat file and then type mbuild -h in Command Prompt. It will display the usage of mbuild and all relevant arguments/flags.

mbuild arguments

If you just made changes to a command file or a trigger, then you can simply run mbuild, nothing more to build the Memory file.

Flags

  • l: using this flag, you can see the current command information
  • d: using this flag, mbuild will create HTML based documentation for the command repositories
MOCA commands documentation
MOCA commands documentation — browser
  • pDir: If this argument is provided, mbuild will create the HTML based documentation for MOCA commands/triggers in the user provided directory or else in default directory %LESDIR%/docs
  • Ddepth: Administrator/User can control the depth of MOCA command pipes and mbuild will show a warning message if the count goes beyond the defined number

Customize MOCA Commands Documentation Style

HTML based MOCA documentation style can be customized by modifying the xsl files in %MOCADIR%/docs. Once you make changes to these files, create the documentation again using mbuild -d command and you should see the changes you’ve made to the style in the output using browser.

--

--

Jawad Khan

JDA/RedPrairie | Java - Feel free to reach me out if you have any query, or problem related to Java, JavaScript, SQL, Ext JS, MOCA - jawadafridi223@gmail.com