Index: /trunk/sources/HeuristicLab.CEDMA.Core/OperatorLink.cs
===================================================================
--- /trunk/sources/HeuristicLab.CEDMA.Core/OperatorLink.cs	(revision 418)
+++ /trunk/sources/HeuristicLab.CEDMA.Core/OperatorLink.cs	(revision 419)
@@ -11,5 +11,5 @@
     public long Id {
       get { return id; }
-    } 
+    }
 
     private IOperator myOperator;
@@ -21,5 +21,6 @@
     public OperatorLink() : base() { } // for cloning and persistence
 
-    public OperatorLink(long id, IOperator op): base() {
+    public OperatorLink(long id, IOperator op)
+      : base() {
       this.id = id;
       this.myOperator = op;
@@ -30,16 +31,4 @@
       throw new NotSupportedException();
     }
-
-    //public override void AddConstraint(IConstraint constraint) {
-    //  throw new NotSupportedException();
-    //}
-
-    //public override void AddVariable(IVariable variable) {
-    //  throw new NotSupportedException();
-    //}
-
-    //public override void AddVariableInfo(IVariableInfo variableInfo) {
-    //  throw new NotSupportedException();
-    //}
 
     public override IOperation Apply(IScope scope) {
@@ -74,16 +63,4 @@
       base.Populate(node, restoredObjects);
     }
-
-    //public override void RemoveConstraint(IConstraint constraint) {
-    //  throw new NotSupportedException();
-    //}
-
-    //public override void RemoveVariable(string name) {
-    //  throw new NotSupportedException();
-    //}
-
-    //public override void RemoveVariableInfo(string formalName) {
-    //  throw new NotSupportedException();
-    //}
   }
 }
Index: /trunk/sources/HeuristicLab.CEDMA.DB/Database.cs
===================================================================
--- /trunk/sources/HeuristicLab.CEDMA.DB/Database.cs	(revision 418)
+++ /trunk/sources/HeuristicLab.CEDMA.DB/Database.cs	(revision 419)
@@ -55,5 +55,5 @@
             }
             using(DbCommand cmd = cnn.CreateCommand()) {
-              cmd.CommandText = "CREATE TABLE Agent (ID integer primary key autoincrement, ProjectId integer, ParentAgentId integer, Name text, Status text default "+ProcessStatus.Unknown+", CreationTime DateTime, RawData Blob)";
+              cmd.CommandText = "CREATE TABLE Agent (ID integer primary key autoincrement, ProjectId integer, ParentAgentId integer, Name text, Status text default " + ProcessStatus.Unknown + ", CreationTime DateTime, RawData Blob)";
               cmd.Transaction = t;
               cmd.ExecuteNonQuery();
@@ -365,5 +365,5 @@
             agent.Status = status;
             agent.Id = r.GetInt32(0);
-            agent.Name = r.IsDBNull(1)?"":r.GetString(1);
+            agent.Name = r.IsDBNull(1) ? "" : r.GetString(1);
             agent.RawData = (byte[])r.GetValue(2);
             agents.Add(agent);
@@ -389,5 +389,5 @@
                 agent.ParentAgentId = null;
                 agent.Id = r.GetInt32(0);
-                agent.Name = r.IsDBNull(1)?"-":r.GetString(1);
+                agent.Name = r.IsDBNull(1) ? "-" : r.GetString(1);
                 agent.Status = (ProcessStatus)Enum.Parse(typeof(ProcessStatus), r.GetString(2));
                 agent.RawData = (byte[])r.GetValue(3);
@@ -421,5 +421,5 @@
                 agent.ParentAgentId = parentAgentId;
                 agent.Id = r.GetInt32(0);
-                agent.Name = r.IsDBNull(1)?"-":r.GetString(1);
+                agent.Name = r.IsDBNull(1) ? "-" : r.GetString(1);
                 agent.Status = (ProcessStatus)Enum.Parse(typeof(ProcessStatus), r.GetString(2));
                 agent.RawData = (byte[])r.GetValue(3);
@@ -523,4 +523,29 @@
       return operators;
     }
+    public OperatorEntry GetOperator(long id) {
+      rwLock.EnterReadLock();
+      try {
+        using(DbConnection cnn = new SQLiteConnection(connectionString)) {
+          cnn.Open();
+          using(DbCommand c = cnn.CreateCommand()) {
+            c.CommandText = "Select id, name, rawdata from Operator where id=@Id";
+            DbParameter idParam = c.CreateParameter();
+            idParam.ParameterName = "@Id";
+            idParam.Value = id;
+            c.Parameters.Add(idParam);
+            using(DbDataReader r = c.ExecuteReader()) {
+              r.Read();
+              OperatorEntry op = new OperatorEntry();
+              op.Id = r.GetInt32(0);
+              op.Name = r.IsDBNull(1) ? "-" : r.GetString(1);
+              op.RawData = (byte[])r.GetValue(2);
+              return op;
+            }
+          }
+        }
+      } finally {
+        rwLock.ExitReadLock();
+      }
+    }
     #endregion
 
