GX models

A GX model enables the properties of a data type to be converted to XML. Supported data types that can be converted include Gosu classes and business data entities, among others. A GX model can include all or a subset of an associated data type's properties. Use GX models to limit the transfer of object data to those properties you need or desire to conserve resources and improve performance.

A GX model is a data type that is associated with another data type. The model includes the desired properties of the associated type that will be subsequently converted to XML. A GX model can include all or a subset of the associated type's properties. For example, a GX model called AddressModel can be associated with the Address entity. The definition of the model might include the PublicID and Description properties from Address.

Even though the GX model contains properties of another entity, the internal formats of the model’s properties are undefined. The model’s internal format can change in different PolicyCenter versions. Best practice is not to depend on the internal format of GX model properties. Accordingly, do not access or modify a GX model’s properties. Supported GX model operations include defining and creating models and converting their contents to XML.

GX models are defined in the Studio GX model editor. Using the editor, the properties of a data type are added to the GX model. As the model is defined, the editor automatically generates an XSD schema that specifies the XML structure of the model. Because of this automation, the XML definitions that the editor generates will be valid and do not require further validation.

When configuration code subsequently creates an instance of the GX model, the constructor methods accept an argument of an instance of the data type associated with the model. The properties of the argument that are referenced by the GX model are stored in the new instance. They can be subsequently converted to XML that conforms to the model’s XSD schema. Continuing with the Address and AddressModel example, an instance of the AddressModel is created. The model’s constructor accepts an instance of Address as an argument. The PublicID and Description properties of the argument are stored in the created GX model object. The model properties are subsequently converted to XML using one of the supported conversion methods.

Note: GX models functionality is superseded by Guidewire InsurancePlatform Integration Views.

See also