Index: branches/eam_branch_00/ippTasks/pantasks.pro
===================================================================
--- branches/eam_branch_00/ippTasks/pantasks.pro	(revision 11059)
+++ branches/eam_branch_00/ippTasks/pantasks.pro	(revision 11085)
@@ -100,2 +100,56 @@
   end
 end
+
+macro process_exit
+  if ($0 != 4)
+    echo "USAGE: process_exit (bookName) (pageName) (exitCode)"
+    break
+  end
+
+  $bookName = $1
+  $pageName = $2
+  $exitCode = $3
+
+  # success
+  if ($exitCode == $EXIT_SUCCESS) 
+    # the handler scripts update DB the tables; here we just update the page
+    book setword $bookName $pageName state DONE
+    return
+  end
+
+  # failure related to the data files
+  # jobs which result in DATAERR must have db state updated 
+  if ($exitCode == $EXIT_DATA_ERR)
+    showcommand failure
+    book setword $bookName $pageName state DATA_ERR
+    return
+  end
+
+  # failure related to the data files
+  if ($exitCode == $EXIT_SYS_ERR)
+    halt
+    showcommand "system failure"
+    book setword $bookName $pageName state SYS_ERR
+    return
+  end
+
+  # failure related to the data files
+  if ($exitCode == $EXIT_CONFIG_ERR)
+    halt
+    showcommand "config error"
+    book setword $bookName $pageName state CONFIG_ERR
+    return
+  end
+
+  # failure related to the data files
+  if ($exitCode == $EXIT_PROG_ERR)
+    halt
+    showcommand "programming error"
+    book setword $bookName $pageName state PROG_ERR
+    return
+  end
+
+  # any other exit status
+  showcommand failure
+  book setword $bookName $pageName state UNKNOWN_ERR
+end
