Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.Tests/Mocks/MockHiveService.cs
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.Tests/Mocks/MockHiveService.cs	(revision 5137)
+++ branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.Tests/Mocks/MockHiveService.cs	(revision 5155)
@@ -85,5 +85,5 @@
 
     #region Job Methods
-    public Guid AddJob(Job job, JobData jobData) {
+    public Guid AddJob(Job job, JobData jobData, IEnumerable<Guid> slaveGroupIds) {
       job.Id = Guid.NewGuid();
       jobData.JobId = job.Id;
@@ -93,5 +93,5 @@
     }
 
-    public Guid AddChildJob(Guid parentJobId, Job job, JobData jobData) {
+    public Guid AddChildJob(Guid parentJobId, Job job, JobData jobData, IEnumerable<Guid> slaveGroupIds) {
       job.Id = Guid.NewGuid();
       job.ParentJobId = parentJobId;
Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/ExperimentManager/HiveExperimentClient.cs
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/ExperimentManager/HiveExperimentClient.cs	(revision 5137)
+++ branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/ExperimentManager/HiveExperimentClient.cs	(revision 5155)
@@ -282,5 +282,5 @@
       } else {
         // response = service.AddJobWithGroupStrings(serializedJob, groups);
-        hiveJob.Job.Id = service.AddJob(hiveJob.Job, jobData);
+        hiveJob.Job.Id = service.AddJob(hiveJob.Job, jobData, null); // todo: use ResourceIds
       }
 
Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Common/3.4/ServiceContracts/IHiveService.cs
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Common/3.4/ServiceContracts/IHiveService.cs	(revision 5137)
+++ branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Common/3.4/ServiceContracts/IHiveService.cs	(revision 5155)
@@ -15,5 +15,5 @@
     #region Job Methods
     [OperationContract]
-    Guid AddJob(Job job, JobData jobData);
+    Guid AddJob(Job job, JobData jobData, IEnumerable<Guid> slaveGroupIds);
 
     [OperationContract]
Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/HiveDao.cs
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/HiveDao.cs	(revision 5137)
+++ branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/HiveDao.cs	(revision 5155)
@@ -57,5 +57,5 @@
     }
 
-    public IEnumerable<DT.Job> GetAvailableParentJobs(Guid slaveId) {
+    public IEnumerable<DT.Job> GetWaitingParentJobs(Guid slaveId) {
       using (var db = CreateContext()) {
         // todo: slaveId is unused!
@@ -80,5 +80,5 @@
                     orderby j.Priority descending
                     select Convert.ToDto(j);
-        return query.Union(GetAvailableParentJobs(slave.Id)).OrderByDescending(x => x.Priority).ToArray();
+        return query.Union(GetWaitingParentJobs(slave.Id)).OrderByDescending(x => x.Priority).ToArray();
       }
     }
@@ -363,4 +363,19 @@
         if (entity != null) db.Resources.DeleteOnSubmit(entity);
         db.SubmitChanges();
+      }
+    }
+
+    public void AssignJobToResource(Guid jobId, Guid resourceId) {
+      using (var db = CreateContext()) {
+        var job = db.Jobs.Where(x => x.JobId == jobId).Single();
+        job.AssignedResources.Add(new AssignedResource() { JobId = jobId, ResourceId = resourceId });
+        db.SubmitChanges();
+      }
+    }
+
+    public IEnumerable<DT.Resource> GetAssignedResources(Guid jobId) {
+      using (var db = CreateContext()) {
+        var job = db.Jobs.Where(x => x.JobId == jobId).Single();
+        return job.AssignedResources.Select(x => Convert.ToDto(x.Resource)).ToArray();
       }
     }
Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/HiveDataContext.dbml.layout
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/HiveDataContext.dbml.layout	(revision 5137)
+++ branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/HiveDataContext.dbml.layout	(revision 5155)
@@ -1,61 +1,61 @@
 ﻿<?xml version="1.0" encoding="utf-8"?>
-<ordesignerObjectsDiagram dslVersion="1.0.0.0" absoluteBounds="0, 0, 16.25, 12.25" name="HiveDataContext">
+<ordesignerObjectsDiagram dslVersion="1.0.0.0" absoluteBounds="0, 0, 15.75, 8.5" name="HiveDataContext">
   <DataContextMoniker Name="/HiveDataContext" />
   <nestedChildShapes>
