Model template – sample configuration metadata XML file

You can use the provided sample model template as a point of reference.

Below is a sample model template:

<Approval <ApprovalConfig>
	<DomainList>
		<Domain Name="Order" DisplayName="b_Order">
			<Attributes>
                <Attribute Name="OrderDate"  DisplayName="b_Return_Order_Date"
					XPath="OrderLine/Order" DefaultQueryType="GREATERTHANEQUAL">
					<QueryTypes>
						<QueryType QueryType="GREATERTHAN" QueryTypeDesc="b_approval_greaterThan">
							<GreexFunction Name="dateGreater" />
							<Configuration>
								<UIControlConfiguration xtype="xapprovaldatecontrol"/>
							</Configuration>
						</QueryType>
						<QueryType QueryType="GREATERTHANEQUAL" QueryTypeDesc="b_approval_greaterThanEq">
							<GreexFunction Name="dateGreaterOrEqual" />
							<Configuration>
								<UIControlConfiguration xtype="xapprovaldatecontrol"/>
							</Configuration>
						</QueryType>
						<QueryType QueryType="EQUALS" QueryTypeDesc="b_approval_equals">
							<GreexFunction Name="equals" />
							<Configuration>
								<UIControlConfiguration xtype="xapprovaldatecontrol"/>
							</Configuration>
						</QueryType>
					</QueryTypes>
				</Attribute>
				<Attribute Name="OrderDate"  DisplayName="b_Order_Creation_Date"
					XPath="OrderLine/SalesOrder" DefaultQueryType="GREATERTHANEQUAL">
					<QueryTypes>
						<QueryType QueryType="GREATERTHAN" QueryTypeDesc="b_approval_greaterThan">
							<GreexFunction Name="dateGreater" />
							<Configuration>
								<UIControlConfiguration xtype="xapprovaldatecontrol"/>
							</Configuration>
						</QueryType>
						<QueryType QueryType="GREATERTHANEQUAL" QueryTypeDesc="b_approval_greaterThanEq">
							<GreexFunction Name="dateGreaterOrEqual" />
							<Configuration>
								<UIControlConfiguration xtype="xapprovaldatecontrol"/>
							</Configuration>
						</QueryType>
						<QueryType QueryType="EQUALS" QueryTypeDesc="b_approval_equals">
							<GreexFunction Name="equals" />
							<Configuration>
								<UIControlConfiguration xtype="xapprovaldatecontrol"/>
							</Configuration>
						</QueryType>
					</QueryTypes>
				</Attribute>
				<Attribute Name="CustomerLevel" DataCaptureName="CustomerLevelAttribute" DisplayName="b_CustomerLevel"
					XPath="OrderLine/Order/Customer" DefaultQueryType="EQUALS">
					<QueryTypes>
						<QueryType QueryType="EQUALS" QueryTypeDesc="b_approval_is">
							<GreexFunction Name="equals" />
							<Configuration ActionURL="/sbc/systemadmin/getCustomerLevel.do">
								<UIControlConfiguration xtype="xapprovalcombocontrol"
									displayField="CodeShortDescription" valueField="CodeValue"
									optionsBinding="CommonCodeList/CommonCode" />
							</Configuration>
						</QueryType>
					</QueryTypes>
				</Attribute>
				<Attribute Name="CustomerType" DisplayName="b_CustomerType"
					XPath="OrderLine/Order/Customer" DefaultQueryType="EQUALS">
					<QueryTypes>
						<QueryType QueryType="EQUALS" QueryTypeDesc="b_approval_is">
							<GreexFunction Name="equals" />
							<Configuration ActionURL="/sbc/systemadmin/getCustomerType.do">
								<UIControlConfiguration xtype="xapprovalcombocontrol"
									displayField="CodeShortDescription" valueField="CodeValue"
									optionsBinding="CommonCodeList/CommonCode" />
							</Configuration>
						</QueryType>
					</QueryTypes>
				</Attribute>
				<Attribute Name="RelationshipType" DisplayName="b_RelationshipType"
					XPath="OrderLine/Order/Customer" DefaultQueryType="EQUALS">
					<QueryTypes>
						<QueryType QueryType="EQUALS" QueryTypeDesc="b_approval_is">
							<GreexFunction Name="equals" />
							<Configuration ActionURL="/sbc/systemadmin/getCustomerRelationshipType.do">
								<UIControlConfiguration xtype="xapprovalcombocontrol"
									displayField="CodeShortDescription" valueField="CodeValue"
									optionsBinding="CommonCodeList/CommonCode" />
							</Configuration>
						</QueryType>
					</QueryTypes>
				</Attribute>
				<Attribute Name="Vertical" DisplayName="b_Vertical"
					XPath="OrderLine/Order/Customer" DefaultQueryType="EQUALS">
					<QueryTypes>
						<QueryType QueryType="EQUALS" QueryTypeDesc="b_approval_is">
							<GreexFunction Name="equals" />
							<Configuration ActionURL="/sbc/systemadmin/getCustomerVertical.do">
								<UIControlConfiguration xtype="xapprovalcombocontrol"
									displayField="CodeShortDescription" valueField="CodeValue"
									optionsBinding="CommonCodeList/CommonCode" />
							</Configuration>
						</QueryType>
					</QueryTypes>
				</Attribute>
				<Attribute Name="CustomerID" DisplayName="b_Customer_ID"
					XPath="OrderLine/Order/Customer" CompareAny="true">
					<QueryTypes>
						<QueryType QueryType="EQUALS" QueryTypeDesc="b_approval_is">
							<GreexFunction Name="equals" />
							<Configuration>
								<UIControlConfiguration xtype="xapprovaltriggercontrol"
									valueBinding="CustomerList/Customer/CustomerID" entity="CustomerSearch"
									singleSelect="true" />
							</Configuration>
						</QueryType>
					</QueryTypes>
				</Attribute>
			</Attributes>
		</Domain>
		<Domain Name="OrderLine" DisplayName="b_OrderLine">
			<Attributes>
				<Attribute Name="MinReturnWindow" DataCaptureName="ReturnWindowAttributePath" DisplayName="b_Min_Return_Window"
					XPath="Dummy" UseExpression="Y" UniqueSearchString="/OrderLine/SalesOrder/@OrderDate,fn:evalXPath" DefaultQueryType="GREATERTHANEQUAL"
					CompareAny="false" >
					<Expression Function="fn:dateGreaterOrEqual(fn:dateAdd (/OrderLine/SalesOrder/@OrderDate,fn:evalXPath({0})), /OrderLine/Order/@OrderDate)" >
					</Expression>
					<QueryTypes>
						<QueryType QueryType="GREATERTHANEQUAL" QueryTypeDesc="b_approval_greaterThanEq">
							<GreexFunction Name="equals" />
							<Configuration ActionURL="/sbc/systemadmin/getReturnWindowAttributes.do">
								<UIControlConfiguration xtype="xapprovalcombocontrol"
									displayField="CodeShortDescription" valueField="CodeValue"
									optionsBinding="CommonCodeList/CommonCode" />
							</Configuration>
						</QueryType>
					</QueryTypes>
				</Attribute>
				<Attribute Name="ItemID" DisplayName="b_Item_ID"
					XPath="OrderLine/ItemDetails" CompareAny="true">
					<QueryTypes>
						<QueryType QueryType="EQUALS" QueryTypeDesc="b_approval_is">
							<GreexFunction Name="equals" />
							<Configuration>
								<UIControlConfiguration xtype="xapprovaltriggercontrol"
									valueBinding="ItemList/Item/ItemID" entity="item" singleSelect="true" />
							</Configuration>
						</QueryType>
					</QueryTypes>
				</Attribute>
				<Attribute Name="GlobalItemID" DisplayName="b_GlobalItemID"
					XPath="OrderLine/ItemDetails" CompareAny="true">
					<QueryTypes>
						<QueryType QueryType="EQUALS" QueryTypeDesc="b_approval_is">
							<GreexFunction Name="equals" />
							<Configuration>
								<UIControlConfiguration xtype="xapprovaltriggercontrol"
									valueBinding="ItemList/Item/ItemID" entity="item" singleSelect="true" />
							</Configuration>
						</QueryType>
					</QueryTypes>
				</Attribute>
				<!-- <Attribute Name="UnitOfMeasure" DisplayName="b_UnitOfMeasure"
					XPath="OrderLine/ItemDetails" DefaultQueryType="EQUALS">
					<QueryTypes>
						<QueryType QueryType="EQUALS" QueryTypeDesc="b_approval_is">
							<GreexFunction Name="equals" />
							<Configuration ActionURL="/sbc/systemadmin/getUnitOfMeasure.do">
								<UIControlConfiguration xtype="xapprovalcombocontrol"
									displayField="Description" valueField="UnitOfMeasure"
									optionsBinding="ItemUOMMasterList/ItemUOMMaster" />
							</Configuration>
						</QueryType>
					</QueryTypes>
				</Attribute> -->
				<!-- <Attribute Name="ProductClass" DisplayName="b_ProductClass"
					XPath="OrderLine/ItemDetails" DefaultQueryType="EQUALS">
					<QueryTypes>
						<QueryType QueryType="EQUALS" QueryTypeDesc="b_approval_is">
							<GreexFunction Name="equals" />
							<Configuration ActionURL="/sbc/systemadmin/getProductClass.do">
								<UIControlConfiguration xtype="xapprovalcombocontrol"
									displayField="CodeShortDescription" valueField="CodeValue"
									optionsBinding="CommonCodeList/CommonCode" />
							</Configuration>
						</QueryType>
					</QueryTypes>
				</Attribute> -->
				<Attribute Name="ManufacturerItem" DisplayName="b_ItemSearch_Manufacturer_Item_ID"
					XPath="OrderLine/ItemDetails/PrimaryInformation" CompareAny="true">
					<QueryTypes>
						<QueryType QueryType="EQUALS" QueryTypeDesc="b_approval_is">
							<GreexFunction Name="equals" />
							<Configuration>
								<UIControlConfiguration xtype="xapprovaltriggercontrol"
									valueBinding="ItemList/Item/ItemID" entity="item" singleSelect="true" />
							</Configuration>
						</QueryType>
					</QueryTypes>
				</Attribute>
				<Attribute Name="CategoryPath" DisplayName="b_Approval_CategoryPath"
					XPath="OrderLine/ItemDetails/CategoryList/Category" DefaultQueryType="STARTSWITH"
					CompareAny="true">
					<QueryTypes>
						<QueryType QueryType="STARTSWITH" QueryTypeDesc="b_approval_startsWith">
							<GreexFunction Name="stringBegins" />
							<Configuration>
								<UIControlConfiguration xtype="xapprovaltriggercontrol"
									valueBinding="CategoryPath" entity="SellingCatalog"
									valueSuffix="/" />
							</Configuration>
						</QueryType>
					</QueryTypes>
				</Attribute>
				<Attribute Name="OrderedQty" DisplayName="b_Ordered_Qty"
					XPath="OrderLine" DefaultQueryType="EQUALS" CompareAny="true">
					<QueryTypes>
						<QueryType QueryType="EQUALS" QueryTypeDesc="b_approval_equals">
							<GreexFunction Name="doubleEqual" />
							<Configuration>
								<UIControlConfiguration xtype="xapprovalnumbercontrol"
									decimalPrecision="4" allowNegative="false" allowDecimals="true" maxValue="99999999999999" />
							</Configuration>
						</QueryType>
						<QueryType QueryType="GREATERTHAN" QueryTypeDesc="b_approval_greaterThan">
							<GreexFunction Name="doubleGreater" />
							<Configuration>
								<UIControlConfiguration xtype="xapprovalnumbercontrol"
									decimalPrecision="4" allowNegative="false" allowDecimals="true" maxValue="99999999999999" />
							</Configuration>
						</QueryType>
						<QueryType QueryType="GREATERTHANEQUAL" QueryTypeDesc="b_approval_greaterThanEq">
							<GreexFunction Name="doubleGreaterOrEqual" />
							<Configuration>
								<UIControlConfiguration xtype="xapprovalnumbercontrol"
									decimalPrecision="4" allowNegative="false" allowDecimals="true" maxValue="99999999999999" />
							</Configuration>
						</QueryType>
						<QueryType QueryType="LESSERTHAN" QueryTypeDesc="b_approval_lessThan">
							<GreexFunction Name="doubleLesser" />
							<Configuration>
								<UIControlConfiguration xtype="xapprovalnumbercontrol"
									decimalPrecision="4" allowNegative="false" allowDecimals="true" maxValue="99999999999999" />
							</Configuration>
						</QueryType>
						<QueryType QueryType="LESSERTHANEQUAL" QueryTypeDesc="b_approval_lessThanEq">
							<GreexFunction Name="doubleLesserOrEqual" />
							<Configuration>
								<UIControlConfiguration xtype="xapprovalnumbercontrol"
									decimalPrecision="4" allowNegative="false" allowDecimals="true" maxValue="99999999999999" />
							</Configuration>
						</QueryType>
					</QueryTypes>
				</Attribute>
			</Attributes>
		</Domain>
	</DomainList>
