Index: branches/2915-AbsoluteSymbol/HeuristicLab.Services.WebApp.Statistics/3.3/WebApi/ClientController.cs
===================================================================
--- branches/2915-AbsoluteSymbol/HeuristicLab.Services.WebApp.Statistics/3.3/WebApi/ClientController.cs	(revision 15943)
+++ branches/2915-AbsoluteSymbol/HeuristicLab.Services.WebApp.Statistics/3.3/WebApi/ClientController.cs	(revision 16240)
@@ -74,5 +74,6 @@
                   on client.Id equals info.ClientId into clientInfoJoin
                 from clientInfo in clientInfoJoin.OrderByDescending(x => x.Time).Take(1)
-                let offline = (client.ExpirationTime != null || clientInfo.SlaveState == SlaveState.Offline)
+                let offline = (client.DateExpired != null || clientInfo.SlaveState == SlaveState.Offline)
+                let parent = client.ParentResourceId.HasValue ? dimClientDao.GetById(client.ParentResourceId.Value) : null
                 select new DT.ClientDetails {
                   Id = client.Id,
@@ -85,6 +86,6 @@
                   State = offline ? SlaveState.Offline.ToString() : clientInfo.SlaveState.ToString(),
                   LastUpdate = clientInfo.Time,
-                  GroupId = client.ResourceGroupId,
-                  GroupName = client.GroupName,
+                  GroupId = client.ParentResourceId,
+                  GroupName = parent != null ? parent.Name : null,
                   UpTime = offline ? 0 : upTime,
                   TotalUnavailableTime = timeData != null ? timeData.TotalUnavailableTime : 0,
@@ -117,5 +118,5 @@
       var factClientInfoDao = pm.FactClientInfoDao;
       return pm.UseTransaction(() => {
-        var clients = expired ? dimClientDao.GetExpiredClients() : dimClientDao.GetActiveClients();
+        var clients = expired ? dimClientDao.GetAllExpiredSlaves() : dimClientDao.GetAllOnlineSlaves();
         var query = (from client in clients
                      join info in factClientInfoDao.GetAll()
@@ -123,4 +124,5 @@
                      from clientInfo in clientInfoJoin.OrderByDescending(x => x.Time).Take(1)
                      let offline = (expired || clientInfo.SlaveState == SlaveState.Offline)
+                     let parent = client.ParentResourceId.HasValue ? dimClientDao.GetById(client.ParentResourceId.Value) : null
                      select new DT.Client {
                        Id = client.Id,
@@ -132,6 +134,6 @@
                        CpuUtilization = offline ? 0 : clientInfo.CpuUtilization,
                        State = offline ? SlaveState.Offline.ToString() : clientInfo.SlaveState.ToString(),
-                       GroupId = client.ResourceGroupId,
-                       GroupName = client.GroupName,
+                       GroupId = client.ParentResourceId,
+                       GroupName = parent != null ? parent.Name : null,
                        IsAllowedToCalculate = clientInfo.IsAllowedToCalculate
                      });
@@ -200,6 +202,6 @@
       var factClientInfoDao = pm.FactClientInfoDao;
       return pm.UseTransaction(() => {
-        var clients = expired ? dimClientDao.GetExpiredClients() : dimClientDao.GetActiveClients();
-        clients = clients.Where(x => x.ResourceGroupId == id);
+        var clients = expired ? dimClientDao.GetAllExpiredClients() : dimClientDao.GetAllOnlineClients();
+        clients = clients.Where(x => x.ParentResourceId == id);
         var query = (from client in clients
                      join info in factClientInfoDao.GetAll()
@@ -207,4 +209,5 @@
                      from clientInfo in clientInfoJoin.OrderByDescending(x => x.Time).Take(1)
                      let offline = (expired || clientInfo.SlaveState == SlaveState.Offline)
+                     let parent = client.ParentResourceId.HasValue ? dimClientDao.GetById(client.ParentResourceId.Value) : null
                      select new DT.Client {
                        Id = client.Id,
@@ -216,6 +219,6 @@
                        CpuUtilization = offline ? 0 : clientInfo.CpuUtilization,
                        State = offline ? SlaveState.Offline.ToString() : clientInfo.SlaveState.ToString(),
-                       GroupId = client.ResourceGroupId,
-                       GroupName = client.GroupName,
+                       GroupId = client.ParentResourceId,
+                       GroupName = parent != null ? parent.Name : null,
                        IsAllowedToCalculate = clientInfo.IsAllowedToCalculate
                      });
@@ -247,5 +250,5 @@
           client => client.Id,
           (fact, client) => new {
-            client.ResourceGroupId,
+            client.ParentResourceId,
             fact.Time,
             fact.CpuUtilization,
@@ -255,5 +258,5 @@
             fact.UsedMemory
           })
-        .Where(x => x.ResourceGroupId == id)
+        .Where(x => x.ParentResourceId == id)
         .ToList();
       var clientStatus = new DT.ClientStatus {
Index: branches/2915-AbsoluteSymbol/HeuristicLab.Services.WebApp.Statistics/3.3/WebApi/GroupController.cs
===================================================================
--- branches/2915-AbsoluteSymbol/HeuristicLab.Services.WebApp.Statistics/3.3/WebApi/GroupController.cs	(revision 15943)
+++ branches/2915-AbsoluteSymbol/HeuristicLab.Services.WebApp.Statistics/3.3/WebApi/GroupController.cs	(revision 16240)
@@ -42,11 +42,11 @@
         var clientTimeData = factClientInfoDao.GetAll()
           .Join(dimClientDao.GetAll(), x => x.ClientId, y => y.Id, (x, y) => new {
-            y.ResourceGroupId,
+            y.ParentResourceId,
             x.IdleTime,
             x.OfflineTime,
             x.UnavailableTime
           })
-          .Where(x => x.ResourceGroupId == id)
-          .GroupBy(x => x.ResourceGroupId)
+          .Where(x => x.ParentResourceId == id)
+          .GroupBy(x => x.ParentResourceId)
           .Select(x => new {
             TotalIdleTime = x.Sum(y => y.IdleTime),
@@ -68,12 +68,13 @@
           })
           .FirstOrDefault();
-        return (from client in dimClientDao.GetActiveClients().Where(x => x.ResourceGroupId == id)
+        return (from client in dimClientDao.GetAllOnlineSlaves().Where(x => x.ParentResourceId == id)
                 join info in factClientInfoDao.GetAll()
                   on client.Id equals info.ClientId into clientInfoJoin
                 from clientInfo in clientInfoJoin.OrderByDescending(x => x.Time).Take(1)
                 let offline = (clientInfo.SlaveState == DA.SlaveState.Offline)
+                let parent = client.ParentResourceId.HasValue ? dimClientDao.GetById(client.ParentResourceId.Value) : null
                 select new {
-                  ResourceGroupId = client.ResourceGroupId,
-                  GroupName = client.GroupName,
+                  ResourceGroupId = client.ParentResourceId,
+                  GroupName = parent != null ? parent.Name : null,
                   TotalCores = clientInfo.NumTotalCores,
                   UsedCores = offline ? 0 : clientInfo.NumUsedCores,
@@ -114,5 +115,5 @@
       var dimClientDao = pm.DimClientDao;
       var factClientInfoDao = pm.FactClientInfoDao;
-      var data = (from client in dimClientDao.GetActiveClients()
+      var data = (from client in dimClientDao.GetAllOnlineSlaves()
                   join info in factClientInfoDao.GetAll()
                     on client.Id equals info.ClientId into clientInfoJoin
@@ -120,5 +121,5 @@
                   let offline = (clientInfo.SlaveState == DA.SlaveState.Offline)
                   select new {
-                    ResourceGroupId = client.ResourceGroupId,
+                    ResourceGroupId = client.ParentResourceId,
                     TotalCores = clientInfo.NumTotalCores,
                     UsedCores = offline ? 0 : clientInfo.NumUsedCores,
@@ -137,10 +138,9 @@
                     CpuUtilization = x.Where(y => y.SlaveState != DA.SlaveState.Offline).Average(y => (double?)y.CpuUtilization) ?? 0.0
                   });
-      var query = dimClientDao.GetAll()
-        .GroupBy(x => new { x.ResourceGroupId, x.GroupName })
-        .Select(x => new {
-          Id = x.Key.ResourceGroupId ?? default(Guid),
-          Name = x.Key.GroupName
-        });
+
+      var query = dimClientDao.GetAllOnlineSlaveGroups().Select(x => new {
+        Id = x.ResourceId,
+        Name = x.Name
+      });
       return pm.UseTransaction(() => new DT.GroupPage {
         TotalGroups = query.Count(),
