When working with domain models, sometimes it is useful to know the differences between different models.
The Compare Model Tool compares two model files and generates a model that shows the differences between them.
To use the Compare Model Tool, simply run the compareModel shell script with the correct arguments. To see the list
of valid arguments, simply run the shell script with the -help option (or with no arguments) for usage information.
Model Path: resources–>JMSSystemResource–>MyJmsModule–>JmsResource–>UniformDistributedQueue–>MyUniformDistributedQueue–>ResetDeliveryCountOnForward does not exist in new model but exists in previous model
Model Path: appDeployments–>Application–>myear–>ModuleType does not exist in new model but exists in previous model
Comparing the new and old models:
Added cluster-2 and cluster-2-template in the topology section.
Removed ServerStart of cluster-1-template in the topology section.
Deployed two applications yourear and myear in the appDeployments section.
Removed application myear in the appDeployments section.
Removed MDBConnectionFactory from the MyJmsModule JMS Module in the resource section.
Removed WebAppContainer in the resource section.
Removed the attribute ResetDeliveryCountOnForward from MyUniformDistributedQueue.
Changed deployment targets for application myear.
Removed the attribute ‘ModuleType’ for application myear.
Note
The ! is a notation for the deletion of a non-attribute key element from the model. Missing attributes
will be omitted from the resulting model, but shown as messages in the output. If the attribute value is a list, even
if all the individual items within the list are identical but the ordering is different, the attribute is counted as
different.
To compare the two model files and generate the output to files, run the tool as follows:
$ weblogic-deploy\bin\compareModel.cmd -oracle_home c:\wls12213 -output_dir c:\cm-output new_model.yaml old_model.yaml
The following files will be written to the directory:
diffed_model.json
diffed_model.yaml
compare_model_stdout
Environment variables
The following environment variables may be set.
JAVA_HOME The location of the JDK. This must be a valid Java 7 or later JDK.
WLSDEPLOY_PROPERTIES System properties that will be passed to Java.
Since the Compare Model Tool uses Jython directly without using WLST, the JAVA_HOME will be the JDK used to execute
the command (unlike other tools that use WLST).
Parameter table for compareModel
Parameter
Definition
Default
-oracle_home
Home directory of the Oracle installation. Required if the ORACLE_HOME environment variable is not set.
-output_dir
(Required) Directory in which to store the output.