How to use/retrieve relationship attributes value when used with “mult” function in rulebase

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:

&ltdeclare>
      &ltvar&gtUOMREL</var>
      &ltlink type="relationship">
         &ltliteral&gtr1</literal>
      </link>
   </declare>
   &ltdeclare>
      &ltvar&gtINGREDIENTSLINK</var>
      &ltlink type="relationship_record">
         &ltliteral&gtr1</literal>
      </link>
   </declare>
   &ltdeclare>
      &ltvar&gtQTY</var>
      &ltdatatype type="number" />
   </declare>
   &ltconstraint>
      &ltname&gtComputeTotalActualCost</name>
      &ltdescription&gtCalculate the total actual cost for the recipe as the summation of actual cost of ingredient x quantity required of the ingredient.</description>
      &ltaction>
         &ltassign>
            &ltvar&gtACTUALCOST</var>
            &ltop func="plus">
               &ltop func="mult">
&ltvar&gtINGREDIENTSLINK/ACTUALCOST</var>
&ltvar&gtUOMREL/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.

&ltconstraint>
      &ltname&gtComputeTotalActualCost</name>
      &ltdescription&gtCalculate the total actual cost for the recipe as the summation of actual cost of ingredient x quantity required of the ingredient.</description>
      &ltaction>
         &ltassign>
            &ltvar&gtACTUALCOST</var>
            &ltop func="plus">
               &ltop func="mult">
                  &ltvar&gtUOMREL/UNITQTY</var> <!—Swapped the position in mult function -->
                      &ltvar&gtINGREDIENTSLINK/ACTUALCOST</var>
                 </op>
            </op>
         </assign>
      </action>
   </constraint>


References:
=========

Issue/Introduction

How to use/retrieve relationship attributes value when used with “mult” function in rulebase