Defining a New Rule Domain

Procedure

  1. Identify all the conditions and actions that might be needed.
  2. Configure the identified conditions and actions into the rule domain definition under $MQ_HOME/config/rules.
  3. To validate the correctness of the rule domain, you can use the $MQ_HOME/config/rules/RuleModel.dtd schema.

For example, the following shows a rule domain with 10 conditions and 7 actions:

<RuleModel OrganizationID="234" RulesetName="Product Edit Approval" RuleModeName="None" Priority="0" RuleID="-1" RuleType="Standard">
	<Description><![CDATA[Conditions and actions defined by the "Product Edit Approval" builder can be used to create various rule templates. Rules created from the templates define list of participants involved during the approval process.</Description>
	<Imports>
		<Import Import="com.tibco.mdm.integration.ruleengine.IAttributable;"/>
	</Imports>
	<Conditions>
		<ImportConditions>
			<ImportCondition ImportCondition="CONDITION_DefaultRuleCheck.xml" default="Y"/>
			<ImportCondition ImportCondition="CONDITION_Organization.xml" default="Y"/>
			<ImportCondition ImportCondition="CONDITION_MasterCatalog-CatalogAction.xml"
default="Y"/>
			<ImportCondition ImportCondition="CONDITION_Action.xml" default="Y"/>
			<ImportCondition ImportCondition="CONDITION_CatalogProductUOM.xml"/>
			<ImportCondition ImportCondition="CONDITION_CatalogProductSupplierID.xml"/>
			<ImportCondition ImportCondition="CONDITION_CatalogChangeCode.xml"/>
			<ImportCondition ImportCondition="CONDITION_DocumentTypeProd.xml"/>
			<ImportCondition ImportCondition="CONDITION_ConvState.xml" default="Y"/>
			<ImportCondition ImportCondition="CONDITION_DeploymentMode.xml" default="Y" />
		</ImportConditions>
	</Conditions>
	<Actions>
		<ImportActions>
			<ImportAction ImportAction="ACTION_DefaultRuleCheck.xml" default="Y"/>
			<ImportAction ImportAction="ACTION_RoleParticipant.xml"/>
			<ImportAction ImportAction="ACTION_RoleType.xml"/>
			<ImportAction ImportAction="ACTION_MemberParticipant.xml" default="Y"/>
			<ImportAction ImportAction="ACTION_EnterpriseMemberParticipant.xml"/>
			<ImportAction ImportAction="ACTION_MemberType.xml" default="Y"/>
			<ImportAction ImportAction="ACTION_ConvState.xml" default="Y"/>
		</ImportActions>
	</Actions>
</RuleModel>
Note: The following is a mandatory condition: <ImportCondition ImportCondition="CONDITION_DefaultRuleCheck.xml" default="Y"/>

Do not remove this condition while defining a new business process domain, else an error occurs.

  1. Edit the defaultdata.xml ($MQ_HOME/config/security/defaultdata.xml) file. Add the following entries. These will add the rule domain and the ‘default’ rule templates for new enterprises created henceforth.

    Each section corresponds to the type of enterprise you are creating.

    • For a supplier, make an entry to the following sections:
      <mq_default table="rulemetamodel" orgType="SUPPLIER">
      <mq_default table="rulemodel" orgType="SUPPLIER">

      For a retailer, make an entry to the following sections:

      <mq_default table="rulemetamodel" orgType="RETAILER">
      <mq_default table="rulemodel" orgType="RETAILER">
    • For a datapool, make an entry to the following sections:
      <mq_default table="rulemetamodel" orgType="MARKETPLACE">
      <mq_default table="rulemodel" orgType="MARKETPLACE">