Actions related to harvesting and expanded are processed through NsxPrimeRunner.

The runner is invoked through a helper script handling the proper java invocation.

<NSF_ROOT>/repositories/nsx/prime/nsf.bat <command> [options]

Automatic Dependency Provisioning

Dependencies necessary for expansion are stored in <NSF_ROOT>/repositories/nsx. Nsx-Prime will automatically find and use the proper version based on your expansion settings.

If a dependency is missing (e.g. using an older version of expanders), NsxPrime will try to automatically retrieve the desired version from our nexus server.


To expanding an application, use expand command and provide link to expansionSettings.xml.

nsf expand --expansionSettings conf/expansionSettings.xml [options]

To further specify what should be expanded, you can utilize expansion goals, e.g.

nsf expand --expansionSettings conf/expansionSettings.xml --only finder tutorialComp.Invoice

If no expansionSettings option is passed, nsx-prime will default to ‘conf/expansionSettings.xml’.

Experimental Expansion Options

Exporting these environment options before expansion


Injected feature methods with group option (hook:methods(group : "<groupName>"):start) will be surrounded by <editor-fold> comment collapsable within Intellij. Has no impact on code behavior.


  // <editor-fold desc="Commands">

  // ========== Commands ==========

  public void execute() { ... }

  // </editor-fold>


Inject additional trace information to the expanded artifact.

Regular expansion example:

// expanded with version 4.0.0

class MyArtifact {

  // @anchor:methods:start
  public void methodFromAlpha() { }

  public void methodFromBeta() { }
  // @anchor:methods:end

Trace expansion example:

// Expander: <expander responsible for this artifact>
// expanded with version 4.0.0

class MyArtifact {

  // @anchor:methods:start
  // @feature:AlphaFeature:start
  public void methodFromAlpha() { }
  // @feature:AlphaFeature:end
  // @feature:BetaFeature:start
  public void methodFromBeta() { }
  // @feature:BetaFeature:end
  // @anchor:feature-anchor:end


Harvesting is similar to expansion.

nsf harvest --expansionSettings conf/expansionSettings.xml [options]

Similarly to expand, you can use expansion goals to harvest only specific artifacts.

XML Validation

Validate model XML files according to XSD schemas.

nsf validate-xml [locations] [options]

The location(s) are processed recursively if you provide directories instead of files.

By default, the validation result will printed to standard output in YAML-like format. Note that machine-readability of the YAML is currently not guaranteed.

Alternatively you can specify --junit junit-output.xml option to store the result in a JUnit XML format file; practical for automated build pipelines.

NOTE Your model XML files do not need to contain XSD references. In such a case the latest XSDs are automatically used.

Current XSDs

XML Namespace is http://nsx.normalizedsystems.org/${xsd.version}/{element.name}. For example http://nsx.normalizedsystems.org/20195/dataElement. However neither export from PrimeRadiant, nor the Modeler currently embed it to the XML itself.

You can find the XSD files in net.democritus.elements.validation package of <NSF_ROOT>/repositories/nsx/elements-ioxml/elements-ioxml-*.jar. Alternatively they are available online at: https://nsx.normalizedsystems.org/xml/20195/dataElement.xsd

Complete file header example:

<dataElement name="Person" xmlns="http://nsx.normalizedsystems.org/20195/dataElement"
             xsi:schemaLocation="http://nsx.normalizedsystems.org/20195/dataElement https://nsx.normalizedsystems.org/xml/20195/dataElement.xsd">