13.1 Description
EXPRESS information models contain rules and constraints that that applications can use to test data sets for correctness. This prevents the propagation of incorrect data from one application to another.
The STEP Conformance Checker can evaluate EXPRESS rules and constraints to verify databases defined by the STEP application protocols. It can examine every object in the database and determine whether it complies with the rules and constraints defined in the application protocol EXPRESS model.
13.2 Command Line (All Platforms)
apconform [options] <data-file>
If no options are selected, the tool will perform all constraint checks. If options are provided, the tool will only perform the requested checks. The options accepted by apconform are:
-help- Print this list of options and exit.
-all- Verify everything. This is the default behavior.
-bounds- Check aggregate bounds.
-unique- Check uniqueness rules.
-inverse- Check inverse attributes.
-atttypes- Check attribute types.
-aggruni- Check aggregate uniqueness constraints.
-arrnotopt- Check for mandatory array elements.
-strwidth- Check string widths.
-binwidth- Check binary width.
-quiet- Report only constraints that fail. Without this option, the tool also reports constraints that are unknown.
-realprec- Check real number precision.
-refdom- Check attribute reference domain.
-rules- Evaluate all of the global rules.
-rule <name>- Evaluate the global rule called <name> .
-required- Check required attributes.
-syntax- Only check the syntax of the exchange file. Syntax checking is always done, but specifying this option turns off any other checks.
-type <name>- Check only entities of type <name> .
-verbose- Report the status of all constraints whether passed, failed or unknown. Without this option, the tool does not print messages for constraints that pass.
-where- Check entity where rules.
13.3 Control Panel (Windows Only)
The STEP Checker control panel is shown in Figure 13.1. You can invoke this by selecting the STEP Checker icon in the ST-Developer Control Panel. When you run the checker, messages will be shown in the output box in the ST-Developer control panel or Visual Studio output windows.
The checking process may take some time, depending on file size, constraint complexity, and the amount of checking you request. The following sections describe the many options available for customizing your results.
13.4 How to Check STEP Files
The first thing to do is to make sure you are using the best tool for the job! If your data files are based on AP-203 or AP-214, consider using the specialized checkers instead. See AP-203, AP-209 and AP-214 Conformance Checkers for details. The specialized tools are faster and also know extra constraints, like STEPnet vendor agreements and recommended practices.
Otherwise, the General STEP Conformance Checker is the most appropriate tool. The conformance checker needs the data dictionary files ( <schema>.rose ) and precompiled parse data files ( <schema>_EXPX.rose ) for your EXPRESS schema.
If these files are not present in the ST-Developer systems_db/schemas area, you must generate them. Use the EXPRESS compiler control panel or call the compiler on the command line:
% expfront -rose [options] <express_file_name>
See How to Generate Data Dictionary and Precompiled Schema Information for more information. For best results, copy the dictionary and parse data files to the ST-Developer systems_db/schemas area so that they are available to all applications. Now you can invoke the testing tool:
Checking File Syntax
The first time you process a file from a new exchange partner, you should start by just verifying the file syntax. This quickly identifies larger issues such as missing schemas or malformed records without trying to do more detailed analysis. From the command line, call the checker with the -syntax option:
% apconform -syntax datafile.stp
To check the syntax of a data file from the ST-Developer control panel:
- Double-click the STEP Checker icon in the control panel to display the STEP Conformance Checker dialog box.
- Type the name of the data file in the File name field, or click the [...] button to browse the disk.
- Select the Syntax only box in the Check area.
- You may click OK to start the checker.
Once you have made sure that the Part 21exchange file is free of any basic formatting errors, you can perform more detailed analysis of the contents.
Checking Data Sets in Detail
Once you are satisfied that your data is syntactically correct, you can start checking the EXPRESS rules and constraints. You can check everything at once, which may take some time, or you can select individual constraints to check.
From the command line, call the checker as shown below. If you specify some options, the tool will perform just those checks, otherwise it will perform all possible checks.
% apconform [options] datafile.stp
To check a file in detail from the ST-Developer control panel:
- Double-click the STEP Checker icon in the control panel to display the STEP Conformance Checker dialog box.
- Type the name of the data file in the File name field, or click the [...] button to browse the disk.
- Select the Syntax and options box in the Check area, then select any combination of constraint checks in the area below.
- You may click OK to start the checker.
The checker prints the status of constraints as they are checked. You can control this with the options in the Report area. The Everything option prints the status of each constraint as it is checked. The Failed and unknown and Failed only options print a message only if the constraint evaluates to the desired value.
If you are testing the output from one of your own applications, you will probably be concerned with specific entity types or constraints. You can fine tune the constraints and types that the tool will examine with the following options.
The Bounds option checks the size of aggregates against the upper and lower limits specified in the EXPRESS. On the command line, this is controlled by the -bounds option.
The Derived attributes option evaluates derived attributes. The Inverse attributes option evaluates inverse attributes. On the command line, these are controlled by the -derived and -inverse options.
The Global rules option evaluates all of the global rules specified in the EXPRESS. On the command line, this is controlled by the -rules option. You can also use the Only this rule field to select an individual rule for checking. On the command line, you can specify the -rule option with a rule name.
The Required attributes option checks whether each attribute either has a value or has been declared optional by the schema. On the command line, this is controlled by the -required option.
The Where rules option evaluates the local "where" rules specified as part of entity definitions. On the command line, this is controlled by the -where option.
You can use the Only this type field to select an individual entity type for checking. On the command line, you can specify the -type option with a type name.
The Aggregate uniqueness option checks that sets and any other aggregates declared to have unique elements do not contain any duplicates. On the command line, this is controlled by the -aggruni option.
The Mandatory array elements option checks whether all arrays elements either have values or have been declared optional by the schema. On the command line, this is controlled by the -arrnotopt option.
The Length of strings option checks the values of string attributes against any length constraints specified in the EXPRESS. On the command line, this is controlled by the -strwidth option.
The Width of binaries option checks the values of binary attributes against any length constraints specified in the EXPRESS. On the command line, this is controlled by the -binwidth option.
The Real number precision option checks the values of REAL attributes against any precision constraints specified in the EXPRESS. On the command line, this is controlled by the -realprec option.
The Attribute reference domain and Attribute types options rerun some syntax checks that are also performed when the data set is first read into the tool. On the command line, these are controlled by the -refdom and the -atttypes options.