This documentation supports the 20.02 (12.0) version of BMC Discovery.

To view an earlier version of the product, select the version from the Product version menu.


Simple import statements take the following form:

from module import name version;

This declaration makes the named declaration in the specified module available. Module names are dot-separated sequences of names. All imports are absolute, not relative to the importing module's name. For example, the declaration

from a.b.c import Example 1.0;

finds a module named "a.b.c" and imports the item (pattern, for example) with the name "Example".

Multiple named declarations can be accessed in one statement by separating them with commas:

from a.b.c import Example 1.0, Another 2.3;

Imported names must not clash with other names declared or imported in the same file. To avoid clashes, declarations can be renamed on import using an as clause:

from one import Example 1.0;
from two import Example 2.3 as ExampleTwo;

When importing, it is not immediately an error to import a name that is not defined in the corresponding module, or to import from a non-existent module. It only becomes an error when the imported name is used in a context that requires it exists. In particular, when a pattern overrides another pattern (see the section on overrides), it is not an error if the overridden pattern does not exist. For all other uses of an imported name, it is an error if the import fails.

Imported names are not available for further import. So, for example, if module B imports X from module A, module C cannot import X from B - it must import it directly from A.

Version compatibility

If there is an updated version of the selected object (for example, pattern or definition), the system will check your module containing the import to ensure that the minimum requirements are still met. For example, if you import version 1.1, this will allow the imported object to be 1.1, 1.2, and so forth, but NOT allow versions 1.0, 2.0, 2.1, 3.0, and so forth. The major version must be the same and the minor version must be at least the same as the version specified. If the version is not supported, the activation fails.

Most of the time, you will not need to update the import version. It might be necessary only if either there is an incompatible change in the imported pattern (represented by a major version change), or if you modify your pattern so that is relies on additional behaviour of the updated pattern. See Pattern overview for more information about how patterns are versioned.


Patterns contain tags that have information about the most recent Technology Knowledge Update (TKU) that updated the pattern (for example, TKU_2010_04_01). Therefore, you can perform a search for a specific TKU version to find patterns that were last changed in a specific version of TKU. Typing that value in the search box displays a list of patterns (and the containing pattern modules).

Version numbers

All top-level declarations are specified with a version number in major.minor format. When importing declarations, the version number must be specified. It is an error if the declaration imported is not compatible with the version specified in the import statement. The versions are compatible if the major number is identical and the minor number is at least as large as the requested version. So, for example, in

from test import Example 2.3;

the "Example" declaration from the "test" module is compatible if it has version 2.3 or 2.4, but not if it has version 2.2, 1.8 or 3.0.

Circular imports

Circular imports are not permitted. It is an error for file B to import from file A when file A is still being processed.

Was this page helpful? Yes No Submitting... Thank you