aware_support wroteYou cannot use IF in actions of the rule. Each IF must be a separate rule. Therefore, if you want to use IF after FIND you need a process
This should be really easy.
In Project I have an attribute BudgetTotal, type number, which sets an allocation total not to be exceeded by individual BudgetTransactions.
In Project I have an attribute BudgetTransactions, type BudgetTransaction
I have an object BudgetTransaction, owned by Project, with an amount attribute, a description, and a Project attribute, type project.
When a new BudgetTransaction is entered I need a business rule to check that the sum of all pre-existing BudgetTransaction instances + this new transaction do not exceed Project.BudgetTotal. If it does, report error.
Logically, the business rule needs to be on BudgetTransaction. In a business rule (If BudgetTransaction IS NEW), I have tried calling a process which takes BudgetTransaction and SystemUser as input. In the process, I find the project, sum the pre-existing transactions. I then store the sum to SystemUser.TempNumber1. I then check if Project.BudgetTotal is exceded by (SystemUser.TempNumber1 + BudgetTransaction.amount). If so, I REPORT ERROR.
I keep getting operation error, or internal error using this design.
I have also tried adding the REPORT ERROR inside BudgetTransaction, instead of the process.
This seems like a really simple thing to do. What I am I doing wrong?