</ApprovalConfig>

Refer to the following table for more information about the XML attributes.


Component

Component Type

Component Location

Description

Name

Attribute

ApprovalConfig/DomainList/
Domain/

Indicates the XML name of the entity attribute.

DataCaptureName Attribute ApprovalConfig/DomainList/ Domain Indicates that the attribute belongs to the predefined Greex XML rule. The DataCaptureName is applicable only when the validation ID has predefined greex xml associated with it.
Note: The value of this attribute should be equal to the DataCapture attribute Name

DisplayName

Attribute

ApprovalConfig/DomainList/
Domain

Indicates the bundle key of a label that is displayed in a drop-down list for entity attributes. If the label is not mentioned, the Name attribute is considered as the bundle key to display the label. The bundle entry should be defined in the server-side bundle file.

XPath

Attribute

ApprovalConfig/DomainList/
Domain/Attributes/Attribute

Indicates the XML path of the element to which the entity attribute belongs. This XML path is also used by the corresponding Greex Rule XML to locate the entity attribute when the rule is being evaluated.

compareAny

Attribute

ApprovalConfig/DomainList/
Domain/Attributes/Attribute

Indicates that the attribute can compare any of the values of a collection.

QueryTypes

Element

ApprovalConfig/DomainList/
Domain/Attributes/Attribute/
QueryTypes

