Comparing a Schema with the Baseline

After creating the baseline for one of the schemas, use the MQL compare command to analyze the differences between the baseline and the second schema and generate a report that lists the differences.

When issuing the compare command, make sure you start MQL using a bootstrap file that points to the database that you want to compare with the schema for which you created the baseline. The compare command analyzes only administrative objects and ignores any business object instances in the baseline export file. Where unordered lists are used, their order resulting from a query is not guaranteed. This may potentially yield false differences during compare. Unexpected differences reported on unordered list items should be verified by examining the log or command output.

For more information, see MQL Command Reference: compare Command.

This page discusses:

Log File

If you specify a log file in the compare command, the compare operation generates a report that lists all objects analyzed and the changes. The report format is simple ASCII text. The report contains enough information to enable an expert user to write MQL scripts that apply the changes to a database.

Below is a sample of a report with the main sections of the report indicated. Each section of the report is described below:

Report Output Description
A map file was not given. 
An exclude file was not given. 
Input baseline file:
     'd:\enoviaV6R2011\studio\xml\person1.xml'. 
Type = 'person', Name Pattern = 'Joe C*', 
    Workspace 'included'. 
Start comparison 'Wed Jun 21, 2000 3:57:09 PMEDT' 
Baseline version was '9.0.0.0'. 
Current version is '9.0.0.0'. 
====================
Preamble

Lists the clauses and options used in the compare command, the time of the operation, and software version numbers.

====== 'person' 'Joe Consultant'====== 
====== 'person' 'Joe Chief_Engineer'======
Object banner

Each object analyzed is introduced with a banner that includes the object type and name wrapped by "=" characters.

 ------ 'query' 'ECR's in Process'------
------ 'set' 'Products' ------
Sub-object banner

Each sub-object analyzed for an object is listed under the object banner. The sub-object banner includes the sub-object type and name wrapped by "-" characters. In the above example, only one object, Joe Chief_Engineer, has sub-objects, which in this case is a query and a set.

businessObjectRef objectType 
     'Assembly Work Instruction' 
     objectName 'WI-300356' objectRevision 'D' 
     has been deleted. 
businessObjectRef objectType 
     'Assembly Work Instruction' 
     objectName 'WI-300356' objectRevision 'C' 
     has been added.
Change Analysis
  • If no changes are found, then no analysis lines appear. The next line is the banner for the next object/sub-object or the summary section.
  • If the object (sub-object) has been added, then the following line appears: "Has been added."
  • If the object (sub-object) has been deleted, then the following line appears: "Has been deleted."
  • If the object (sub-object) has been changed:
    • If a field has been added, then the following line appears: "FIELD has been added."
    • If a field has been deleted, then the following line appears: "FIELD has been deleted."
    • If a field has changed, then the following line appears: "FIELD has been changed."

      where FIELD is in the following form: FIELDTYPE ['FIELDNAME'] [SUBFIELDTYPE ['FIELDNAME']] ... and FIELDTYPE identifies the type of field using tags found in the ematrixml.dtd file, and FIELDNAME identifies the name of the field when more than one choice exists.

The best way to identify the field that has changed is to traverse the XML tree structure, looking at element names (tags) and the value of any name elements (placed in single quotes) along the way. Use the ematrixml.dtd file as a roadmap. Element names never have single quotes around them, and values of name elements always have single quotes around them. This should help parsing logic distinguish between the two.

End comparison 'Wed Jun 21, 2000 3:57:11 PMEDT' 
0 objects have been added. 
0 objects have been deleted. 
1 objects have been changed. 
4 objects are the same.
Summary

The final section of the report contains a timestamp followed by the same summary that appears in the MQL window.

Verbose Mode

Turn on verbose mode to see more details in the report for changed objects/sub-objects. To see these additional details, make sure you turn on verbose mode before issuing the compare command.

Verbose mode does not produce additional information if an object has been added in the above description or deleted. To get more information about an added object, use a print command for the object. To gather information about a deleted object, look at the XML export file used for the baseline.

When the operation finds changes to objects, verbose mode adds text as follows:

  • If a field has been added, the keyword "new" appears followed by VALUE.
  • If a field was deleted, the keyword "was" appears followed by VALUE.
  • If a field was changed, the keywords "was" and "now" appear, each followed by VALUE.

    where VALUE is either the actual value (in single quotes) or a series of name/value pairs (where the value portion of the name/value pair is in single quotes).

Here are some sample messages that would appear in the change analysis section if the compare operation finds that an object has changed and verbose mode is turned on:

field fieldType 'select' has been added.
	new absoluteX '0' absoluteY '0' xLocation
		'382.500000' yLocation '36.000000' width
		'122.400002' height '24.000000'
		autoWidth '0' autoHeight '0' border '0'
		foregroundColor 'red' backgroundColor ''
		fieldValue 'name' fontName 'Arial Rounded MT
		Bold-10' multiline '0' editable '0'

field fieldType 'select' has been deleted.
	was absoluteX '0' absoluteY '0' xLocation
		'382.500000' yLocation '36.000000' width
		'122.400002' height '24.000000'
		autoWidth '0' autoHeight '0' border '0'
		foregroundColor 'red' backgroundColor ''
		fieldValue 'name' fontName 'Arial Rounded MT
		Bold-10'

width has been changed.
	was '795.0'
	now '792.0'

Comparing Person Objects

The MQL command results do not include the default users creator and guest when you export all person objects with:

export person * xml into file /temp/person.xml;

So if you then compare this exported file to another schema, even if the same Person objects exist, the compare output will show that 2 objects have been added. For example:

compare person * from file
/temp/person.xml use log person.log;
2 objects have been added.
0 objects have been removed.
0 objects have been changed.
172 objects are the same.

The log will show:

 ....
====== 'person' 'guest' ======
Has been added.
====== 'person' 'creator' ======
Has been added.