Index: /trunk/sources/HeuristicLab.Clients.Hive.JobManager/3.3/HeuristicLab.Clients.Hive.JobManager-3.3.csproj
===================================================================
--- /trunk/sources/HeuristicLab.Clients.Hive.JobManager/3.3/HeuristicLab.Clients.Hive.JobManager-3.3.csproj	(revision 10149)
+++ /trunk/sources/HeuristicLab.Clients.Hive.JobManager/3.3/HeuristicLab.Clients.Hive.JobManager-3.3.csproj	(revision 10150)
@@ -98,4 +98,6 @@
     <Compile Include="ExtensionMethods\TreeNodeExtensions.cs" />
     <Compile Include="ListViewItemDateComparer.cs" />
+    <Compile Include="MenuItems\CreateHiveJobMenuItem.cs" />
+    <Compile Include="MenuItems\RunInHiveMenuItem.cs" />
     <Compile Include="Plugin.cs" />
     <Compile Include="Views\HiveJobManagerView.cs">
Index: /trunk/sources/HeuristicLab.Clients.Hive.JobManager/3.3/MenuItems/CreateHiveJobMenuItem.cs
===================================================================
--- /trunk/sources/HeuristicLab.Clients.Hive.JobManager/3.3/MenuItems/CreateHiveJobMenuItem.cs	(revision 10150)
+++ /trunk/sources/HeuristicLab.Clients.Hive.JobManager/3.3/MenuItems/CreateHiveJobMenuItem.cs	(revision 10150)
@@ -0,0 +1,83 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using HeuristicLab.Clients.Hive;
+using HeuristicLab.Core;
+using HeuristicLab.MainForm;
+using HeuristicLab.Optimization;
+
+namespace HeuristicLab.Optimizer.MenuItems {
+  public class CreateHiveJobMenuItem : HeuristicLab.MainForm.WindowsForms.MenuItem, IOptimizerUserInterfaceItemProvider {
+    public override string Name {
+      get { return "&Create Hive Job"; }
+    }
+    public override IEnumerable<string> Structure {
+      get { return new string[] { "&Services", "&Hive" }; }
+    }
+
+    public override int Position {
+      get { return 10001; }
+    }
+
+    protected override void OnActiveViewChanged(object sender, EventArgs e) {
+      IContentView activeView = MainFormManager.MainForm.ActiveView as IContentView;
+
+      if (activeView != null && activeView.Content != null && !activeView.Locked) {
+        var content = activeView.Content as IItem;
+        if (content != null) {
+          Type contentType = content.GetType();
+          ToolStripItem.Enabled = ItemTask.IsTypeSupported(contentType);
+        } else {
+          ToolStripItem.Enabled = false;
+        }
+      }
+    }
+
+    public override void Execute() {
+      IContentView activeView = MainFormManager.MainForm.ActiveView as IContentView;
+      var content = activeView.Content as IItem;
+
+      //IOptimizer and IExecutables need some special care
+      if (content is IOptimizer) {
+        ((IOptimizer)content).Runs.Clear();
+      }
+      if (content is IExecutable) {
+        IExecutable exec = content as IExecutable;
+        if (exec.ExecutionState != ExecutionState.Prepared) {
+          exec.Prepare();
+        }
+      }
+
+      HiveClient.Instance.Refresh();
+
+      ItemTask hiveTask = ItemTask.GetItemTaskForItem(content);
+      HiveTask task = hiveTask.CreateHiveTask();
+      RefreshableJob rJob = new RefreshableJob();
+      rJob.Job.Name = content.ItemName;
+      rJob.HiveTasks.Add(task);
+      task.ItemTask.ComputeInParallel = content is Experiment || content is BatchRun;
+
+      MainFormManager.MainForm.ShowContent(rJob);
+    }
+  }
+}
Index: /trunk/sources/HeuristicLab.Clients.Hive.JobManager/3.3/MenuItems/RunInHiveMenuItem.cs
===================================================================
--- /trunk/sources/HeuristicLab.Clients.Hive.JobManager/3.3/MenuItems/RunInHiveMenuItem.cs	(revision 10150)
+++ /trunk/sources/HeuristicLab.Clients.Hive.JobManager/3.3/MenuItems/RunInHiveMenuItem.cs	(revision 10150)
@@ -0,0 +1,104 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Threading;
+using HeuristicLab.Clients.Hive;
+using HeuristicLab.Core;
+using HeuristicLab.MainForm;
+using HeuristicLab.Optimization;
+using HeuristicLab.PluginInfrastructure;
+
+namespace HeuristicLab.Optimizer.MenuItems {
+  public class RunInHiveMenuItem : HeuristicLab.MainForm.WindowsForms.MenuItem, IOptimizerUserInterfaceItemProvider {
+    public override string Name {
+      get { return "&Run In Hive"; }
+    }
+    public override IEnumerable<string> Structure {
+      get { return new string[] { "&Services", "&Hive" }; }
+    }
+
+    public override int Position {
+      get { return 10002; }
+    }
+
+    protected override void OnActiveViewChanged(object sender, EventArgs e) {
+      IContentView activeView = MainFormManager.MainForm.ActiveView as IContentView;
+
+      if (activeView != null && activeView.Content != null && !activeView.Locked) {
+        var content = activeView.Content as IItem;
+        if (content != null) {
+          Type contentType = content.GetType();
+          ToolStripItem.Enabled = ItemTask.IsTypeSupported(contentType);
+        } else {
+          ToolStripItem.Enabled = false;
+        }
+      }
+    }
+
+    private IProgress progress;
+    private IItem content;
+    public override void Execute() {
+      IContentView activeView = MainFormManager.MainForm.ActiveView as IContentView;
+      content = activeView.Content as IItem;
+
+      //IOptimizer and IExecutables need some special care
+      if (content is IOptimizer) {
+        ((IOptimizer)content).Runs.Clear();
+      }
+      if (content is IExecutable) {
+        IExecutable exec = content as IExecutable;
+        if (exec.ExecutionState != ExecutionState.Prepared) {
+          exec.Prepare();
+        }
+      }
+
+      HiveClient.Instance.Refresh();
+
+      ItemTask hiveTask = ItemTask.GetItemTaskForItem(content);
+      HiveTask task = hiveTask.CreateHiveTask();
+      RefreshableJob rJob = new RefreshableJob();
+      rJob.Job.Name = content.ItemName;
+      rJob.HiveTasks.Add(task);
+      task.ItemTask.ComputeInParallel = content is Experiment || content is BatchRun;
+
+      progress = MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>().AddOperationProgressToContent(this.content, "Uploading to Hive...");
+      rJob.Progress = progress;
+      progress.ProgressStateChanged += progress_ProgressStateChanged;
+
+      HiveClient.StartJob(new Action<Exception>(HandleEx), rJob, new CancellationToken());
+    }
+
+    private void progress_ProgressStateChanged(object sender, EventArgs e) {
+      if (progress.ProgressState != ProgressState.Started) {
+        MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromContent(content);
+        progress.ProgressStateChanged -= progress_ProgressStateChanged;
+      }
+    }
+
+    private void HandleEx(Exception ex) {
+      MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromContent(content);
+      progress.ProgressStateChanged -= progress_ProgressStateChanged;
+      ErrorHandling.ShowErrorDialog("Error uploading tasks", ex);
+    }
+  }
+}
Index: /trunk/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views/RefreshableHiveJobView.cs
===================================================================
--- /trunk/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views/RefreshableHiveJobView.cs	(revision 10149)
+++ /trunk/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views/RefreshableHiveJobView.cs	(revision 10150)
@@ -23,5 +23,4 @@
 using System.ComponentModel;
 using System.Linq;
