I have a main form called contract details which has a field called total spend tracking.
This field needs to get updated based on the sub form called financial year which has fields year and spend . I need to update the total spend tracking. As im very new in using Drools using Mvel dialect i have written below script which is not working.
Could anyone please help me with this.
Thanks a lot in advance
package com.bmssolutions.analytics;
dialect "mvel"
import java.util.List;
import com.bmssolutions.analytics.ContractDetails;
import com.bmssolutions.analytics.FinancialYear;
rule "Sum of spend tracking"
when
$contractDetails: ContractDetails(currentObject, $totalSpend: totalSpendTracking)
$sum : Number ()from accumulate( FinancialYear( $spend: spend ) from
$contractDetails.financialYear;sum($spend))
then
$contractDetails.totalSpendTracking = $sum;
end