-    <classShape Id="a929c9dc-69f4-4488-ba1c-a2342bf81d89" absoluteBounds="12.75, 2.875, 2, 1.3862939453124987">
+    <classShape Id="a929c9dc-69f4-4488-ba1c-a2342bf81d89" absoluteBounds="8.875, 3.75, 2, 1.3862939453124987">
       <DataClassMoniker Name="/HiveDataContext/AssignedResource" />
       <nestedChildShapes>
-        <elementListCompartment Id="8b005775-f0ee-41b0-ae10-6d1151003708" absoluteBounds="12.765, 3.3350000000000009, 1.9700000000000002, 0.8262939453125" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
+        <elementListCompartment Id="8b005775-f0ee-41b0-ae10-6d1151003708" absoluteBounds="8.89, 4.2100000000000009, 1.9700000000000002, 0.8262939453125" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
       </nestedChildShapes>
     </classShape>
-    <classShape Id="7d998e56-4fba-41ca-a1a8-1dcdb9068edf" absoluteBounds="9, 10.625, 2, 1.3862939453125005">
+    <classShape Id="7d998e56-4fba-41ca-a1a8-1dcdb9068edf" absoluteBounds="9, 5.5, 2, 1.3862939453125005">
       <DataClassMoniker Name="/HiveDataContext/Plugin" />
       <nestedChildShapes>
-        <elementListCompartment Id="ec4ba325-6dff-4418-baad-59af81ae2024" absoluteBounds="9.015, 11.085, 1.9700000000000002, 0.8262939453125" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
+        <elementListCompartment Id="ec4ba325-6dff-4418-baad-59af81ae2024" absoluteBounds="9.015, 5.9600000000000009, 1.9700000000000002, 0.8262939453125" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
       </nestedChildShapes>
     </classShape>
-    <classShape Id="97b00810-fa30-457e-b484-b4e80b22f91b" absoluteBounds="9.25, 8.875, 2, 1.3862939453124987">
+    <classShape Id="97b00810-fa30-457e-b484-b4e80b22f91b" absoluteBounds="6.5, 5.5, 2, 1.3862939453124987">
       <DataClassMoniker Name="/HiveDataContext/RequiredPlugin" />
       <nestedChildShapes>
-        <elementListCompartment Id="df6451e5-069e-4ca0-a909-61b8213b5047" absoluteBounds="9.265, 9.335, 1.9700000000000002, 0.8262939453125" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
+        <elementListCompartment Id="df6451e5-069e-4ca0-a909-61b8213b5047" absoluteBounds="6.5150000000000006, 5.9600000000000009, 1.9700000000000002, 0.8262939453125" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
       </nestedChildShapes>
     </classShape>
-    <classShape Id="706a4581-6daf-4e71-ae2a-87d50b27a051" absoluteBounds="11.75, 0.75, 2, 1.5785953776041666">
+    <classShape Id="706a4581-6daf-4e71-ae2a-87d50b27a051" absoluteBounds="11.25, 1, 2, 1.5785953776041666">
       <DataClassMoniker Name="/HiveDataContext/Resource" />
       <nestedChildShapes>
-        <elementListCompartment Id="8c24f5bf-2164-4d0f-832e-1730eb0066df" absoluteBounds="11.765, 1.21, 1.9700000000000002, 1.0185953776041665" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
+        <elementListCompartment Id="8c24f5bf-2164-4d0f-832e-1730eb0066df" absoluteBounds="11.265, 1.46, 1.9700000000000002, 1.0185953776041665" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
       </nestedChildShapes>
     </classShape>
-    <classShape Id="695bfc39-59f3-4e60-8644-f847964bf62c" absoluteBounds="9.25, 4.375, 2, 3.5016097005208326">
+    <classShape Id="695bfc39-59f3-4e60-8644-f847964bf62c" absoluteBounds="6.5, 1, 2, 3.5016097005208326">
       <DataClassMoniker Name="/HiveDataContext/Job" />
       <nestedChildShapes>
-        <elementListCompartment Id="a6a30e11-03d1-4869-82e6-b733f4ef9974" absoluteBounds="9.265, 4.835, 1.9700000000000002, 2.941609700520833" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
+        <elementListCompartment Id="a6a30e11-03d1-4869-82e6-b733f4ef9974" absoluteBounds="6.5150000000000006, 1.46, 1.9700000000000002, 2.941609700520833" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
       </nestedChildShapes>
     </classShape>