Index: /trunk/sources/HeuristicLab.CEDMA.Server/HeuristicLab.CEDMA.Server.csproj
===================================================================
--- /trunk/sources/HeuristicLab.CEDMA.Server/HeuristicLab.CEDMA.Server.csproj	(revision 418)
+++ /trunk/sources/HeuristicLab.CEDMA.Server/HeuristicLab.CEDMA.Server.csproj	(revision 419)
@@ -71,4 +71,8 @@
   </ItemGroup>
   <ItemGroup>
+    <ProjectReference Include="..\HeuristicLab.CEDMA.Core\HeuristicLab.CEDMA.Core.csproj">
+      <Project>{C27DDF6C-84DF-45EF-B82F-57A28DD51166}</Project>
+      <Name>HeuristicLab.CEDMA.Core</Name>
+    </ProjectReference>
     <ProjectReference Include="..\HeuristicLab.CEDMA.DB.Interfaces\HeuristicLab.CEDMA.DB.Interfaces.csproj">
       <Project>{4F9BB789-D561-436B-B226-2BF44B7D0804}</Project>
@@ -90,4 +94,8 @@
       <Project>{545CE756-98D8-423B-AC2E-6E7D70926E5C}</Project>
       <Name>HeuristicLab.Grid</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\HeuristicLab.Operators\HeuristicLab.Operators.csproj">
+      <Project>{A9983BA2-B3B2-475E-8E2C-62050B71D1C5}</Project>
+      <Name>HeuristicLab.Operators</Name>
     </ProjectReference>
     <ProjectReference Include="..\HeuristicLab.PluginInfrastructure\HeuristicLab.PluginInfrastructure.csproj">
Index: /trunk/sources/HeuristicLab.CEDMA.Server/RunScheduler.cs
===================================================================
--- /trunk/sources/HeuristicLab.CEDMA.Server/RunScheduler.cs	(revision 418)
+++ /trunk/sources/HeuristicLab.CEDMA.Server/RunScheduler.cs	(revision 419)
@@ -31,4 +31,6 @@
 using System.Diagnostics;
 using HeuristicLab.Data;
+using HeuristicLab.CEDMA.Core;
+using HeuristicLab.Operators;
 
 namespace HeuristicLab.CEDMA.Server {
@@ -73,8 +75,13 @@
         scope.AddVariable(new Variable("CedmaServerUri", new StringData(serverUri)));
         IOperatorGraph opGraph = (IOperatorGraph)PersistenceManager.RestoreFromGZip(entry.RawData);
-        AtomicOperation op = new AtomicOperation(opGraph.InitialOperator, scope);
+
+        foreach(IOperator op in opGraph.Operators) {
+          PatchLinks(op);
+        }
+
+        AtomicOperation operation = new AtomicOperation(opGraph.InitialOperator, scope);
         WaitHandle wHandle;
         lock(remoteCommLock) {
-          wHandle = jobManager.BeginExecuteOperation(op.Scope, op);
+          wHandle = jobManager.BeginExecuteOperation(operation.Scope, operation);
           database.UpdateAgent(entry.Id, ProcessStatus.Active);
         }
@@ -82,5 +89,5 @@
         Job job = new Job();
         job.AgentId = entry.Id;
-        job.Operation = op;
+        job.Operation = operation;
         job.WaitHandle = wHandle;
 
@@ -90,4 +97,22 @@
         }
       }
+    }
+
+    private void PatchLinks(IOperator op) {
+      if(op is OperatorLink) {
+        OperatorLink link = op as OperatorLink;
+        OperatorEntry targetEntry = database.GetOperator(link.Id);
+        IOperator target = (IOperator)PersistenceManager.RestoreFromGZip(targetEntry.RawData);
+        ReplaceOperatorInGraph(link, target);
+      } else if(op is CombinedOperator) {
+        CombinedOperator combinedOp = op as CombinedOperator;
+        foreach(IOperator internalOp in combinedOp.OperatorGraph.Operators) {
+          PatchLinks(internalOp);
+        }
+      }
+    }
+
+    private void ReplaceOperatorInGraph(OperatorLink link, IOperator target) {
+      throw new NotImplementedException();
     }
 