Indicates the parent element of the supported query types for the entity attribute.

QueryType

Element

ApprovalConfig/DomainList/
Domain/Attributes/Attribute/
QueryTypes/
QueryType

Indicates the query types that are supported for the entity attribute. Ensure that you set the value of the corresponding GreexFunction child element.

QueryType

Attribute

ApprovalConfig/DomainList/
Domain/Attributes/Attribute/
QueryTypes/QueryType

Indicates the query type.

QueryTypeDesc

Attribute

ApprovalConfig/DomainList/
Domain/Attributes/Attribute/
QueryTypes/QueryType

Indicates the bundle key of the label that is displayed for the query type in the UI. This bundle entry should be defined in the server-side bundle file.

GreexFunction

Element

ApprovalConfig/Domain/
Attributes/Attribute/
QueryTypes/QueryType/
GreexFunction

Indicates the Greex Function associated to a query type.

Name

Attribute

ApprovalConfig/DomainList/
Domain/Attributes/Attribute/
QueryTypes/QueryType/
GreexFunction

Indicates the Greex Function associated to a query type so that the condition using this query type can be transformed in a Greex Rule XML.

Configuration

Element

ApprovalConfig/DomainList/
Domain/Attributes/
Attribute/Configuration

Indicates that the entity attribute will have certain configurations for UI control and possible values for the entity attribute.

