For most applications, Appian recommends using record types to build with your enterprise data. When you enable data sync on your record types, you can work with a faster, more flexible version of your data using record type relationships, custom record fields, and other sync-enabled features.
However, there are some cases where you may need to use custom data types (CDTs) in addition to your record types:
This page explains what a CDT is and how to create and maintain it.
See also:
A custom data type (CDT) is a designer-defined data structure that represents a logical grouping of related data, such as Employee and Contract. CDTs can be used to read from and write to a database table, to store information within a process, or to define inputs or outputs of a web service or Appian plug-in.
All CDTs can be downloaded and imported as XML Schema Definition (XSD) files. For information about XSDs, see the Supported XSD Elements and JPA Annotations page.
The life cycle of a CDT depends on where the authoritative data structure for your application is designed. See the diagram below for a high-level overview of the most common data type life cycle patterns.
The table below describes the properties for data types. You can edit these properties from the settings menu .
Property | Description |
---|---|
Name | Enter a name that follows the recommended naming standard. Because this name is used in the UUID to uniquely identify the data type across environments and in object references, the name cannot be changed after the CDT has been created. |
Namespace | Formatted as a URI, for example, urn:com:appian:types:COB . Because the namespace is used in the UUID to uniquely identify the data type across environments and in object references, the namespace cannot be changed after the CDT has been created. |
Description | Displayed in data type pickers in the Process Modeler. |
Last Modified | Updated when the data type is created, and every time that the data type is modified. |
Source | Indicates how the data type was created or last modified:
|
Hide this data from auto-complete and pickers |
|
For each field in the CDT, configure the following parameters:
Parameter | Description |
---|---|
Name | The name of the field. Names are case-sensitive and must be unique within an individual data type. |
Type | The data type of the field. The field can be a primitive or custom data type. Other data types are not supported. |
Length | The length constraint of Text type fields. |
Array | A Boolean value specifying whether the field can accept an array of values. |
Key | A value specifying whether the field is the primary key for the table. All data types that map to a database table must have a primary key defined. For more information, see Primary Keys. |
Note: When using multiple application servers, the data type visibility is only updated in the cache of the application server you are logged into. The cache of any other application server is updated upon the next restart. To avoid restarting your application servers, log into each application server individually as this updates the data type visibility in each application server's cache.
Users in the designer role can create data types using the methods described in the following sections.
Note: CDTs are identified by their combined name and namespace. When creating new data types from scratch, an existing CDT (duplicating), or a database table, the name and namespace must be unique. If you create a CDT by importing an XSD file or through a WSDL or Appian plug-in, the name and namespace do not have to be unique. This allows you to update existing CDTs in the system through these methods without having to delete them first.
If you think that you could be accidentally replacing a deleted data type by using the same name and namespace, run impact analysis on the data type after creation to see if any objects depend on a previously deleted data type with the same name and namespace.
Use this option to create and configure a completely new data type.
@Table
annotation, the new data type will also map to the Employee table. If the CDT will be used to read data from or write data to a database table, Appian can generate the database table for you.To create a data type from scratch:
Note: Make sure the Namespace and Name properties are correct. Once you leave this dialog, you cannot edit those properties, because they form the data type's universally unique identifier (UUID).
Use this option when you need to make a CDT that is similar to another CDT. All existing configurations on the original CDT, including any JPA annotations, will be duplicated. For example, if the original data type is mapped to a database table called Employee using the @Table
annotation, the new data type will also map to the Employee table.
To duplicate an existing data type:
Note: Make sure the Namespace and Name properties are correct. Once you leave this dialog, you cannot edit those properties, because they form the data type's universally unique identifier (UUID).
Use this option when you have an existing table or view in the database and need to create a CDT in order to read from and write to that table within Appian. A CDT will be created for you with all the configurations necessary to automatically map to that table.
To create a data type from a database table or view, follow the steps described in Mapping Custom Data Types (CDTs) to Pre-defined Database Tables.
Use this option if you already have an XSD file that defines your CDT. You may also create or edit multiple data types at once by importing a single XSD file that contains multiple data type definitions. If the CDT will be used to read data from or write data to a database table, Appian can generate the database table for you.
To create a data type from an imported XSD:
Use this option to import an XSD defined using a Java object as part of an Appian Plug-in. For more information, see Data Type Plug-ins.
Use this option to import data types from a web service definition language file (WSDL) using the Call Web Service Smart Service or webservicequery() function.
Note: If you think that you could be accidentally replacing a deleted data type by using the same name and namespace, run impact analysis on the data type after creation to see if any objects depend on a previously deleted data type with the same name and namespace.
Custom data types are edited in different ways based on how they were created, how they are configured, and what they are used for. The following table links to reference information for each scenario.
Method or Usage | How to Edit |
---|---|
Mapped to a database table |
|
Generated by WSDL | See the update section on the Call Web Service Smart Service page. |
Generated by Appian plug-in | See the edit section on the Custom Data Types from Java Object page |
Imported with multiple types from an XSD | After making the desired edits in the XSD file, navigate to the application, then import the modified XSD file. |
Before updating a data type, do the following:
Note: The name and namespace of the data type cannot be changed as they form the data type's universally unique identifier (UUID). Deleted types can be replaced from the application when creating a type from scratch or duplicating an existing type.
After updating the data type, a new version is created unless the only change is to the data type description or its visibility in data type pickers. When a new version of a data type is created, all objects (excluding running processes) immediately begin using the new version of the data type.
Tip: Deploying a new version of a plug-in data type will only replace the existing active data type if the plug-in version number is greater than the currently deployed plug-in version.
Data stores that include the updated data type will also immediately begin using the new version. This means that data stores can be negatively affected even if you only add fields, unlike rules and interfaces. To ensure that you do not accidentally invalidate a dependent data store's mapping to the database, you will receive a warning dialog when you attempt to update data types through the following means:
Back-end data type updates (importing an XSD in a patch or application and updating data types through an Appian plug-in) provide logs detailing the effect on dependent data stores, rather than a warning dialog.
If a deleted data type is updated by creating a new data type with the same name and namespace, you will NOT receive a warning about dependent data stores. The data store will immediately begin using the new data type structure, but the underlying database schema will not be automatically updated (even if the Automatically update database schema option is enabled).
While editing your data types, you may encounter design guidance. Appian design-guidance reinforces best practice design patterns that should be implemented in your objects. Design guidance for custom data types are calculated at the following times: while actively editing the data type, while saving the data type, or when a precedent of the data type is updated.
When a recommendation or warning is triggered for a data type, an indicator icon will appear in the header (A) and next to the corresponding field (B).
Click on the icon in the header to learn more about the suggested guidance (C) and how it can be addressed.
If a recommendation is not applicable to your use case, you can Dismiss (D) that individual recommendation for that data type. Learn more about recommendation dismissal. Warnings cannot be dismissed and should always be addressed to avoid complications when the logic in the object is executed.
Data type guidance is also visible outside of data types on the Health Dashboard.
See design guidance for the full list of possible guidance.
When a data type is deleted, it is retained in the system so that objects can continue to function correctly even if referenced data types are deleted. Deleted types, however, will no longer appear in the Appian Designer or as choices in type pickers.
Upon deleting a data type, references to that data type will have a version number appended in the form of a caret (^) + version number. For example: myCDT^1
, myCDT^2
.
Objects that use a deleted data type can be exported and on import, will attempt to reference the most recent version of the data type. If the most recent version of the data type is deleted, import of the dependent object will still succeed. If no data type exists on the destination environment, import of the dependent object will fail.
Note: Appian recommends that you use the Outdated Type References Metrics Log to find all objects that reference deleted data types and remove those references.
There are some configurations for CDTs that cannot be accessed through the data type designer. If you need to modify those configurations, you can download the XSD for the data type and re-import it to create a new version of the data type.
To download the XSD file for a data type, click Download XSD in the settings menu of the data type designer. The following types cannot be downloaded as XSD:
Once you have made the necessary changes to the file, click Create New Version from XSD in the settings menu and upload the new version of the XSD.
When deploying data type edits to a production environment, all design objects will be updated to use the latest version of the data type when it is imported. Dependents of data types only need to be included in the import package if you have made changes to their definitions.
When a package containing data types is imported, only data types that have been changed or depend on a data type that has been changed will be updated.
See also: Deploying Data Types
For details on how data type data are cast, see Casting Custom Data
Variables of simple custom types that extend other simple custom types can be saved into each other because they both extend from a simple system type (like Text).
Variables of custom types that extend other custom types often cannot be successfully used to save data into each other, because of the mismatch of fields. At runtime, any fields of a derived data type that are not present in the parent data type cannot be mapped. If the parent data type is an abstract custom type with no fields, no data can be saved into it. Therefore, it is best to avoid abstract data types and extending data types.
Tip: Unlike most objects, data types do not have their own security role maps. Instead, the security of the object referencing the data type is applied. For example, if an interface calls a data type, then the interface's security is applied.
Only system administrators and designers can perform actions on data types. The following table outlines the data type actions that can be completed by each:
Actions | System Administrator | Designer |
---|---|---|
Create and edit the data type | Yes | Yes |
View the data type | Yes | Yes |
Download the data type's XSD | Yes | Yes |
Delete the data type | Yes | No |
Custom Data Types (CDTs)