<?xml version="1.0" encoding="utf-8"?>
<ManualTopic ID="/baanerp/tt/onlinemanual/100106" xml:lang="en">
	<Header>
		<Title xmlns:HTML="http://www.w3.org/TR/REC-html40">To edit XML Schema Files (BOR)</Title>
		<Keyword ContextSensitive="No"><Level1>BOR</Level1>
		</Keyword>
		<Keyword ContextSensitive="No"><Level1>Business Object Repository</Level1>
		</Keyword>
		<Keyword ContextSensitive="No"><Level1>Method</Level1>
		</Keyword>
		<Keyword ContextSensitive="No"><Level1>XML Schema</Level1>
		</Keyword>
	</Header>
	<AimSection><Paragraph class="Default">This document describes how XML Schema's that make up the arguments of the methods of a <Link href="/baanerp/tt/glossary/glossary#100032" role="glossary">business object</Link> must be edited.</Paragraph>
	</AimSection>
	<GeneralSection><GeneralSection><SectionTitle>Introduction</SectionTitle>
			<Paragraph class="Default">If you generate a method or save a method you created manually, XML Schema Files are generated for the arguments of that method. These files actually store the arguments.</Paragraph>
			<Paragraph class="Default">Through the <GUIRef href="/baanerp/tt/adv/ttadv7113m000#generate.xml.schema" role="command">Generate XML Schema</GUIRef> command in the <GUIRef href="" role="menu">Specific</GUIRef> menu of the <GUIRef href="/baanerp/tt/adv/ttadv7113m000" role="session">Business Object Method Arguments (ttadv7113m000)</GUIRef> session you can generate a filled XML Schema file. This file must however be edited manually, because not everything can be generated automatically.</Paragraph>
			<List><ListIntro>When a (filled) XML Schema is generated for a specific argument, the following actions are taken:</ListIntro>
				<ListItem>The public attributes are added as separate declaration elements after the &lt;RequestDataArea&gt; group in the Schema file. The name information and domain information is stored.</ListItem>
				<ListItem>The business object is added as child of the RequestDataArea element.</ListItem>
				<ListItem>If components are present in the protected layer of the business object, the components are linked as child of the business object element.</ListItem>
				<ListItem>If components are present, the public attributes are added as child of the component element. If no components are present, the public attributes are added as child of the business object element.</ListItem>
			</List>
			<Note><SectionTitle>
                                    Note
                                 </SectionTitle>
				<Paragraph class="Default">The component structure is not taken into account in this process. All components are placed at the same level below the business object element.</Paragraph>
			</Note>
			<ExampleSection><SectionTitle>
                                    Example of a filled XSD structure</SectionTitle>
				<CodeBlock space-and-orientation="indented-estimated">&lt;xs:element name="CreateRequest" type="CreateRequestType"/&gt;
&lt;xs:simpleType name="Attribute1DT"&gt;
    &lt;xs:restriction base="xs:long"&gt;
        &lt;xs:totalDigits value="10"/&gt;
    &lt;/xs:restriction&gt;
&lt;/xs:simpleType&gt;
&lt;xs:simpleType name="Attribute2DT"&gt;
    &lt;xs:restriction base="xs:string"&gt;
        &lt;xs:maxLength value="5"/&gt;
    &lt;/xs:restriction&gt;
&lt;/xs:simpleType&gt;
&lt;xs:simpleType name="Attribute3DT"&gt;
    &lt;xs:restriction base="xs:string"&gt;
        &lt;xs:maxLength value="9"/&gt;
    &lt;/xs:restriction&gt;
&lt;/xs:simpleType&gt;
&lt;xs:simpleType name="Attribute4DT"&gt;
    &lt;xs:restriction base="xs:string"&gt;
        &lt;xs:maxLength value="9"/&gt;
    &lt;/xs:restriction&gt;
&lt;/xs:simpleType&gt;
&lt;xs:simpleType name="Attribute5DT"&gt;
    &lt;xs:restriction base="xs:string"&gt;
        &lt;xs:maxLength value="9"/&gt;
    &lt;/xs:restriction&gt;