-    <classShape Id="8d5712f7-7a1a-4a89-bd4d-fd60200d3306" absoluteBounds="11.75, 4.625, 2, 2.1554996744791666">
+    <classShape Id="8d5712f7-7a1a-4a89-bd4d-fd60200d3306" absoluteBounds="13.5, 2.5, 2, 2.1554996744791666">
       <DataClassMoniker Name="/HiveDataContext/UptimeCalendar" />
       <nestedChildShapes>
-        <elementListCompartment Id="7d8f121b-35bb-4753-a25f-3fac1562e68e" absoluteBounds="11.765, 5.0850000000000009, 1.9700000000000002, 1.5954996744791665" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
+        <elementListCompartment Id="7d8f121b-35bb-4753-a25f-3fac1562e68e" absoluteBounds="13.515, 2.9600000000000009, 1.9700000000000002, 1.5954996744791665" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
       </nestedChildShapes>
     </classShape>
-    <classShape Id="e6f840cc-2968-4be1-b234-eef624ccacbb" absoluteBounds="4.875, 6, 2, 2.1554996744791666">
+    <classShape Id="e6f840cc-2968-4be1-b234-eef624ccacbb" absoluteBounds="4.125, 2.625, 2, 2.1554996744791666">
       <DataClassMoniker Name="/HiveDataContext/HiveExperiment" />
       <nestedChildShapes>
-        <elementListCompartment Id="0c65d4e1-256a-4a91-9a57-392f25e4de7f" absoluteBounds="4.8900000000000006, 6.4600000000000009, 1.9700000000000002, 1.5954996744791665" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
+        <elementListCompartment Id="0c65d4e1-256a-4a91-9a57-392f25e4de7f" absoluteBounds="4.1400000000000006, 3.0850000000000009, 1.9700000000000002, 1.5954996744791665" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
       </nestedChildShapes>
     </classShape>
-    <classShape Id="26f4edfa-91dd-4941-a058-359f89e567a8" absoluteBounds="9.375, 0.75, 2, 2.3478011067708335">
+    <classShape Id="26f4edfa-91dd-4941-a058-359f89e567a8" absoluteBounds="8.875, 1, 2, 2.3478011067708335">
       <DataClassMoniker Name="/HiveDataContext/Slave" />
       <nestedChildShapes>
-        <elementListCompartment Id="1e61f36b-08dc-4df7-8594-c9dcd95c0791" absoluteBounds="9.39, 1.21, 1.9700000000000002, 1.7878011067708333" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
+        <elementListCompartment Id="1e61f36b-08dc-4df7-8594-c9dcd95c0791" absoluteBounds="8.89, 1.46, 1.9700000000000002, 1.7878011067708333" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
       </nestedChildShapes>
     </classShape>
-    <classShape Id="bbd91675-92f2-4a69-8429-0950008fc8a4" absoluteBounds="14, 0.75, 2, 0.8093896484375">
+    <classShape Id="bbd91675-92f2-4a69-8429-0950008fc8a4" absoluteBounds="13.5, 1, 2, 0.8093896484375">
       <DataClassMoniker Name="/HiveDataContext/SlaveGroup" />
       <nestedChildShapes>
-        <elementListCompartment Id="5a790e8f-6e2e-4bf5-bd2b-f8a82224d9d7" absoluteBounds="14, 0.75, 0.125, 0.2493896484375" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
+        <elementListCompartment Id="5a790e8f-6e2e-4bf5-bd2b-f8a82224d9d7" absoluteBounds="13.5, 1, 0.125, 0.2493896484375" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
       </nestedChildShapes>
     </classShape>
-    <inheritanceConnector edgePoints="[(11.75 : 1.53929768880208); (11.375 : 1.53929768880208)]" fixedFrom="Algorithm" fixedTo="Algorithm" TargetRelationshipDomainClassId="7a7fe09e-e9ef-4b01-9ff3-bde95e827b62">
+    <inheritanceConnector edgePoints="[(11.25 : 1.78929768880208); (10.875 : 1.78929768880208)]" fixedFrom="Algorithm" fixedTo="Algorithm" TargetRelationshipDomainClassId="7a7fe09e-e9ef-4b01-9ff3-bde95e827b62">
       <nodes>
         <classShapeMoniker Id="706a4581-6daf-4e71-ae2a-87d50b27a051" />
@@ -63,5 +63,5 @@
       </nodes>
     </inheritanceConnector>
