Document Types
A Document Type contains a set of fields used to define the structure and type of data in a document. You can use a Document Type to specify the input or output parameters for an Integration.
Note: | Integration Cloud also allows you to create Document Types for already created REST Applications from the Applications > REST Application > Document Types link or from the Request Body and Response Body panels while creating a REST Application. Document Types created for a REST Application does not appear in the Develop > Document Types screen but appears in the Document Types panel for the selected REST Application. Document Types for REST Applications are used in the Request Body and Response Body of an Action. See Creating REST Applications for information on REST Resources and Actions. |
Note: | Users who have the required access privileges under Settings > Access Profiles > Administrative Permissions > Functional Controls > Document Types can create, update, and delete a Document Type. |
Document Types can provide the following benefits:

Using a Document Type as the input or output signature for an Integration can reduce the effort required to build an Integration.

Using a Document Type to build document or document list fields can reduce the effort and time needed to declare input or output parameters or build other document fields.

Document Types improve accuracy because there is less possibility to introduce a typing error while typing field names.

Document Types make future changes easier to implement because you can make a change in one place (the Document Type) rather than everywhere the Document type is used.
You can use Document Types to define the input or output parameters for an Integration. Input and output parameters are the names and types of fields that the Integration requires as input and generates as output. These parameters are also collectively referred to as a signature. For example, an Integration can take two string values, an account number (AcctNum ) and a dollar amount (OrderTotal ) as inputs and produces an authorization code (AuthCode ) as the output. If you have multiple Integrations with identical input parameters but different output parameters, you can use a Document Type to define the input parameters rather than manually specifying individual input fields for each Integration.
You can create a Document Type by defining the structure of the Document Type yourself by inserting fields to define its contents and structure.
Note: | When you edit a Document Type, any change is automatically propagated to all Integrations that use or reference the Document Type. |
To add or edit a Document Type
1. From the Integration Cloud navigation bar, click Develop > Document Types. The Document Types page appears.
Note: | You can create Document Types for already created REST Applications from the Applications > REST Application > Document Types link or from the Request Body and Response Body panels while creating a REST Application. |
From the Document Types page, you can add, edit, delete, or copy a Document Type.
2. To edit an existing Document Type, select a Document Type from the Document Types screen and click Edit. Select a field to view the Field Properties panel.
3. To create a new Document Type, from the Document Types page, click Add New Document Type.
4. Provide a name and description of your Document Type. Required fields are marked with an asterisk on the screen.
5. You can click Load XML to generate a Document Type from the XML structure or click Load JSON to generate a Document Type from the JSON structure.
6. Click the
icon to add a new field. You can update the field properties by using the Field Properties window. Provide the Name and Type of the fields in order to define the structure and content of the Document Type. A field can be a String, String list, Document, Document list, Document Reference, Document Reference List, Object, or Object list. If you select Document Reference or Document Reference List, choose Document Reference and if you select Object or Object list, choose Object Wrapper Type. While defining fields of a Document Type, you can specify Integer, Short, Long, Float, Double, and Boolean as types. Fields are used to declare the expected content and structure of Integration signatures, document contents, and pipeline contents. In addition to specifying the name and data type of a field, you can set properties that specify an XML Namespace and indicate whether the field is required at runtime by selecting the Required option.
You can copy a field from the fields panel by clicking the

icon. Depending on the context, you can either paste the field or the field path by clicking the

icon. For example, if you copy a field and paste the field in the
Set Value window in an Integration, the field path will be pasted. If you copy an array item, the path that is pasted includes the item index. For example, if the item that is copied is A/B/C[10], then the pasted path will also include the item index [10]. But if it is pasted in the document tree, it will appear as an array, like A[ ]. If there are multiple fields with the same name in a document, and one of the occurrences of such a field is copied, then the path when pasted will contain the occurrence number in brackets, for example, the path will be A/B/C(5) if the copied element C is the 5th occurrence under field B.
Note: | You cannot modify or paste the child fields of a Document Reference. |
Note: | When defining a Document type, avoid adding identically named fields to the Document. In particular, do not add identically named fields that are of the same data type. |
You can assign an XML namespace and prefix to a field by specifying a URI for the XML namespace property and by using the prefix:fieldName format for the field name. For example, suppose a field is named eg:account and the XML namespace property is set to http://www.example.com. The prefix is eg, the localname is account, and the namespace name is http://www.example.com.
Keep the following points in mind when assigning XML namespaces and prefixes to a field:

The field name must be in the format:
prefix:fieldName
You must specify a URI in the XML namespace property.

Do not use the same prefix for different namespaces in the same Document Type, input signature, or output signature.
7. Click Apply after you have entered the details and constraints for each field, and then click Save to save the Document Type.
The new Document Type appears in the Document Types screen.
Related Topics