&lt;/xs:simpleType&gt;
&lt;xs:simpleType name="Attribute6DT"&gt;
    &lt;xs:restriction base="xs:string"&gt;
        &lt;xs:maxLength value="9"/&gt;
    &lt;/xs:restriction&gt;
&lt;/xs:simpleType&gt;
&lt;xs:simpleType name="Attribute7DT"&gt;
    &lt;xs:restriction base="xs:string"&gt;
        &lt;xs:maxLength value="9"/&gt;
    &lt;/xs:restriction&gt;
&lt;/xs:simpleType&gt;
&lt;xs:complexType name="CreateRequestType"&gt;
       &lt;xs:sequence&gt;
           &lt;xs:element name="ControlArea" type="bo:CreateRequestControlArea" minOccurs="0"/&gt;
           &lt;xs:element name="DataArea" type="bo:CreateRequestDataArea"/&gt;
       &lt;/xs:sequence&gt;
    &lt;/xs:complexType&gt;
&lt;/xs:complexType&gt;
&lt;xs:complexType name="CreateRequestDataAreaType"&gt;
    &lt;xs:sequence&gt;
        &lt;xs:element name="BusinessObject" type="CreateRequestBusinessObjectType"/&gt;
    &lt;/xs:sequence&gt;
&lt;/xs:complexType&gt;
&lt;xs:complexType name="CreateRequestBusinessObjectType"&gt;
    &lt;xs:sequence&gt;
        &lt;xs:element name="Component1" type="CreateRequestComponent1Type"/&gt;
        &lt;xs:element name="Component2" type="CreateRequestComponent2Type"/&gt;
    &lt;/xs:sequence&gt;
&lt;/xs:complexType&gt;
&lt;xs:complexType name="CreateRequestComponent1Type"&gt;
    &lt;xs:sequence&gt;
        &lt;xs:element name="Attribute1" type="Attribute1DT" minOccurs="0"/&gt;
        &lt;xs:element name="Attribute2" type="Attribute2DT" minOccurs="0"/&gt;
        &lt;xs:element name="Attribute3" type="Attribute3DT" minOccurs="0"/&gt;
    &lt;/xs:sequence&gt;
&lt;/xs:complexType&gt;
&lt;xs:complexType name="CreateRequestComponent2Type"&gt;
    &lt;xs:sequence&gt;
        &lt;xs:element name="Attribute4" type="Attribute4DT"/&gt;
        &lt;xs:element name="Attribute5" type="Attribute5DT" minOccurs="0"/&gt;
        &lt;xs:element name="Attribute6" type="Attribute6DT" minOccurs="0"/&gt;
        &lt;xs:element name="Attribute7" type="Attribute7DT" minOccurs="0"/&gt;
    &lt;/xs:sequence&gt;
&lt;/xs:complexType&gt;
&lt;xs:complexType name="CreateRequestControlArea"&gt;
       &lt;xs:sequence&gt;
           &lt;xs:element name="ApplicationControlData" type="bo:CreateRequestApplicationControlData" minOccurs="0"/&gt;
           &lt;xs:element name="processingScope" type="bo:processingScopeDT" default="request" minOccurs="0"/&gt;
       &lt;/xs:sequence&gt;
&lt;/xs:complexType&gt;
&lt;xs:complexType name="CreateRequestApplicationControlData"&gt;
       &lt;xs:sequence/&gt;
    &lt;/xs:complexType&gt;
    &lt;xs:simpleType name="processingScopeDT"&gt;
        &lt;xs:restriction base="xs:string"&gt;
             &lt;xs:enumeration value="not_applicable"/&gt;
             &lt;xs:enumeration value="request"/&gt;
             &lt;xs:enumeration value="business_entity"/&gt;
             &lt;xs:enumeration value="business_entity_component"/&gt;
        &lt;/xs:restriction&gt;