-    <inheritanceConnector edgePoints="[(13.75 : 1.15469482421875); (14 : 1.15469482421875)]" fixedFrom="Algorithm" fixedTo="Algorithm" TargetRelationshipDomainClassId="7a7fe09e-e9ef-4b01-9ff3-bde95e827b62">
+    <inheritanceConnector edgePoints="[(13.25 : 1.40469482421875); (13.5 : 1.40469482421875)]" fixedFrom="Algorithm" fixedTo="Algorithm" TargetRelationshipDomainClassId="7a7fe09e-e9ef-4b01-9ff3-bde95e827b62">
       <nodes>
         <classShapeMoniker Id="706a4581-6daf-4e71-ae2a-87d50b27a051" />
@@ -69,5 +69,5 @@
       </nodes>
     </inheritanceConnector>
-    <associationConnector edgePoints="[(13.25 : 2.32859537760417); (13.25 : 2.875)]" fixedFrom="Algorithm" fixedTo="Algorithm">
+    <associationConnector edgePoints="[(12.25 : 2.57859537760417); (12.25 : 4.44314697265625); (10.875 : 4.44314697265625)]" fixedFrom="Algorithm" fixedTo="Algorithm">
       <AssociationMoniker Name="/HiveDataContext/Resource/Resource_AssignedResource" />
       <nodes>
@@ -76,5 +76,5 @@
       </nodes>
     </associationConnector>
-    <associationConnector edgePoints="[(11.25 : 7.20274983723958); (14.34375 : 7.20274983723958); (14.34375 : 4.2612939453125)]" fixedFrom="NotFixed" fixedTo="NotFixed">
+    <associationConnector edgePoints="[(8.5 : 4.12580485026042); (8.875 : 4.12580485026042)]" fixedFrom="Algorithm" fixedTo="Algorithm">
       <AssociationMoniker Name="/HiveDataContext/Job/Job_AssignedResource" />
       <nodes>
@@ -83,5 +83,5 @@
       </nodes>
     </associationConnector>
-    <associationConnector edgePoints="[(10.25 : 7.87660970052083); (10.25 : 8.875)]" fixedFrom="NotFixed" fixedTo="NotFixed">
+    <associationConnector edgePoints="[(7.1210551923077 : 4.50160970052083); (7.1210551923077 : 5.5)]" fixedFrom="Algorithm" fixedTo="Algorithm">
       <AssociationMoniker Name="/HiveDataContext/Job/Job_RequiredPlugin" />
       <nodes>
@@ -90,5 +90,5 @@
       </nodes>
     </associationConnector>
-    <associationConnector edgePoints="[(11.0834359271285 : 7.87660970052083); (11.0834359271285 : 7.95910970052083); (11.1656121961154 : 7.95910970052083); (11.1656121961154 : 8.12660970052083); (10.5546153846154 : 8.12660970052083); (10.5546153846154 : 7.87660970052083)]" manuallyRouted="true" fixedFrom="NotFixed" fixedTo="NotFixed">
+    <associationConnector edgePoints="[(8.3334359271285 : 4.50160970052083); (8.3334359271285 : 4.58410970052083); (8.4156121961154 : 4.58410970052083); (8.4156121961154 : 4.75160970052083); (7.8046153846154 : 4.75160970052083); (7.8046153846154 : 4.50160970052083)]" manuallyRouted="true" fixedFrom="NotFixed" fixedTo="NotFixed">
       <AssociationMoniker Name="/HiveDataContext/Job/Job_Job" />
       <nodes>
@@ -97,5 +97,5 @@
       </nodes>
     </associationConnector>
-    <associationConnector edgePoints="[(10.3125 : 3.09780110677083); (10.3125 : 4.375)]" fixedFrom="NotFixed" fixedTo="NotFixed">
+    <associationConnector edgePoints="[(8.875 : 2.17390055338542); (8.5 : 2.17390055338542)]" fixedFrom="Algorithm" fixedTo="Algorithm">
       <AssociationMoniker Name="/HiveDataContext/Slave/Slave_Job" />
       <nodes>
@@ -104,5 +104,5 @@
       </nodes>
     </associationConnector>
-    <associationConnector edgePoints="[(12.21875 : 2.32859537760417); (12.21875 : 4.625)]" fixedFrom="Algorithm" fixedTo="Algorithm">
+    <associationConnector edgePoints="[(12.781252 : 2.57859537760417); (12.781252 : 3.54212367513021); (13.5 : 3.54212367513021)]" fixedFrom="Algorithm" fixedTo="Algorithm">
       <AssociationMoniker Name="/HiveDataContext/Resource/Resource_UptimeCalendar" />
       <nodes>
