Document Types

What is a document type?

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 a flow service. Input and output parameters are the names and types of fields that a flow service requires as input and generates as output. These parameters are collectively referred to as a signature.

For example, a flow service takes 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 flow services 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 flow service.

Benefits of creating a document type

Document types provide the following benefits:

  • Using a document type as the input or output signature for a flow service reduces the effort required to build a flow service.

  • Using a document type to build document or document list fields reduces 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 make a change at one place (the document type) rather than everywhere the document type is used.

How do I create a document type?

You can create a document type in the following ways from Projects > select a project > Configurations > Flow service > Document Types > Add Document Type :

Build from scratch

Create an empty document type and define the structure of the document type yourself by inserting fields to define its contents and structure. For more information, see Creating Document Types from an XML Schema Definition.

You can also create document types for already created REST connectors from Projects > select a project > Connectors > REST > Document Types option or from the Request Body and Response Body panels while creating a REST connector.

Document types created for a REST connector do not appear in the Projects > select a project > Configurations > Flow service > Document Types page but appears in the Document Types panel for the selected REST connector.

Note: Creation of document type with identical names are not allowed.
  • Copying or pasting data fields from document types is only allowed in flow services, not in deploy anywhere flow services.
  • You can copy a document type from the Document Types page or from the Document Type page for a REST connector. Currently you cannot copy a document type across projects. When you copy a flow service or a Workflow across projects, the document type associated with it is also copied.
  • If a document type is used in any other document type or a flow service, you cannot delete the document type and a warning message appears as follows:

Other than direct dependencies, if there are document types that are created along with the selected document type from the same xsd source, and if any of these documents types are used in any flow services or document types (other than these generated document types), then also you are not allowed to delete the document type.

Build from SAP®

Create a document type from an SAP RFC structure or SAP IDoc, that matches the structure of the document and content of the SAP RFC structure or SAP IDoc respectively. For more information, see Creating a new Document Type from SAP®.