У меня есть следующее правило в слюнях. Происходит то, что $expense
оценивается на основе карты. Но я хочу, чтобы он оценивался для каждого пользователя ($u
).
rule "test":
when
$u: User()
$card: Card(user_id == $u.id)
$expense: Double() from
accumulate (
$transaction: Transactions(
card_id == $card.id,
transaction_date >= 'startDate',
transaction_date <= 'endDate'
),
sum($transaction.amount)
then
// do something with expense.
// but I want to the expense to be the expense for a user. not a card.
end