ActionURL

Attribute

ApprovalConfig/DomainList/
Domain/Attributes/Attribute/
QueryTypes/QueryType/
Configuration

Indicates the action that returns the list of possible values for the entity attribute. This action may either return the static list of predefined values or call the corresponding API to get them, and then return them. For example, ActionURL can return the values pertaining to the common codes, currency, and countries or regions.

UIControlConfiguration

Element

ApprovalConfig/DomainList/
Domain/Attributes/Attribute/
QueryTypes/QueryType/
Configuration/
UIControlConfiguration

Indicates that the entity attribute will have certain configurations for UI control.

xtype

Attribute

ApprovalConfig/DomainList/
Domain/Attributes/Attribute/
QueryTypes/QueryType/
Configuration/
UIControlConfiguration

Indicates the type of control that is displayed in the Conditions section in the Validation Rule Summary screen and Override Rule Summary for the entity attribute. For the list of xtypes and descriptions, see the section below, Possible xtypes for an XML Attribute When Defining an Entity Attribute.

decimalPrecision

Attribute

ApprovalConfig/DomainList/
Domain/Attributes/Attribute/
QueryTypes/QueryType/
Configuration/
UIControlConfiguration

Indicates the number of digits allowed after a decimal separator of a decimal number in a number field.

allowNegative

