Index: trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/manager/TaskTreeManager.java
===================================================================
--- trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/manager/TaskTreeManager.java	(revision 1113)
+++ trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/manager/TaskTreeManager.java	(revision 1146)
@@ -21,9 +21,9 @@
 
 import de.ugoe.cs.autoquest.eventcore.Event;
-import de.ugoe.cs.autoquest.tasktrees.treeifc.IEventTask;
-import de.ugoe.cs.autoquest.tasktrees.treeifc.ISequence;
-import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskTree;
-import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskTreeBuilder;
-import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskTreeNodeFactory;
+import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask;
+import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskModel;
+import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskBuilder;
+import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskFactory;
+import de.ugoe.cs.autoquest.tasktrees.treeifc.IUserSession;
 import de.ugoe.cs.util.console.Console;
 
@@ -37,15 +37,14 @@
     
     /** */
-    private ITaskTreeBuilder taskTreeBuilder = ComponentManager.getDefaultTaskTreeBuilder();
+    private ITaskBuilder taskBuilder = ComponentManager.getDefaultTaskBuilder();
 
     /** */
-    private ITaskTreeNodeFactory taskTreeNodeFactory =
-        ComponentManager.getDefaultTaskTreeNodeFactory();
+    private ITaskFactory taskFactory = ComponentManager.getDefaultTaskFactory();
 
     /** */
-    private List<List<IEventTask>> sessions = null;
+    private List<IUserSession> sessions = null;
 
     /** */
-    private List<IEventTask> currentSession = null;
+    private IUserSession currentSession = null;
 
     /**
@@ -53,5 +52,5 @@
      */
     public TaskTreeManager() {
-        sessions = new LinkedList<List<IEventTask>>();
+        sessions = new LinkedList<IUserSession>();
     }
 
@@ -59,5 +58,5 @@
      *
      */
-    public synchronized ITaskTree createTaskTree(Collection<List<Event>> newSessions) {
+    public synchronized ITaskModel createTaskModel(Collection<List<Event>> newSessions) {
         if ((currentSession != null) || (sessions.size() > 0)) {
             throw new IllegalStateException("do not mix calls to this method with calls to the " +
@@ -75,5 +74,5 @@
         }
         
-        return getTaskTree();
+        return getTaskModel();
     }
 
@@ -83,6 +82,6 @@
     public void handleNewEvent(Event event) {
         assertSessionSequence();
-        currentSession.add
-            (taskTreeNodeFactory.createNewEventTask(event.getType(), event.getTarget()));
+        ITask eventTask = taskFactory.createNewEventTask(event.getType(), event.getTarget());
+        taskBuilder.addExecutedTask(currentSession, taskFactory.createNewTaskInstance(eventTask));
     }
 
@@ -91,5 +90,5 @@
      */
     public void finishSession() {
-        if ((currentSession != null) && (currentSession.size() > 0)) {
+        if ((currentSession != null) && (currentSession.getExecutedTasks().size() > 0)) {
             sessions.add(currentSession);
             currentSession = null;
@@ -100,27 +99,12 @@
      *
      */
-    public synchronized ITaskTree getTaskTree() {
+    public synchronized ITaskModel getTaskModel() {
         finishSession();
         
         Console.traceln(Level.INFO, "applying temporal relationship generation rules");
         
-        ISequence rootSequence = taskTreeNodeFactory.createNewSequence();
-        taskTreeBuilder.setDescription(rootSequence, "root");
-        
-        for (List<IEventTask> session : sessions) {
-            ISequence sequence = taskTreeNodeFactory.createNewSequence();
-            taskTreeBuilder.setDescription(sequence, "session");
-            
-            for (IEventTask eventTask : session) {
-                taskTreeBuilder.addChild(sequence, eventTask);
-            }
-            
-            taskTreeBuilder.addChild(rootSequence, sequence);
-        }
-        
-        
-        ComponentManager.getTemporalRelationshipRuleManager().applyRules(rootSequence);
+        ComponentManager.getTemporalRelationshipRuleManager().applyRules(sessions);
 
-        return taskTreeNodeFactory.createTaskTree(rootSequence);
+        return taskFactory.createTaskModel(sessions);
     }
 
@@ -130,5 +114,5 @@
     private void assertSessionSequence() {
         if (currentSession == null) {
-            currentSession = new LinkedList<IEventTask>();
+            currentSession = taskFactory.createUserSession();
         }
     }