&lt;/xs:simpleType&gt;
</CodeBlock>
			</ExampleSection>
		</GeneralSection>
		<GeneralSection><SectionTitle>Manual Corrections</SectionTitle>
			<Paragraph class="Default">The generated XML Schema's require manual correction, because not everything can be done automatically, and not every attribute is important for external connections. The changes are related both to the structure and the content of the XML Schema's. The following sections detail the changes.</Paragraph>
			<GeneralSection><SectionTitle>Structure</SectionTitle>
				<Important><SectionTitle>
                                       Important!
                                    </SectionTitle>
					<Paragraph class="Default">The following rule is important for the structure of the XML Schema's.</Paragraph>
					<Paragraph class="Default"><Emphasis>All components of the business object must be present in the XML Schema as group elements.</Emphasis>
					</Paragraph>
				</Important>
				<Paragraph class="Default">For example, an element Order has a repeating sub-element Line. According to XSD rules, the attributes of the Header component can be linked directly to the Order element, and the repeating attributes of the Lines must be linked to the repeated Line element. The sub-element Header can be inserted to map the order specific attributes to the Header component. Refer to the following figures for a visualisation of the differences. Both constructions are allowed, but the first one is given preference to.</Paragraph>
				<TABLE border="1" borderstyle="default" space-and-orientation="indented-estimated"><CAPTION>Business object "Order", valid according to XSD rules</CAPTION>
					<TBODY><TR><TH rowspan="1" colspan="1">Order</TH>
							<TD rowspan="1" colspan="1">orderNumber</TD>
							<TD rowspan="1" colspan="1"></TD>
						</TR>
						<TR><TD rowspan="1" colspan="1"></TD>
							<TD rowspan="1" colspan="1">businessPartner</TD>
							<TD rowspan="1" colspan="1"></TD>
						</TR>
						<TR><TD rowspan="1" colspan="1"></TD>
							<TD rowspan="1" colspan="1">country</TD>
							<TD rowspan="1" colspan="1"></TD>
						</TR>
						<TR><TD rowspan="1" colspan="1"></TD>
							<TH rowspan="1" colspan="1">Line*</TH>
							<TD rowspan="1" colspan="1">lineNumber</TD>
						</TR>
						<TR><TD rowspan="1" colspan="1"></TD>
							<TD rowspan="1" colspan="1"></TD>
							<TD rowspan="1" colspan="1">quantity</TD>
						</TR>
						<TR><TD rowspan="1" colspan="1"></TD>
							<TD rowspan="1" colspan="1"></TD>
							<TD rowspan="1" colspan="1">unitOfMeasure</TD>
						</TR>
					</TBODY>
				</TABLE>
				<Paragraph class="Default"> </Paragraph>
				<TABLE border="1" borderstyle="default" space-and-orientation="indented-estimated"><CAPTION>Business object "Order", valid according to specified rule</CAPTION>
					<TBODY><TR><TH rowspan="1" colspan="1">Order</TH>
							<TH rowspan="1" colspan="1">Header</TH>
							<TD rowspan="1" colspan="1">orderNumber</TD>
						</TR>
						<TR><TD rowspan="1" colspan="1"></TD>
							<TD rowspan="1" colspan="1"></TD>
							<TD rowspan="1" colspan="1">businessPartner</TD>
						</TR>
						<TR><TD rowspan="1" colspan="1"></TD>
							<TD rowspan="1" colspan="1"></TD>
							<TD rowspan="1" colspan="1">country</TD>
						</TR>
						<TR><TD rowspan="1" colspan="1"></TD>
							<TH rowspan="1" colspan="1">Line*</TH>
							<TD rowspan="1" colspan="1">lineNumber</TD>
						</TR>
						<TR><TD rowspan="1" colspan="1"></TD>
							<TD rowspan="1" colspan="1"></TD>
							<TD rowspan="1" colspan="1">quantity</TD>
						</TR>
						<TR><TD rowspan="1" colspan="1"></TD>
							<TD rowspan="1" colspan="1"></TD>
							<TD rowspan="1" colspan="1">unitOfMeasure</TD>
						</TR>
					</TBODY>
				</TABLE>
			</GeneralSection>
			<GeneralSection><SectionTitle>General Checks</SectionTitle>
				<List><ListIntro>The following changes are required for all methods.</ListIntro>
					<ListItem>For a <Emphasis>repeating</Emphasis> element, the maxOcc property/attribute must be set to <GUIRef href="" role="manual">unbounded</GUIRef>.</ListItem>
					<ListItem>For grouping elements of <Emphasis>mandatory</Emphasis> components, the minOcc property/attribute must be set to <GUIRef href="" role="manual">one</GUIRef>.</ListItem>
					<ListItem>For grouping elements of <Emphasis>non-mandatory</Emphasis> components, the minOcc property/attribute must be set to <GUIRef href="" role="manual">zero</GUIRef>.</ListItem>
					<ListItem><Emphasis>Identifying fields</Emphasis> which are already defined in the parent component must be removed from the elements that belong to a sub-component. For example, the attribute orderNumber, which is present in the Header element, must not be repeated in the Line element.</ListItem>
				</List>
			</GeneralSection>
			<GeneralSection><SectionTitle>Changes per Method</SectionTitle>
				<List><ListIntro>The following sections describe the changes for each specific method.</ListIntro>
					<ListItem><Link href="#create" role="internal">Create</Link>
					</ListItem>
					<ListItem><Link href="#change" role="internal">Change</Link>
					</ListItem>
					<ListItem><Link href="#delete" role="internal">Delete</Link>
					</ListItem>
					<ListItem><Link href="#list" role="internal">List</Link>
					</ListItem>
					<ListItem><Link href="#show" role="internal">Show</Link>
					</ListItem>
					<ListItem><Link href="#createref" role="internal">CreateRef</Link>
					</ListItem>
					<ListItem><Link href="#deleteref" role="internal">DeleteRef</Link>
					</ListItem>
				</List>
				<GeneralSection ID="create"><SectionTitle>Create</SectionTitle>
					<List><ListIntro>For the request argument, the following changes are required:</ListIntro>
						<ListItem>If the business object element is repeating, remove the groups that do not have a Create method in the business object of the corresponding component.</ListItem>
						<ListItem>If a sub-component is repeating and mandatory, move it to the right so that it is at the same level as the attributes of the parent component.</ListItem>
						<ListItem><List><ListIntro>Remove the following unnecessary attributes:</ListIntro>
								<ListItem>Attributes that are filled by means of a DAL2 logic.</ListItem>
								<ListItem>All read-only attributes.</ListItem>
								<ListItem>All derived fields. Refer to the DAL2 hook fieldX.is.derived. Note that conditional derived fields can be left.</ListItem>
							</List>
						</ListItem>
					</List>
					<Paragraph class="Default">For the response argument, the structure must be the same as for the request argument. However, depending on functional requirements, extra attributes can be required, which are filled with defaults by the application logic.</Paragraph>
				</GeneralSection>
				<GeneralSection ID="change"><SectionTitle>Change</SectionTitle>
					<Paragraph class="Default">Refer to the Create method. The Change method must have the same structure as the Create method, and can have the same attributes.</Paragraph>
				</GeneralSection>
				<GeneralSection ID="delete"><SectionTitle>Delete</SectionTitle>
					<List><ListIntro>For the request argument, the following changes are required:</ListIntro>
						<ListItem>If the business object element is repeating, remove the groups that do not have a Delete method in the business object of the corresponding component.</ListItem>
						<ListItem>If a sub-component is repeating and mandatory, move it to the right so that it is at the same level as the attributes of the parent component.</ListItem>
						<ListItem>Remove all attributes, except the identifying ones.</ListItem>
					</List>
					<Paragraph class="Default">For the response argument, the structure must be the same as for the request argument. However, depending on functional requirements, extra attributes can be required, which are filled with the table fields of the deleted business object.</Paragraph>
				</GeneralSection>
				<GeneralSection ID="list"><SectionTitle>List</SectionTitle>
					<Paragraph class="Default">For the request argument, you must remove from the filterAttributeList the attributes of related business objects that are selected by a Read method. Whether business objects are selected by a Read method can be checked in the List function of the <GUIRef href="" role="manual">st</GUIRef> program script. You must also remove all other attributes that cannot be used in a filter (such as description type attributes).</Paragraph>
					<List><ListIntro>For the response argument, the following changes are required:</ListIntro>
						<ListItem>If the business object element is repeating, set it to "Unbounded".</ListItem>
						<ListItem>If the component is a sub-component, move it to the right so that it is at the same level as the attributes of the parent component.</ListItem>
						<ListItem>If an element is not mandatory, set it to "Optional". Make sure that all mandatory elements are <Emphasis>not</Emphasis> set to "Optional".</ListItem>
					</List>
					<Note><SectionTitle>
                                          Note
                                       </SectionTitle>
						<Paragraph class="Default">In the List method, the Response XSD reflects the structure of the business object. The Request XSD contains selection attributes and logic for the definition of filter conditions with the attributes of the business object.</Paragraph>
					</Note>
				</GeneralSection>
				<GeneralSection ID="show"><SectionTitle>Show</SectionTitle>
					<Paragraph class="Default">For the request argument, you must remove from the filterAttributeList the attributes of related business objects that are selected by a Read method. Whether business objects are selected by a Read method can be checked in the Show function of the <GUIRef href="" role="manual">st</GUIRef> program script. You must also remove all other attributes that cannot be used in a filter (such as description type attributes).</Paragraph>
					<List><ListIntro>For the response argument, the following changes are required:</ListIntro>
						<ListItem>If the component is a sub-component, move it to the right so that it is at the same level as the attributes of the parent component.</ListItem>
						<ListItem>If an element is not mandatory, set it to "Optional". Make sure that all mandatory elements are <Emphasis>not</Emphasis> set to "Optional".</ListItem>
					</List>
					<Note><SectionTitle>
                                          Note
                                       </SectionTitle>
						<Paragraph class="Default">The Show method is closely related to the List method. Only, the Show method retrieves just one occurrence of the business object, and optionally several occurrences of the sub components, if these are available.</Paragraph>
					</Note>
				</GeneralSection>
				<GeneralSection ID="createref"><SectionTitle>CreateRef</SectionTitle>
					<List><ListIntro>For the request argument, the following changes are required:</ListIntro>
						<ListItem>If the business object element is repeating, remove the groups that do not have a CreateRef method in the business object of the corresponding component.</ListItem>
						<ListItem>If a sub-component is repeating and mandatory, move it to the right so that it is at the same level as the attributes of the parent component.</ListItem>
						<ListItem><List><ListIntro>Remove all attributes, except the following ones:</ListIntro>
								<ListItem>The identifying attributes.</ListItem>
							</List>
						</ListItem>
					</List>
					<Paragraph class="Default">For the response argument, the structure must be the same as for the request argument, and only the attributes of the request argument must be used. No other attributes are required, because the methods only operates on the reference table, and not on the other tables of the business object. Extra arguments can only be used if extra read actions are added in the <Link href="/baanerp/tt/glossary/glossary#100224" role="glossary">DAL</Link> of the reference table.</Paragraph>
				</GeneralSection>
				<GeneralSection ID="deleteref"><SectionTitle>DeleteRef</SectionTitle>
					<List><ListIntro>For the request argument, the following changes are required:</ListIntro>
						<ListItem>If the business object element is repeating, remove the groups that do not have a DeleteRef method in the business object of the corresponding component.</ListItem>
						<ListItem>If a sub-component is repeating and mandatory, move it to the right so that it is at the same level as the attributes of the parent component.</ListItem>
						<ListItem>Remove all attributes, except the identifying attributes.</ListItem>
					</List>
					<Paragraph class="Default">For the response argument, the structure must be the same as for the request argument. The attributes of the reference table can be used. Extra arguments can only be used if extra read actions are added in the <Link href="/baanerp/tt/glossary/glossary#100224" role="glossary">DAL</Link> of the reference table.</Paragraph>
				</GeneralSection>
			</GeneralSection>
		</GeneralSection>
	</GeneralSection>
	<RelatedTopics><SectionTitle>Related topics</SectionTitle>
		<RelTopic><Link href="/baanerp/tt/onlinemanual/100107" role="manual">To Model a Business Object</Link>
		</RelTopic>
		<RelTopic><Link href="/baanerp/tl/onlinemanual/000010" role="manual">How to test protected methods for Infor ERP LN</Link>
		</RelTopic>
		<RelTopic><Link href="/baanerp/tl/onlinemanual/000020" role="manual">How to test public methods for Infor ERP LN</Link>
		</RelTopic>
	</RelatedTopics>
</ManualTopic>
