Overview
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 FlowService. Let us see how to create a document type from an XML Schema Definition (XSD) and then use the document type to create Accounts in Salesforce CRM.
Before you begin
- Check if you have the Developer and Admin roles assigned from the Settings > Roles page in webMethods.io Integration.
- Obtain the credentials to log in to the Salesforce CRM back end account.
- Create the Salesforce Account (SalesforceCRM_1) in webMethods.io Integration.
Basic Flow
1. Log in to your tenant and from the webMethods.io Integration navigation bar, click Projects. Select a project and then select Configurations > FlowService > Document Types.
2. To create a new document type from an XML Schema Definition, from the Document Types page, click Add Document Type > Build from XML Schema Definition.
3. Provide a name and description of your document type, for example, customerOrder.
4. On the Source selection panel, under XML schema source, select File, click Browse file and select the customerOrder.xsd file.
5. Click Next to view the Processing Options panel. You can specify whether webMethods.io Integration enforces strict, lax, or no content model compliance when generating the document type. Let us select None. Selecting None generates a document type that does not necessarily represent or maintain the content models in the source XML Schema Definition.
6. Click Next and on the Select root nodes panel, select the elements that you want to use as the root element for the document type. The resulting document type contains all of the selected root elements as top-level fields in the generated document type.
7. Click Save. webMethods.io Integration creates the document type. As you can see, other document types are created automatically from the same XSD source file.
Note: If an element in the XML Schema Definition is a complexType, webMethods.io Integration creates the document type that defines the structure of the complexType automatically, along with the main document type.
Now let us use the document type customerOrder to create Accounts in Salesforce CRM.
8. Go to the FlowServices page, click the + icon to create a new FlowService, and then provide a name CreateAccountsDocType and description of the FlowService.
9. Click the I/O icon as shown above, and define the input and output fields. Select the document reference customerOrder and save it.
10. Select Salesforce CRM, the createAccounts operation, and link the SalesforceCRM_1 account.
11. Click the mapping icon and map the input and output fields as shown below.
12. Close the mapping panel by clicking the icon, click the run icon, and enter the input values.
13. Click Run again on the input values dialog box and inspect the results.