Approval rule – sample configuration metadata XML file

You can review the sample XML file for an approval rule.

Below is a sample configuration metadata XML file for an Approval Rule.


<ApprovalConfig> 
   <Domain Name="Order">  
      <Attributes>  
          <Attribute Name="OrderDate" DisplayName="b_Effective_Start_Date"
            XPath="Order" DefaultQueryType="DATEGREATER"> 
            <QueryTypes> 
              <QueryType QueryType="DATEGREATER" QueryTypeDesc="b_date_greater"> 
                <GreexFunction Name="dateGreater" /> 
                <Configuration> 
                  <UIControlConfiguration xtype="xapprovaldatecontrol" /> 
                </Configuration> 
              </QueryType> 
            </QueryTypes> 
          </Attribute> 
      </Attributes> 
   </Domain> 
</ApprovalConfig>

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

Component

Component Type

Component Location

Description

Name

Attribute

ApprovalConfig/Domain/
Attributes/Attribute

Indicates the XML name of the entity attribute.

DisplayName

Attribute

ApprovalConfig/Domain/
Attributes/Attribute

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/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 approval rule is being evaluated.

DefaultQueryTypes

Attribute

ApprovalConfig/Domain/
Attributes/Attribute

Indicates the default query type for the entity attribute.

compareAny

Attribute

ApprovalConfig/Domain/
Attributes/Attribute

Indicates that the Greex engine compares any of the values of the corresponding XPath.

QueryTypes

Element

ApprovalConfig/Domain/
Attributes/Attribute/QueryTypes

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

QueryType

Element

ApprovalConfig/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/Domain/
Attributes/Attribute/QueryTypes/
QueryType

Indicates the query type.

QueryTypeDesc

Attribute

ApprovalConfig/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/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/Domain/
Attributes/Attribute

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

ActionURL

Attribute

ApprovalConfig/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/Domain/
Attributes/Attribute/QueryTypes/
QueryType/Configuration/
UIControlConfiguration

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

xtype

Attribute

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

Indicates the type of control that is displayed in the Conditions panel in the Approval Rule Summary screen 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/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/Domain/
Attributes/Attribute/QueryTypes/
QueryType/Configuration/
UIControlConfiguration

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

maxValue

Attribute

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

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

optionsBinding

Attribute

ApprovalConfig/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/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/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.

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.