<?xml version="1.0" encoding="utf-8"?>
<ManualTopic ID="/baanerp/tt/onlinemanual/100107" xml:lang="en">
	<Header>
		<Title xmlns:HTML="http://www.w3.org/TR/REC-html40">To Model a Business Object</Title>
		<Keyword ContextSensitive="No"><Level1>BOR</Level1>
		</Keyword>
		<Keyword ContextSensitive="No"><Level1>BO</Level1>
		</Keyword>
		<Keyword ContextSensitive="No"><Level1>Business Object</Level1>
		</Keyword>
	</Header>
	<AimSection><Paragraph class="Default">This document describes the business object concept and guides you through the process of modelling a business object.</Paragraph>
	</AimSection>
	<GeneralSection><Paragraph class="Default">The business object repository (BOR) is a virtual space in which business objects are stored. A business object is an object with a business oriented user interface, that serves as a single entry point to store all the business related data and perform operations on these data.</Paragraph>
		<List><ListIntro>This document contains the following sections:</ListIntro>
			<ListItem><Link href="#integrations" role="internal">Integrations</Link> Explains why business objects are used.</ListItem>
			<ListItem><Link href="#structure" role="internal">Structure</Link> Describes the main elements and properties of a business object.</ListItem>
			<ListItem><Link href="#references" role="internal">References</Link> Explains the use of reference tables.</ListItem>
			<ListItem><Link href="#modelingprocess" role="internal">Modeling Process</Link> Describes the steps you must take to model a business object.</ListItem>
		</List>
		<Paragraph class="Default"></Paragraph>
	</GeneralSection>
	<GeneralSection ID="integrations"><SectionTitle>Integrations</SectionTitle>
		<Paragraph class="Default">The business object is the primary enabler of integrations between ERP LN and other applications. The business object is a layer between the ERP LN application and an integration party. As a result, the integration party does not address the internal ERP LN functionality directly, but through the entry points of the business object.</Paragraph>
		<List><ListIntro>This construction has the following advantages:</ListIntro>
			<ListItem>The integration party is not confronted with the technical implementation of the ERP LN functionality, nor with the complexities and limitations that apply on that level. For example, no matter how many tables are required to store the data, all tables are accessible through the business object, while, at the same time, the business object hides these tables, and simply presents the integration party with the entry points to read or store this data.</ListItem>
			<ListItem>Because the internal ERP LN functionality is not addressed directly, this functionality can be changed without affecting the integration, as long as backward compatibility is guaranteed. For example, the code of a table field can be changed, while the external representation of this field in the business object remains the same. BusinessPartnerAddress remains BusinessPartnerAddress. Of course, an update of the business object is required to link BusinessPartnerAddress to the new table code, but an integration party can still use that name.</ListItem>
			<ListItem>The user interface of the business object is defined in compliance with international standards, such as OAGIS and RosettaNet. This terminology is understood in the business field and enables a quick recognition of data and functionality.</ListItem>
			<ListItem>The adoption of XML as communication language between ERP LN and an integration party provides a very flexible and application-independent way to structure the information that is communicated.</ListItem>
		</List>
	</GeneralSection>
	<GeneralSection ID="structure"><SectionTitle>Structure</SectionTitle>
		<Paragraph class="Default">The remainder of this document explains the structure of a business object and the steps you must take to create and model a business object.</Paragraph>
		<List><ListIntro>A business object has the following elements:</ListIntro>
			<ListItem><Link href="#header" role="internal">Header</Link> The identification data of a business object.</ListItem>
			<ListItem><Link href="#components" role="internal">Components</Link> Components can be used to structure a business object. However, the rule is that business objects are as flat as possible. The only exception that allows a structure is the occurrence of recurring elements, for example, order lines that occur repeatedly. Note that, if components are used, the tables, protected attributes and protected methods are defined inside the components.</ListItem>
			<ListItem><Link href="#tables" role="internal">Tables</Link> Because the information that is accessible through the business object is often stored in tables, the business object must be linked to one or more tables. Besides tables that store business object information, a reference table can be used to store references from an external application to the business object. These references are stored to prevent that business object information is deleted, while it is still required by an external application.</ListItem>
			<ListItem><Link href="#attributes" role="internal">Attributes</Link> The attributes are the entry points for the business object data. The attributes are often linked to a table field, but they can also represent a calculated value, or have a value that is not related to any table field.</ListItem>
			<ListItem><Link href="#methods" role="internal">Methods</Link> Methods perform operations on the business object attributes, such as reading, changing, or calculating an attribute value.</ListItem>
			<ListItem><Link href="#relations" role="internal">Relations</Link> Several types of relations exist inside business objects, between business objects, and between business objects and tables. Relations are important for the structure of the a business objects and its information channels.</ListItem>
		</List>
		<Paragraph class="Default"><Emphasis>Public vs Protected</Emphasis> An important difference exists between public and protected business objects, and the public and protected layer within a business object. Business objects are always either protected or public. If they are protected, they have only a protected layer. If they are public, they have both a protected layer and a public layer. The protected layer consists of protected attributes and protected methods, while the public layer consists of public attributes and public methods. The protected layer can only be used by ERP LN itself. The public layer can be used by an external application. So, an external application can call a public method, but not a protected method. The protected layer can also contain links to tables and other business objects.</Paragraph>
		<GeneralSection ID="header"><SectionTitle>Header</SectionTitle>
			<Paragraph class="Default">The header of the business object specifies the identification data, the VRC in which the business object is stored, whether the business object is expired, a description, and the business object type.</Paragraph>
			<List><ListIntro>The identification data consist of the following elements:</ListIntro>
				<ListItem>The business object name, which must be meaningful in the business area. For example, BusinessPartner.</ListItem>
				<ListItem>Package/module codes. Because a business object is modeled for a package/module combination, these data are also present.</ListItem>
				<ListItem>A three-digit identification code used to identify the business object within the package/module combination.</ListItem>
			</List>
			<Paragraph class="Default">The business object type is either protected, or public, or proxy.</Paragraph>
		</GeneralSection>
		<GeneralSection ID="components"><SectionTitle>Components</SectionTitle>
			<Paragraph class="Default">A business object has components if the business object has recurring elements. For example, the PurchaseOrder business object has one order header, and a number of order lines. This structure is defined by using a component for the order header which has a one-to-many relation to the component for the order line.</Paragraph>
			<Paragraph class="Default">Because components are a kind of group boxes, their most important features are the name and the relations they have with one another. The components do not store other important business object information themselves, but they provide a framework in which other information storing elements are defined, specifically, the tables that are linked to the business object, the protected attributes and the protected methods.</Paragraph>
			<Paragraph class="Default">Because components can only occur in the protected layer of a business object, only protected attributes and methods can be defined in a component. Public attributes and methods are always defined in the business object itself. The details of the relation between components are specified on attribute level.</Paragraph>
		</GeneralSection>
		<GeneralSection ID="tables"><SectionTitle>Tables</SectionTitle>
			<Paragraph class="Default">Most of the business object data is stored in tables, and can be accessed through the business object attributes. Before the attributes can be linked to a table field, the table concerned must be linked to the business object.</Paragraph>
			<Paragraph class="Default">If the business object has components, the tables must be defined per component. The reason for this rule is that only protected attributes can be linked to a table, and protected attributes are defined per component, if the business object has components.</Paragraph>
			<Paragraph class="Default">You must define one root table, which is the table that contains the primary key of the business object or component. In addition, other tables that store important information can be specified. However, you must not specify each table whose fields are required, but only those tables that really belong to the business object.</Paragraph>
			<Paragraph class="Default">The value of a field that occurs in another, not specified table, can be retrieved (or changed) by means of a link to another business object in which that table is specified, and to the attribute of that business object that provides access to the field in question.</Paragraph>
			<Paragraph class="Default">If the business object is public, it can have a reference table, which is used to store references from external sources to the current business object. As long as a reference exists, that is, as long as the reference table stores a reference from an external source to an attribute of the current business object, it is not allowed to delete that attribute.</Paragraph>
			<Paragraph class="Default">If a reference table is used, the business object requires several specific attributes and methods, which can all be generated automatically.</Paragraph>
		</GeneralSection>
		<GeneralSection ID="attributes"><SectionTitle>Attributes</SectionTitle>
			<Paragraph class="Default">Attributes are entry points to store information.</Paragraph>
			<Paragraph class="Default">Attributes are defined for the business object or for a component, and they are either public or protected. If a business object has components, the protected attributes must be defined per component.</Paragraph>
			<Paragraph class="Default">Attributes can derive their value from a table field, from a calculation based on one or more table fields, or from a non-table field related source. The source from which the attributes derive their value is specified in the <GUIRef href="" role="manual">Map Operator</GUIRef> field. If an attribute is based on a calculation, this calculation must be programmed manually.</Paragraph>
			<Paragraph class="Default">An attribute has a domain and a data type. The domain specifies the format of the value. If the attribute is linked to a table field, the domain will often be that of the table field. The data type is actually part of the specification of the domain.</Paragraph>
			<List><ListIntro>Attributes can also have the following properties:</ListIntro>
				<ListItem><Emphasis>Read-only</Emphasis> The value of the attribute cannot be changed directly.</ListItem>
				<ListItem><Emphasis>Mandatory</Emphasis> The attributes must have a value.</ListItem>
				<ListItem><Emphasis>Identifying</Emphasis> The attribute is part of the key of the business object or component.</ListItem>
				<ListItem><Emphasis>Default available</Emphasis> A default value is available for the attribute. Note however, that only public attributes can have this property.</ListItem>
			</List>
		</GeneralSection>
		<GeneralSection ID="methods"><SectionTitle>Methods</SectionTitle>
			<Paragraph class="Default">Methods operate on the business object attributes.</Paragraph>
			<Paragraph class="Default">Methods are defined per business object or per component, and they are either public or protected. If a business object has components, the protected methods must be defined per component.</Paragraph>
			<List><ListIntro>Dependent on the type of behavior, a method is a standard method or a specific method:</ListIntro>
				<ListItem>Standard methods implement a behavior that is generic for all business objects, like Creating, Deleting, or Changing a business object instance.</ListItem>
				<ListItem>Specific methods implement a specific behavior for a particular business object only (or for a small group of business objects).</ListItem>
			</List>
			<Paragraph class="Default">Standard methods can be generated by ERP LN itself, based on the available attributes. Specific methods must be programmed manually. Refer to <Link href="/baanerp/tt/domains/adv.stmd" role="domain">Standard/Specific Method</Link> for details.</Paragraph>
		</GeneralSection>
		<GeneralSection ID="relations"><SectionTitle>Relations</SectionTitle>
			<Paragraph class="Default">To model a business object properly, the relations between the various business object related entities are very important.</Paragraph>
			<List><ListIntro>The following relation types exist:</ListIntro>
				<ListItem><Emphasis>Business object relations</Emphasis> Business objects are linked together to enable you to link attributes of these business objects to one another. This way you can retrieve information from another business object. The link to other business objects is made in the protected layer of a business object.</ListItem>
				<ListItem><Emphasis>Component relations</Emphasis> Components are linked together in a business object to specify the relation type they have to one another. On a detailed level, the components are linked together through relations that are specified on the attributes.</ListItem>
				<ListItem><Emphasis>Table relations</Emphasis> To link table fields to the protected attributes of a business object or component, the tables must first be related to the business object or component of these attributes. On a detailed level, it is possible to specify a filter on the relation between a protected attribute and a table field. In that case, the relation is only valid if certain conditions are met, for example, if another table field has a specific value. For reference tables, the reference table must only be specified. Because the reference table is fully standardized, even a non-existing table can be specified, in which case the table will be generated automatically.</ListItem>
			</List>
		</GeneralSection>
	</GeneralSection>
	<GeneralSection ID="references"><SectionTitle>References</SectionTitle>
		<Paragraph class="Default">Because business objects are used for integrations with other applications, you are not free to delete whatever business object information you want. Deleting information that is required by an external application can cause problems for that application. To prevent such problems, you can define a reference table for your business object. A reference table stores references from an external application to the business object. You can only delete information for which no reference exist in the reference table. External applications can access the reference table by calling a set of standard methods, which operate on a set of attributes that are linked to the reference table. Refer to the Help on the <Link href="/baanerp/tt/adv/ttadv7111m000" role="session">Tables (ttadv7111m000)</Link> session for more information.</Paragraph>
	</GeneralSection>
	<ProcedureSection ID="modelingprocess"><SectionTitle>Modeling Process</SectionTitle>
		<ProcIntro><Paragraph class="Default">To model one or more business objects, the following steps must be taken. The steps are displayed in a flow diagram. The sessions that are required to perform these steps are mentioned subsequently. Click the links to online Help of the sessions to read more information.</Paragraph>
			<Paragraph class="Default">All these sessions are available through the sessions the occur previously in the flow, either by double-clicking a record in these sessions, by clicking one of the tabs in these sessions, or though the <GUIRef href="" role="menu">Specific</GUIRef> menu of these sessions.</Paragraph>
			<Paragraph class="Default">The first flow provides the overall picture. This flow consists of several actions and sub flows, which are outlined in the sections that follow.</Paragraph>
			<Paragraph class="Default"><HTML:IMG width="232" height="487" SRC="../images/tr_graph_bol_flow_1.gif" path="/enterpriseserver/tools/tt/onlinemanual" btb-count="1" btb-count2="1" btb-image-name="tr_graph_bol_flow_1.gif" btb-source-path="C:\SVN\docnl\Technology\EnterpriseServer~8.5\EnterpriseServer" btb-image-path="/enterpriseserver/tools/tt/images/tr_graph_bol_flow_1.gif" ID="IDAW5XBC" alt="[...]" xmlns:HTML="http://www.w3.org/TR/REC-html40"/></Paragraph>
		</ProcIntro>
		<Steps><Step><StepTitle>Create the Business Object</StepTitle>
				<Paragraph class="Default">Use the following sessions to create a business object: Start the <Link href="/baanerp/tt/adv/ttadv7500m000" role="session">Business Objects (ttadv7500m000)</Link> session, select the package and module in which you want to create the business object, and press New. Session <Link href="/baanerp/tt/adv/ttadv7100s000" role="session">Business Objects (ttadv7100s000)</Link> starts, where you can define the basic data of the business object.</Paragraph>
			</Step>
			<Step><StepTitle>Create the Protected Layer</StepTitle>
				<Paragraph class="Default">This step is outlined in the following picture:</Paragraph>
				<Paragraph class="Default"><HTML:IMG height="714" width="650" SRC="../images/tr_graph_bol_flow_2.gif" path="/enterpriseserver/tools/tt/onlinemanual" btb-count="1" btb-count2="1" btb-image-name="tr_graph_bol_flow_2.gif" btb-source-path="C:\SVN\docnl\Technology\EnterpriseServer~8.5\EnterpriseServer" btb-image-path="/enterpriseserver/tools/tt/images/tr_graph_bol_flow_2.gif" ID="IDACAYBC" alt="[...]" xmlns:HTML="http://www.w3.org/TR/REC-html40"/></Paragraph>
				<ProcedureList><ListIntro>Use the following sessions. The sessions are listed in the order in which they occur in the flow, although some sessions may be used repeatedly, while others may not be used at all, according to the conditions specified in the flow.</ListIntro>
					<ListItem>If the business object has recurring elements, you must define components in the <Link href="/baanerp/tt/adv/ttadv7117m000" role="session">Components (ttadv7117m000)</Link> session and the <Link href="/baanerp/tt/adv/ttadv7117s000" role="session">Business Object Components (ttadv7117s000)</Link> details session.</ListItem>
					<ListItem><List><ListIntro>Link the tables or forms to the business object:</ListIntro>
							<ListItem>If the business object persistency is based on DAL 2, then link the tables to the business object. If the business object has components, you must link the tables to the business object per component. Use the <Link href="/baanerp/tt/adv/ttadv7111m000" role="session">Tables (ttadv7111m000)</Link> session. Besides one or more tables that store the business data, you can define a reference table.</ListItem>
							<ListItem>If the business object persistency is based on a Session/Form, then the session and, optionally, the corresponding synchronized dialog must be specified per component.</ListItem>
						</List>
					</ListItem>
					<ListItem>If necessary, define the details of the relation between a business object or component and its tables. The details are defined by specifying conditions on the values of the fields of the tables in the <Link href="/baanerp/tt/adv/ttadv7134m000" role="session">Business Object Component Table Relations (ttadv7134m000)</Link> session.</ListItem>
					<ListItem>Create the protected attributes in the <Link href="/baanerp/tt/adv/ttadv7104m000" role="session">Protected Attributes (ttadv7104m000)</Link> session. If the business object has components, you must define the protected attributes per component. It is possible to generate a list of all possible protected attributes based on the fields of the linked tables.</ListItem>
					<ListItem>Create protected methods using the <Link href="/baanerp/tt/adv/ttadv7112m100" role="session">Protected Methods (ttadv7112m100)</Link> session. You can either create standard methods or specific methods. Standard methods can be generated automatically based on the definition of the protected attributes. The arguments of the methods are the protected attributes defined in the previous step.</ListItem>
					<ListItem>Create the arguments of the protected methods using the <Link href="/baanerp/tt/adv/ttadv7113m000" role="session">Business Object Method Arguments (ttadv7113m000)</Link> session. Note that the arguments of the methods are created automatically if you create or save a new method. So, the main purpose of this step is to correct the arguments, if necessary, that were created automatically. The arguments are saved as XSD files (XML Schema's).</ListItem>
					<ListItem>If you use components, and all components are defined, together with their tables, protected attributes and protected methods, you must specify the relation type between the components in the <Link href="/baanerp/tt/adv/ttadv7133m000" role="session">Business Object Component Relations (ttadv7133m000)</Link> session and the <Link href="/baanerp/tt/adv/ttadv7132m000" role="session">Business Object Component Relation Details (ttadv7132m000)</Link> session.</ListItem>
				</ProcedureList>
			</Step>
			<Step><StepTitle>Create Business Object Relations</StepTitle>
				<Paragraph class="Default">In the steps described in the previous section, the relation between a business objects and its tables, and the relation between the components of a business objects are already mentioned. A third type of relation exists between business objects. This relation is required to retrieve table field values from tables in another business object.</Paragraph>
				<ProcedureList><ListIntro>Use the following sessions to define the relations between business objects.</ListIntro>
					<ListItem><Link href="/baanerp/tt/adv/ttadv7520m000" role="session">Relationships between Business Objects (ttadv7520m000)</Link> and <Link href="/baanerp/tt/adv/ttadv7120s000" role="session">Relationships between Business Objects (ttadv7120s000)</Link> In these sessions you can define with which business objects a relation must exists, and what type of relation this is.</ListItem>
					<ListItem><Link href="/baanerp/tt/adv/ttadv7119m000" role="session">Relationship Details (ttadv7119m000)</Link> In this session you can specify the details of the relation, which are defined on the components of the business objects.</ListItem>
				</ProcedureList>
			</Step>
			<Step><StepTitle>Create the Public Layer</StepTitle>
				<Paragraph class="Default">This step is outlined in the following picture. Remember that this step is only required if you create a public business object.</Paragraph>
				<Paragraph class="Default"><HTML:IMG width="225" height="253" SRC="../images/tr_graph_bol_flow_3.gif" path="/enterpriseserver/tools/tt/onlinemanual" btb-count="1" btb-count2="1" btb-image-name="tr_graph_bol_flow_3.gif" btb-source-path="C:\SVN\docnl\Technology\EnterpriseServer~8.5\EnterpriseServer" btb-image-path="/enterpriseserver/tools/tt/images/tr_graph_bol_flow_3.gif" ID="IDALAYBC" alt="[...]" xmlns:HTML="http://www.w3.org/TR/REC-html40"/></Paragraph>
				<ProcedureList><ListItem>Create public attributes in the <Link href="/baanerp/tt/adv/ttadv7114m000" role="session">Public Attributes (ttadv7114m000)</Link> session. You can either create them manually, or generate all possible public attributes. Attributes that are generated are either based on the protected attributes that are linked to a table field, or they are based on the protected attributes that are not linked to a table field. If you generate them, manual correction may be required, either with respect to the number of the generated attributes, or their properties and/or content.</ListItem>
					<ListItem>Create public methods in the <Link href="/baanerp/tt/adv/ttadv7112m000" role="session">Public Methods (ttadv7112m000)</Link> session. You can generate standard methods automatically. These methods are used for operations on the tables of the business object, such as read or change. These methods actually call the related protected method, which is not accessible directly by external applications. Specific methods must be created and programmed manually. Refer to <Link href="/baanerp/tt/domains/adv.stmd" role="domain">Standard/Specific Method</Link> for details.</ListItem>
					<ListItem>Create the arguments of the public methods in the <Link href="/baanerp/tt/adv/ttadv7113m000" role="session">Business Object Method Arguments (ttadv7113m000)</Link> session. For public method arguments, the arguments are always a set of standard arguments: Request, Response and Result. However, the content of these standard arguments, which are specified as XSD files, can be edited. The XSD files can be generated automatically. Note that the arguments of the methods are created automatically if you create or save a new method. So, the main purpose of this step is to make the corrections that are often necessary to the generated arguments.</ListItem>
				</ProcedureList>
			</Step>
		</Steps>
	</ProcedureSection>
	<RelatedTopics><SectionTitle>Related topics</SectionTitle>
		<RelTopic><Link href="/baanerp/tt/onlinemanual/100106" role="manual">To edit XML Schema Files (BOR)</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>