Attribute

ApprovalConfig/DomainList/
Domain/Attributes/Attribute/
QueryTypes/QueryType/
Configuration/
UIControlConfiguration

Indicates if negative values are allowed as an input in a number field.

minValue

Attribute

ApprovalConfig/DomainList/
Domain/Attributes/Attribute/
QueryTypes/QueryType/
Configuration/
UIControlConfiguration

Indicates the minimum value that is allowed as an input in a number field.

maxValue

Attribute

ApprovalConfig/DomainList/
Domain/Attributes/Attribute/
QueryTypes/QueryType/
Configuration/
UIControlConfiguration

Indicates the maximum value that is allowed as an input in a number field.

optionsBinding

Attribute

ApprovalConfig/DomainList/
Domain/Attributes/Attribute/
QueryTypes/QueryType/
Configuration/
UIControlConfiguration

The optionsBinding attribute is used to specify the repeating elements of the list that constitutes one value of either combination box values or radio button values.

Note: This is applicable only for a combination box and a radio button.

displayField

Attribute

ApprovalConfig/DomainList/
Domain/Attributes/Attribute/
QueryTypes/QueryType/
Configuration/
UIControlConfiguration

The displayField attribute specifies the attribute whose value is used as the label.

Note: This is applicable only for a combination box and a radio button.

valueField

Attribute

ApprovalConfig/DomainList/
Domain/Attributes/Attribute/
QueryTypes/QueryType/
Configuration/
UIControlConfiguration

The valueField attribute is used to uniquely identify the repeating element in order to display the correct value of the selected option from either a combination box or a radio button.

mandatory

Attribute

ApprovalConfig/DomainList/
Domain/Attributes/Attribute/
QueryTypes/QueryType/
Configuration/
UIControlConfiguration

The mandatory attribute is used to define the mandatory predefined data capture fields. If the attribute is not present in the model template xml, then its treated as true. However, if you set the attribute to false, then the user interface field would be a non mandatory field.

For example, while creating a validation rule for Tender Limit, payment type and payment capture type can be as set as optional fields and it can be customized in the model template xml by setting the attribute mandatory="false"

Note: This attribute is relevant only to those attributes in the model template xml which are used to define the predefined data capture fields.

UseExpression

Attribute

ApprovalConfig/DomainList/
Domain/Attributes/Attribute

The UseExpression attribute is used in the nested predefined greex function for the value captured in user interface while building a condition.

If the UseExpression is set to "Y", then, both the <expression> elements with a static function along with UniqueSearchString has to be provided.

UniqueSearchString

Attribute

ApprovalConfig/DomainList/
Domain/Attributes/Attribute

The UniqueSearchString attribute must be present and populated with a string fragment when the UseExperssion attribute is set to "Y".

UniqueSearchString is a string fragment which is common for both the predefined greex XML function that is provided as part of factory set up for a data capture attribute and for the pre determined greex function provided as part of metadata definition for the attribute in model template.

Note: The string fragment should be unique across all the pre determined greex functions in the model template.

Expression

Element

ApprovalConfig/DomainList/
Domain/Attributes/Attribute

The Expression element is used to define to nested greex function.
Note: The Expression element has to be defined only if UseExpression attribute is set to "Y".

Function

Attribute

ApprovalConfig/DomainList/
Domain/Attributes/Attribute/Expression

Indicates the nested Greex Function associated to a query type.
Note: The Function attribute has to be defined only if UseExpression attribute is set to "Y".

Possible xtypes for an XML attribute when defining an entity attribute

