Index: trunk/ippTasks/addstar.pro
===================================================================
--- trunk/ippTasks/addstar.pro	(revision 32832)
+++ trunk/ippTasks/addstar.pro	(revision 33030)
@@ -53,10 +53,28 @@
 
 macro addstar.revert.off
-  task addstar.revert
+  task addstar.revert.cam
+    active false
+  end
+ task addstar.revert.stack
+    active false
+  end
+ task addstar.revert.staticsky
+    active false
+  end
+ task addstar.revert.staticsky_multi
     active false
   end
 end
 macro addstar.revert.on
-  task addstar.revert
+  task addstar.revert.cam
+    active true
+  end
+  task addstar.revert.stack
+    active true
+  end
+  task addstar.revert.staticsky_multi
+    active true
+  end
+  task addstar.revert.staticsky
     active true
   end
@@ -65,6 +83,10 @@
 
 # this variable will cycle through the known database names
-$addstar_DB = 0
-$addstar_revert_DB = 0
+$addstar_DB = 0 
+#this may not work for more databases (addstar) will do that later)
+$addstar_revert_DB_C = 0
+$addstar_revert_DB_S = 0
+$addstar_revert_DB_SS = 0
+$addstar_revert_DB_SSM = 0
 
 
@@ -318,5 +340,6 @@
     book getword addPendingExp $pageName stage_extra1 -var STAGE_EXTRA1
     book getword addPendingExp $pageName stageroot -var STAGEROOT
-    book getword addPendingExp $pageName stage -var STAGE  
+    book getword addPendingExp $pageName stage -var STAGE
+    book getword addPendingExp $pageName stage_id -var STAGE_ID
     book getword addPendingExp $pageName workdir -var WORKDIR_TEMPLATE
     book getword addPendingExp $pageName reduction -var REDUCTION
@@ -367,4 +390,7 @@
     if ("$STAGE" == "staticsky_multi")
       $run = $run --multi_num $STAGE_EXTRA1
+    end
+    if ("$STAGE" == "cam") 
+      $run = $run --stage_id $STAGE_ID
     end
     if ("$IMAGE_ONLY" == "T")
@@ -411,5 +437,5 @@
 end
 
-task addstar.revert
+task addstar.revert.cam
   host         local
 
@@ -425,13 +451,13 @@
   task.exec
     if ($LABEL:n == 0) break
-    $run = addtool -revertprocessedexp
-    if ($DB:n == 0)
-      option DEFAULT
-    else
-      # save the DB name for the exit tasks
-      option $DB:$addstar_revert_DB
-      $run = $run -dbname $DB:$addstar_revert_DB
-      $addstar_revert_DB ++
-      if ($addstar_revert_DB >= $DB:n) set addstar_revert_DB = 0
+    $run = addtool -revertprocessedexp -stage cam
+    if ($DB:n == 0)
+      option DEFAULT
+    else
+      # save the DB name for the exit tasks
+      option $DB:$addstar_revert_DB_C
+      $run = $run -dbname $DB:$addstar_revert_DB_C
+      $addstar_revert_DB_C ++
+      if ($addstar_revert_DB_C >= $DB:n) set addstar_revert_DB_C = 0
     end
     add_poll_labels run
@@ -457,2 +483,140 @@
   end
 end
+task addstar.revert.stack
+  host         local
+
+  periods      -poll 5.0
+  periods      -exec 60.0
+  periods      -timeout 1200
+  npending     1
+  active        false
+
+  stdout NULL
+  stderr $LOGDIR/revert.log
+
+  task.exec
+    if ($LABEL:n == 0) break
+    $run = addtool -revertprocessedexp -stage stack
+    if ($DB:n == 0)
+      option DEFAULT
+    else
+      # save the DB name for the exit tasks
+      option $DB:$addstar_revert_DB_S
+      $run = $run -dbname $DB:$addstar_revert_DB_S
+      $addstar_revert_DB_S ++
+      if ($addstar_revert_DB_S >= $DB:n) set addstar_revert_DB_S = 0
+    end
+    add_poll_labels run
+    command $run
+  end
+
+  # success
+  task.exit    0
+  end
+
+  # locked list
+  task.exit    default
+    showcommand failure
+  end
+
+  task.exit    crash
+    showcommand crash
+  end
+
+  # operation times out?
+  task.exit    timeout
+    showcommand timeout
+  end
+end
+task addstar.revert.staticsky
+  host         local
+
+  periods      -poll 5.0
+  periods      -exec 60.0
+  periods      -timeout 1200
+  npending     1
+  active        false
+
+  stdout NULL
+  stderr $LOGDIR/revert.log
+
+  task.exec
+    if ($LABEL:n == 0) break
+    $run = addtool -revertprocessedexp -stage staticsky
+    if ($DB:n == 0)
+      option DEFAULT
+    else
+      # save the DB name for the exit tasks
+      option $DB:$addstar_revert_DB_SS
+      $run = $run -dbname $DB:$addstar_revert_DB_SS
+      $addstar_revert_DB_SS ++
+      if ($addstar_revert_DB_SS >= $DB:n) set addstar_revert_DB_SS = 0
+    end
+    add_poll_labels run
+    command $run
+  end
+
+  # success
+  task.exit    0
+  end
+
+  # locked list
+  task.exit    default
+    showcommand failure
+  end
+
+  task.exit    crash
+    showcommand crash
+  end
+
+  # operation times out?
+  task.exit    timeout
+    showcommand timeout
+  end
+end
+task addstar.revert.staticsky_multi
+  host         local
+
+  periods      -poll 5.0
+  periods      -exec 60.0
+  periods      -timeout 1200
+  npending     1
+  active        false
+
+  stdout NULL
+  stderr $LOGDIR/revert.log
+
+  task.exec
+    if ($LABEL:n == 0) break
+    $run = addtool -revertprocessedexp -stage staticsky_multi
+    if ($DB:n == 0)
+      option DEFAULT
+    else
+      # save the DB name for the exit tasks
+      option $DB:$addstar_revert_DB_SSM
+      $run = $run -dbname $DB:$addstar_revert_DB_SSM
+      $addstar_revert_DB_SSM ++
+      if ($addstar_revert_DB_SSM >= $DB:n) set addstar_revert_DB_SSM = 0
+    end
+    add_poll_labels run
+    command $run
+  end
+
+  # success
+  task.exit    0
+  end
+
+  # locked list
+  task.exit    default
+    showcommand failure
+  end
+
+  task.exit    crash
+    showcommand crash
+  end
+
+  # operation times out?
+  task.exit    timeout
+    showcommand timeout
+  end
+end