@@ -111,5 +111,5 @@
       </nodes>
     </associationConnector>
-    <associationConnector edgePoints="[(9.25 : 6.93830485026042); (6.875 : 6.93830485026042)]" fixedFrom="NotFixed" fixedTo="NotFixed">
+    <associationConnector edgePoints="[(6.5 : 3.56330485026042); (6.125 : 3.56330485026042)]" fixedFrom="Algorithm" fixedTo="Algorithm">
       <AssociationMoniker Name="/HiveDataContext/Job/Job_HiveExperiment" />
       <nodes>
@@ -118,17 +118,17 @@
       </nodes>
     </associationConnector>
-    <classShape Id="6bc13f26-f9a8-4597-b054-35be34190d12" absoluteBounds="6.875, 4.375, 2, 1.3862939453124996">
+    <classShape Id="6bc13f26-f9a8-4597-b054-35be34190d12" absoluteBounds="4.125, 1, 2, 1.3862939453124996">
       <DataClassMoniker Name="/HiveDataContext/JobData" />
       <nestedChildShapes>
-        <elementListCompartment Id="a068522c-7974-4679-b356-e33c941c465b" absoluteBounds="6.89, 4.835, 1.9700000000000002, 0.8262939453125" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
+        <elementListCompartment Id="a068522c-7974-4679-b356-e33c941c465b" absoluteBounds="4.14, 1.46, 1.9700000000000002, 0.8262939453125" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
       </nestedChildShapes>
     </classShape>
-    <classShape Id="ad25bd0f-80e8-4a06-abd8-190eb678eec7" absoluteBounds="11.5, 10.625, 2, 1.1939925130208344">
+    <classShape Id="ad25bd0f-80e8-4a06-abd8-190eb678eec7" absoluteBounds="11.375, 5.5, 2, 1.1939925130208344">
       <DataClassMoniker Name="/HiveDataContext/PluginData" />
       <nestedChildShapes>
-        <elementListCompartment Id="acddb513-7de6-4bb4-8335-d6982fb2ef35" absoluteBounds="11.515, 11.085, 1.9700000000000002, 0.63399251302083326" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
+        <elementListCompartment Id="acddb513-7de6-4bb4-8335-d6982fb2ef35" absoluteBounds="11.39, 5.9600000000000009, 1.9700000000000002, 0.63399251302083326" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
       </nestedChildShapes>
     </classShape>
-    <associationConnector edgePoints="[(11 : 11.2219962565104); (11.5 : 11.2219962565104)]" fixedFrom="NotFixed" fixedTo="NotFixed">
+    <associationConnector edgePoints="[(11 : 6.09699625651042); (11.375 : 6.09699625651042)]" fixedFrom="Algorithm" fixedTo="Algorithm">
       <AssociationMoniker Name="/HiveDataContext/Plugin/Plugin_PluginData" />
       <nodes>
@@ -137,5 +137,5 @@
       </nodes>
     </associationConnector>
-    <associationConnector edgePoints="[(9.25 : 5.06814697265625); (8.875 : 5.06814697265625)]" fixedFrom="NotFixed" fixedTo="NotFixed">
+    <associationConnector edgePoints="[(6.5 : 1.69314697265625); (6.125 : 1.69314697265625)]" fixedFrom="Algorithm" fixedTo="Algorithm">
       <AssociationMoniker Name="/HiveDataContext/Job/Job_JobData" />
       <nodes>
@@ -144,5 +144,5 @@
       </nodes>
     </associationConnector>
-    <associationConnector edgePoints="[(10.125 : 10.625); (10.125 : 10.2612939453125)]" fixedFrom="NotFixed" fixedTo="NotFixed">
+    <associationConnector edgePoints="[(9 : 6.19314697265625); (8.5 : 6.19314697265625)]" fixedFrom="Algorithm" fixedTo="Algorithm">
       <AssociationMoniker Name="/HiveDataContext/Plugin/Plugin_RequiredPlugin" />
       <nodes>
@@ -151,5 +151,5 @@
       </nodes>
     </associationConnector>