Following are the possible xtypes that can be used when defining the values of the XML attributes for an entity attribute:


xtype

Description

xapprovaltextcontrol

Used to display a text box in the UI.

xapprovalradiocontrol

Used to display radio buttons in the UI.

xapprovaldatecontrol

Used to display a field for entering date in the UI.

xapprovalcombocontrol

Used to display a drop-down list in the UI.

xapprovaltriggercontrol

Used to display a trigger field in the UI.

xapprovalattributelookup

Used to display the Item attribute lookup widget in the UI.

xapprovalnumbercontrol

Used to display a number field in the UI.

xapprovaldatetimecontrol

Used to display a field for entering date and the time in the UI.


Greex functions that are supported in Sterling Business Center

The following greex functions are supported in Sterling™ Business Center user interface as part of the model template xml.
GreexFunction
equals
doubleEqual
doubleGreater
doubleGreaterOrEqual
doubleLesser
doubleLesserOrEqual
equalsIgnoreCase
stringBegins
dateGreater
dateGreaterOrEqual
timestampGreater
timestampAdd

Note: In Sterling Business Center, the greex condition builder that is used for the validation condition supports grouping only up to two levels. That is, the pre-defined greex XML that is used to define a validation rule and an override rule, should restrict the grouping depth to two levels only.

Nested greex function that is supported in the model template of Sterling Business Center

When you select an attribute during the condition building in the Sterling Business Center user interface, and assign a value, the following greex function is generated: fn: equals (<Xpath to the selected attribute as referenced in input template>, “<user assigned value>".

Consider the example of selecting the customer level attribute in the Sterling Business Center user interface. The following greex function is generated : fn: equals (/OrderLine/Order/Customer/@CustomerLevel, "<user assigned value>".However, if you want the selected value to be placed at a deeper level, then, you can use the nested greex function that is supported in model template of Sterling Business Center.

Consider the example of a Return Window validation ID, where you select the Xpath from where the return window value needs to be read and the greex function to be generated is: fn:dateGreaterOrEqual(fn:dateAdd (/OrderLine/SalesOrder/@OrderDate, fn:evalXPath(<Xpath>)),/OrderLine/Order/@OrderDate) . In such a scenario, you can create the nested greex function as follows:

  1. Set the following configuration in model template for the Return Window attribute.
    set UseExpression="Y".
    set UniqueSearchString="<unique string fragment>"
    Note: This fragment should be derived from the greex function that is provided as a part of predefined greex xml for the corresponding attribute.
  2. Provide the nested greex function under the <Expression> element as follows:
    <Expression Function="fn:dateGreaterOrEqual(fn:dateAdd (/OrderLine/SalesOrder/@OrderDate, fn:evalXPath({0})), /OrderLine/Order/@OrderDate)" >
    					</Expression>
    
    
  3. Provide the attribute definition as follows:
    <Attribute Name="MinReturnWindow" DataCaptureName="ReturnWindowAttributePath" DisplayName="b_Min_Return_Window"
    					XPath="Dummy" UseExpression="Y" UniqueSearchString="ReturnWindowAttributePath" DefaultQueryType="EQUALS"
    					CompareAny="false" >
    					<Expression Function="fn:dateGreaterOrEqual(fn:dateAdd (/OrderLine/SalesOrder/@OrderDate, fn:evalXPath({0})), /OrderLine/Order/@OrderDate)" >
    					</Expression>
    					<QueryTypes>
    						<QueryType QueryType="EQUALS" QueryTypeDesc="b_approval_equals">
    							<GreexFunction Name="equals" />
    							<Configuration ActionURL="/sbc/systemadmin/getReturnWindowAttributes.do">
    								<UIControlConfiguration xtype="xapprovalcombocontrol"
    									displayField="CodeShortDescription" valueField="CodeValue"
    									optionsBinding="CommonCodeList/CommonCode" />
    							</Configuration>
    						</QueryType>
    					</QueryTypes>
    				</Attribute>
    Note: UniqueSearchString is a string fragment which is common for both the predefined greex XML function that is provided as part of factory set up for a data capture attribute and for the pre determined greex function provided as part of metadata definition for the attribute in model template. The string fragment should be unique across all the pre determined greex functions in the model template.