Enable CI/CD for object types
The Xperience CI/CD functionality allows you to serialize the data of objects from the database into XML files and then use a source control system to synchronize the files between different instances. Though the configuration options and API members covered on this page strongly imply relation to only Continuous Integration, the setup ensures support for BOTH Continuous Integration and Continuous Deployment.
To configure CI/CD support for an object type:
Edit the generated Info class representing the object type.
Important: To use CI/CD, the code of your custom object type must be located in a separate assembly. See Integrate custom code for more information.
Set the
ContinuousIntegrationSettings
property in the initializer of theTYPEINFO
member.- Set the
Enabled
property totrue
. - (Optional) Set other ContinuousIntegrationSettings properties according to the requirements of your class’s data.
- Set the
// Enables Continuous Integration for the object type
ContinuousIntegrationSettings =
{
Enabled = true
},
- (Optional) Set the
SerializationSettings
property of theTYPEINFO
member. Use a nested initializer to configure the SerializationSettings properties. - Save the changes.
If Continuous Integration is enabled, the system now tracks all create, update and delete operations for objects of the given custom class and serializes the data into XML files in the repository folder. To transfer all existing data of the class into your repository, run complete serialization for all objects.
You can also use your custom object type’s name (the value of the OBJECT_TYPE
constant) when filtering objects within the repository configuration file.
Deleting object types that have CI/CD enabled
Use the following process if you ever need to delete an object type with existing data and CI/CD enabled:
- First, delete the given type’s code files and rebuild the containing assembly (or remove the entire assembly if it is no longer needed).
- Delete the object type in the Modules application in the Xperience administration.
- Manually delete the folder representing the type’s data from the repository folder (the system automatically removes the data from the database but cannot clear the Continuous Integration data).
References
The reference lists the ContinuousIntegrationSettings
and SerializationSettings
properties that are intended for public use. The classes also contain other members that are used internally or handled automatically by the system. We do not recommend working with any of the undocumented members.
ContinuousIntegrationSettings
Property | Type | Description |
Enabled | bool | Indicates whether the class is included in CI/CD (when serializing all objects to the file system and tracking object changes). Child classes are included only if the property is also enabled for the parent class. |
DependencyColumns | ICollection<string> | Defined as an ICollection of column names. When the values of the specified columns are changed for an object, Continuous Integration reserializes the given object and all of its child or otherwise dependent objects. Only needs to be set for classes that use non-standard columns to determine the identity of objects. The object type’s code name, GUID, parent ID, and group ID columns are included by default. |
ObjectFileNameFields | ICollection<string> | Overrides the names of the XML files containing the serialized data of the class’s objects within the repository folder. By default, the XML files are named according to the value stored in The property is defined as an Note: For CI/CD to work correctly, the combination of columns must be unique within the appropriate scope (within the objects under a specific parent, etc.). |
ObjectTypeFolderName | string | Sets the name of the folder that stores the XML files containing the serialized data of the class’s objects within the repository folder. If not specified, the object type name ( |
SeparatedFields | IEnumerable<SeparatedField> | Identifies columns that CI/CD stores into separate files when serializing objects to the file system. The separated file is created within the same folder as the main XML file holding the remaining serialized data of the object. Define separated columns within an Note: If the class has a column that stores binary data (specified in |
ContinuousIntegrationSettings =
{
Enabled = true,
// Adds a field that CI/CD serializes into a separate file (in addition to the BinaryColumn field)
SeparatedFields = new List<SeparatedField>
{
new SeparatedField("SeparatedField")
{
FileName = "CustomFileName",
FileExtension = ".txt"
}
}
}
SerializationSettings
The SerializationSettings
property of ObjectTypeInfo
determines how the system serializes class objects from the database into XML data.
Property | Type | Description |
ExcludedFieldNames | ICollection<string> | Allows you to limit which fields are included when serializing objects of the given class to XML. Defined as an By default, the system automatically excludes the database columns identified by the following properties:
|
StructuredFields | IEnumerable<IStructuredField> | Identifies fields that contain structured data that cannot directly be serialized as inner text values of an XML element. The default implementation handles columns that store structured data as XML with simple values and a fixed order of elements. To work with custom formats or advanced XML schemas, you need to create an |
SerializationSettings =
{
// Adds two fields to the default collection of fields that are excluded from the serialized data
ExcludedFieldNames = { "ClassField", "ClassSecondField" },
// Ensures that the system processes "ClassXmlField" as nested XML in the serialized data
StructuredFields = new IStructuredField[]
{
new StructuredField("ClassXmlField")
}
}