我不会从查询公司对象返回。但IDE将公司称为意外
我的错误是什么:
dialect "java"
query getBalance(World world, Company company)
$company := Company(companyName == "Intel") from world.getCompanies()
end
rule "BMWCarsToPerson"
when
$world : World()
$company : Company()
getBalance($world, $company)
/*$company : Company() from $world.getCompanies()*/
$manager : Manager() from $company.getManagers()
exists Car(name == BrandOfCar.BMW) from $manager.getCars()
$bmwCarsFromManager : Car(
name == BrandOfCar.BMW
) from $manager.getCars()
$person : Person(
name == "Elvis"
) from $world.getPersons()
/*$listMageners : List() from $manager*/
then
end
答案 0 :(得分:0)
您不应该(也不能)使用查询来执行此简单任务。取代
$company : Company()
getBalance($world, $company)
通过
$company: Company( companyName == "Intel" ) from $world.getCompanies()