-    <associationConnector edgePoints="[(12.4524234637921 : 0.75); (12.4524234637921 : 0.5); (13.0617468474559 : 0.5); (13.0617468474559 : 0.75)]" fixedFrom="NotFixed" fixedTo="NotFixed">
+    <associationConnector edgePoints="[(11.9524234637921 : 1); (11.9524234637921 : 0.75); (12.5617468474559 : 0.75); (12.5617468474559 : 1)]" fixedFrom="NotFixed" fixedTo="NotFixed">
       <AssociationMoniker Name="/HiveDataContext/Resource/Resource_Resource" />
       <nodes>
Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/Interfaces/IHiveDao.cs
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/Interfaces/IHiveDao.cs	(revision 5137)
+++ branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/Interfaces/IHiveDao.cs	(revision 5155)
@@ -75,4 +75,6 @@
     void UpdateResource(DT.Resource dto);
     void DeleteResource(Guid id);
+    void AssignJobToResource(Guid jobId, Guid resourceId);
+    IEnumerable<DT.Resource> GetAssignedResources(Guid jobId);
     #endregion
 
Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Tests/DaoTests.cs
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Tests/DaoTests.cs	(revision 5137)
+++ branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Tests/DaoTests.cs	(revision 5155)
@@ -33,5 +33,4 @@
       DT.Job job1 = new DT.Job();
       job1.DateCreated = DateTime.Now;
-      job1.JobState = JobState.Waiting;
       job1.Id = dao.AddJob(job1);
 
@@ -46,5 +45,9 @@
 
       Assert.AreEqual(null, dao.GetJob(job1.Id));
+    }
 
+    [TestMethod]
+    public void TestSlaveDao() {
+      IHiveDao dao = ServiceLocator.Instance.HiveDao;
       DT.SlaveGroup slaveGroup = new DT.SlaveGroup() {
         Name = "Test"
@@ -52,5 +55,23 @@
       slaveGroup.Id = dao.AddSlaveGroup(slaveGroup);
 
+      DT.Slave slave = new DT.Slave() {
+        Name = "Test"
+      };
+      slave.Id= dao.AddSlave(slave);
+
+      dao.DeleteSlave(slave.Id);
       dao.DeleteSlaveGroup(slaveGroup.Id);
+    }
+
+    [TestMethod]
+    public void TestJobDaoWaiting() {
+      IHiveDao dao = ServiceLocator.Instance.HiveDao;
+
+      DT.Job job = new DT.Job();
+      job.DateCreated = DateTime.Now;
+      job.JobState = JobState.Waiting;
+      job.Id = dao.AddJob(job);
+
+
     }
   }
Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Tests/ServiceTests.cs
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Tests/ServiceTests.cs	(revision 5137)
+++ branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Tests/ServiceTests.cs	(revision 5155)
@@ -48,5 +48,5 @@
       };
 
-      job.Id = service.AddJob(job, jobData);
+      job.Id = service.AddJob(job, jobData, null);
       experiment.RootJobId = job.Id;
 
@@ -89,5 +89,5 @@
         };
         JobData jobData = new JobData() { Data = PersistenceUtil.Serialize(new MockJob(500, false)) };
-        job.Id = service.AddJob(job, jobData);
+        job.Id = service.AddJob(job, jobData, null);
         jobs.Add(job);
       }
Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive/3.4/HiveService.cs
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive/3.4/HiveService.cs	(revision 5137)
+++ branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive/3.4/HiveService.cs	(revision 5155)
@@ -35,11 +35,19 @@
     //[PrincipalPermission(SecurityAction.Demand, Role = HiveRoles.Administrator)]
     //[PrincipalPermission(SecurityAction.Demand, Role = HiveRoles.Client)]
-    public Guid AddJob(Job job, JobData jobData) {
+    public Guid AddJob(Job job, JobData jobData, IEnumerable<Guid> slaveGroupIds) {
       using (trans.OpenTransaction()) {
         job.UserId = auth.UserId;
         job.DateCreated = DateTime.Now;
         job.JobState = JobState.Waiting;
-        jobData.JobId = dao.AddJob(job);
+        job.Id = dao.AddJob(job);
+        jobData.JobId = job.Id;
         jobData.LastUpdate = DateTime.Now;
+        if (slaveGroupIds != null) {
+          foreach (Guid slaveGroupId in slaveGroupIds) {
+            dao.AssignJobToResource(job.Id, slaveGroupId);
+          }
+        } else {
+          // todo: use default group
+        }
         dao.AddJobData(jobData);
         return jobData.JobId;
@@ -50,6 +58,5 @@
       using (trans.OpenTransaction()) {
         job.ParentJobId = parentJobId;
-        jobData.LastUpdate = DateTime.Now;
-        return AddJob(job, jobData);
+        return AddJob(job, jobData, dao.GetAssignedResources(parentJobId).Select(x => x.Id));
       }
     }