-using System.Reflection;
 using System.Text;
 using System.Threading;
@@ -472,9 +471,5 @@
       Type objType = obj.GetType();
 
-      var typeHiveTaskMap = ApplicationManager.Manager.GetTypes(typeof(ItemTask))
-          .Select(t => new Tuple<PropertyInfo, Type>(t.GetProperties().Single(x => x.Name == "Item" && x.PropertyType != typeof(IItem)), t));
-
-      var hiveTaskFound = typeHiveTaskMap.Any(x => x.Item1.PropertyType.IsAssignableFrom(objType));
-
+      var hiveTaskFound = ItemTask.IsTypeSupported(objType);
       if (hiveTaskFound) {
         if (Content.Id != Guid.Empty) e.Effect = DragDropEffects.None;
@@ -486,15 +481,9 @@
     private void jobsTreeView_DragDrop(object sender, DragEventArgs e) {
       if (e.Effect != DragDropEffects.None) {
-        var obj = e.Data.GetData(Constants.DragDropDataFormat) as IDeepCloneable;
-        Type objType = obj.GetType();
-
-        var typeHiveTaskMap = ApplicationManager.Manager.GetTypes(typeof(ItemTask))
-            .Select(t => new Tuple<PropertyInfo, Type>(t.GetProperties().Single(x => x.Name == "Item" && x.PropertyType != typeof(IItem)), t));
-
-        var hiveTaskType = typeHiveTaskMap.Single(x => x.Item1.PropertyType.IsAssignableFrom(objType)).Item2;
-
-        IDeepCloneable newObj = null;
+        var obj = e.Data.GetData(Constants.DragDropDataFormat) as IItem;
+
+        IItem newObj = null;
         if (e.Effect.HasFlag(DragDropEffects.Copy)) {
-          newObj = obj.Clone(new Cloner());
+          newObj = obj.Clone(new Cloner()) as IItem;
         } else {
           newObj = obj;
@@ -512,5 +501,5 @@
         }
 
-        ItemTask hiveTask = Activator.CreateInstance(hiveTaskType, new object[] { newObj }) as ItemTask;
+        ItemTask hiveTask = ItemTask.GetItemTaskForItem(newObj);
         Content.HiveTasks.Add(hiveTask.CreateHiveTask());
       }
Index: /trunk/sources/HeuristicLab.Clients.Hive/3.3/HiveClient.cs
===================================================================
--- /trunk/sources/HeuristicLab.Clients.Hive/3.3/HiveClient.cs	(revision 10149)
+++ /trunk/sources/HeuristicLab.Clients.Hive/3.3/HiveClient.cs	(revision 10150)
@@ -351,5 +351,5 @@
     /// </summary>
     /// <param name="parentHiveTask">shall be null if its the root task</param>
-    private void UploadTaskWithChildren(Progress progress, HiveTask hiveTask, HiveTask parentHiveTask, IEnumerable<Guid> groups, int[] taskCount, int totalJobCount, Guid configPluginId, Guid jobId, ILog log, bool isPrivileged, CancellationToken cancellationToken) {
+    private void UploadTaskWithChildren(IProgress progress, HiveTask hiveTask, HiveTask parentHiveTask, IEnumerable<Guid> groups, int[] taskCount, int totalJobCount, Guid configPluginId, Guid jobId, ILog log, bool isPrivileged, CancellationToken cancellationToken) {
       taskUploadSemaphore.WaitOne();
       bool semaphoreReleased = false;
Index: /trunk/sources/HeuristicLab.Clients.Hive/3.3/RefreshableJob.cs
===================================================================
--- /trunk/sources/HeuristicLab.Clients.Hive/3.3/RefreshableJob.cs	(revision 10149)
+++ /trunk/sources/HeuristicLab.Clients.Hive/3.3/RefreshableJob.cs	(revision 10150)
@@ -157,6 +157,6 @@
     }
 
-    private Progress progress;
-    public Progress Progress {
+    private IProgress progress;
+    public IProgress Progress {
       get { return progress; }
       set {
Index: /trunk/sources/HeuristicLab.Clients.Hive/3.3/Tasks/EngineTask.cs
===================================================================
--- /trunk/sources/HeuristicLab.Clients.Hive/3.3/Tasks/EngineTask.cs	(revision 10149)
+++ /trunk/sources/HeuristicLab.Clients.Hive/3.3/Tasks/EngineTask.cs	(revision 10150)
@@ -60,7 +60,5 @@
     }
 
-    public EngineTask(IEngine engine) {
-      this.Item = engine;
-    }
+    public EngineTask(IEngine engine) : base(engine) { }
 
     [StorableConstructor]
Index: /trunk/sources/HeuristicLab.Clients.Hive/3.3/Tasks/ItemTask.cs
===================================================================
--- /trunk/sources/HeuristicLab.Clients.Hive/3.3/Tasks/ItemTask.cs	(revision 10149)
+++ /trunk/sources/HeuristicLab.Clients.Hive/3.3/Tasks/ItemTask.cs	(revision 10150)
@@ -22,8 +22,10 @@
 using System;
 using System.Drawing;
+using System.Linq;
 using HeuristicLab.Common;
 using HeuristicLab.Core;
 using HeuristicLab.Hive;
 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.PluginInfrastructure;
 
 namespace HeuristicLab.Clients.Hive {
@@ -76,4 +78,7 @@
       this.Item = cloner.Clone(original.Item);
     }
+    public ItemTask(IItem item) {
+      Item = item;
+    }
 
     [StorableHook(HookType.AfterDeserialization)]
@@ -216,4 +221,27 @@
       return Name;
     }
+
+    #region Helpers
+    public static bool IsTypeSupported(Type itemType) {
+      var supportedHiveTaskTypes = ApplicationManager.Manager.GetTypes(typeof(ItemTask))
+          .Select(t => t.GetProperties().Single(x => x.Name == "Item" && x.PropertyType != typeof(IItem)).PropertyType);
+      return supportedHiveTaskTypes.Any(x => x.IsAssignableFrom(itemType));
+    }
+
+    public static Type GetHiveTaskType(Type itemType) {
+      if (!IsTypeSupported(itemType)) throw new Exception("Item " + itemType + " is not supported for Hive.");
+
+      var typeHiveTaskMap = ApplicationManager.Manager.GetTypes(typeof(ItemTask))
+          .Select(t => new Tuple<Type, Type>(t.GetProperties().Single(x => x.Name == "Item" && x.PropertyType != typeof(IItem)).PropertyType, t));
+
+      return typeHiveTaskMap.Single(x => x.Item1.IsAssignableFrom(itemType)).Item2;
+    }
+
+    public static ItemTask GetItemTaskForItem(IItem item) {
+      Type itemType = item.GetType();
+      Type hiveTaskType = GetHiveTaskType(itemType);
+      return Activator.CreateInstance(hiveTaskType, new object[] { item }) as ItemTask;
+    }
+    #endregion
   }
 }
Index: /trunk/sources/HeuristicLab.Clients.Hive/3.3/Tasks/OptimizerTask.cs
===================================================================
--- /trunk/sources/HeuristicLab.Clients.Hive/3.3/Tasks/OptimizerTask.cs	(revision 10149)
+++ /trunk/sources/HeuristicLab.Clients.Hive/3.3/Tasks/OptimizerTask.cs	(revision 10150)
@@ -50,6 +50,6 @@
     }
 
-    public OptimizerTask(IOptimizer optimizer) {
-      this.Item = optimizer;
+    public OptimizerTask(IOptimizer optimizer)
+      : base(optimizer) {
 
       if (optimizer is Experiment) {
