From ba6bd2c40a22a4a9cf2307ceec0f71e4fbdc842c Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Fri, 5 Feb 2021 10:51:00 +0100 Subject: Better dba rules. --- modules/ri-base/src/main/resources/io/trygvis/rules/dba/dba.drl | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'modules/ri-base') diff --git a/modules/ri-base/src/main/resources/io/trygvis/rules/dba/dba.drl b/modules/ri-base/src/main/resources/io/trygvis/rules/dba/dba.drl index c31bc57..f1a1da2 100644 --- a/modules/ri-base/src/main/resources/io/trygvis/rules/dba/dba.drl +++ b/modules/ri-base/src/main/resources/io/trygvis/rules/dba/dba.drl @@ -14,19 +14,18 @@ global io.trygvis.rules.engine.TemplateEngine te; dialect "mvel" declare DbaMachineRole - machine : String + machine : Machine roles : String[] end rule "Assign containers to machine" when - $machine : Machine() - $machineRole : DbaMachineRole(machine == $machine.name) + $machineRole : DbaMachineRole(machine) $container : Container(machine == null, $machineRole.roles contains machineRole) then - System.out.println("Assigning container to machine: " + $machine.name); + System.out.println("Assigning container " + $container.cluster.name + "/" + $container.name + " to machine: " + $machineRole.machine.name); modify ($container) { - machine = $machine + machine = $machineRole.machine } end -- cgit v1.2.3