How to use/retrieve relationship attributes value when used with “mult” function in rulebase
book
Article ID: KB0088385
calendar_today
Updated On:
Products
Versions
TIBCO Collaborative Information Manager
-
Not Applicable
-
Description
Resolution: How to use/retrieve relationship attributes value when used with “mult” function in rulebase
Environment: ========== TIBCO Product name and version: TIBCO Collaborative Information Manager 8.x.x Operating System(s): All Operating Systems
Symptoms: ======== Not able to use/retrieve relationship attributes value when used with “mult” function in rulebase.
Exception thrown:RUL-4603: Error in mult operation, while converting Recipe Repository Validations, value Unknown of data type java.lang.String into data type java.lang.Long.
When a constraint is used as follows above exception is thrown:
<declare> <var>UOMREL</var> <link type="relationship"> <literal>r1</literal> </link> </declare> <declare> <var>INGREDIENTSLINK</var> <link type="relationship_record"> <literal>r1</literal> </link> </declare> <declare> <var>QTY</var> <datatype type="number" /> </declare> <constraint> <name>ComputeTotalActualCost</name> <description>Calculate the total actual cost for the recipe as the summation of actual cost of ingredient x quantity required of the ingredient.</description> <action> <assign> <var>ACTUALCOST</var> <op func="plus"> <op func="mult"> <var>INGREDIENTSLINK/ACTUALCOST</var> <var>UOMREL/UNITQTY</var> </op> </op> </assign> </action> </constraint>
Cause: ===== Defect
Resolution: ======== Swap the position of relationship attribute and related record attribute in “mult” function as follows:
When the same constraint is changed to have the swapped position of the related record attribute and relationship attribute as follows in the constraint it works as expected.
<constraint> <name>ComputeTotalActualCost</name> <description>Calculate the total actual cost for the recipe as the summation of actual cost of ingredient x quantity required of the ingredient.</description> <action> <assign> <var>ACTUALCOST</var> <op func="plus"> <op func="mult"> <var>UOMREL/UNITQTY</var> <!—Swapped the position in mult function --> <var>INGREDIENTSLINK/ACTUALCOST</var> </op> </op> </assign> </action> </constraint>
References: =========
Issue/Introduction
How to use/retrieve relationship attributes value when used with “mult” function in rulebase