Defining New Conditions and Actions

A standard XML definition is used to define a condition or action.

Procedure

  1. Validate the correctness of the XML definition. You can use the $MQ_HOME/config/rules/RuleModel.dtd schema.
    <?xml version="1.0" encoding="UTF-8"?>
    <Condition ID="RejectedOrChangedAttrGrps" Visible="true">
    	<Type>String</Type>
    	<PresentationFormat PresentationFormat="the rejected/changed attribute group is ( an attribute group)"/>
    	<ConditionOperand>
    		<GetOperand>
    		<ClassName ClassName="com.tibco.mdm.integration.ruleengine.IAttributable"/>
    			<AttributeName AttributeName="RejectedOrChangedAttrGrps"/>
    			<DataSourceType Type="OBJECT"/>
    			<DataSourceValue Value="PRODUCT"/>
    		</GetOperand>
    	</ConditionOperand>
    	<BooleanOperator ProgrammingOperator="hasValue"/>
    	<ConditionOperand>
    		<ParameterOperand>
    			<SQLQuery Dependents="MasterCatalog" SQLQuery="select ag.name, ag.description from ATtributegroup ag where ag.ownerid = -1 #MasterCatalog#  or ag.ownerid = $MasterCatalog$ and ag.active = 'Y'  order by name #MasterCatalog# "/>
    		</ParameterOperand>
    	</ConditionOperand>
    </Condition>
  2. Change the following details for a new condition:

Result

  • ID – Needs to be unique across all conditions/actions defined under $MQ_HOME/config/rules.
  • Type – Data type
  • PresentationFormat – The text that is shown while showing/defining a rule.
    Note: The open and close braces in the text, that is, (and) are mandatory, and if you do not have them, the rules don't get saved.
  • AttributeName – This is the same as the name of the attribute in the workflow ‘parameter’ definition.
  • DataSourceType - Different ways to access the data:

    XPATH – Xpath into the mlXML document.

    OBJECT – Data access uses TIBCO MDM defined business objects. Below is the list of objects and their supported DataSource values

    • PRODUCT:

      RejectedOrChangedAttrGrps - Gets the list of rejected or changed attribute groups within the current event.

      ChangedAttrGrps - List of attribute groups that have changed within the current event.

      ConflictAttrGrps - List of attribute groups that have a conflict (during merge).

    • PROFILE

      TimedOutParticipantRoles - Gets the list of roles of users whose work items have timed out.

  • DataSourceValue

    For DataSourceType XPATH – the actual XPATH into the mlXML document to fetch the required data.

    For DataSourceType OBJECT – the command word to fetch the required data from the business object.

  • ProgrammingOperator – Below is the list of supported operators
    • equals – valid for all data types.
    • contains – valid for ‘String’ data types. Checks if a substring exists.
    • greaterThan – valid for all data types.
    • greaterThanEqual – valid for all data types.
    • lessThan – valid for all data types.
    • doesntHaveValue – Checks to see that a particular value is not among the array of values picked up by the DataSourceValue.
    • hasValue – Checks if a value exists in an array of values picked up by the DataSourceValue.
    • isEmpty – Checks to see if no value was found.
  • SQLQuery - This is used by the application to show a drop down list of possible values for a condition/action. In the given example, a list of repositories is shown.