Index: trunk/pstamp/scripts/dqueryparse.pl
===================================================================
--- trunk/pstamp/scripts/dqueryparse.pl	(revision 33126)
+++ trunk/pstamp/scripts/dqueryparse.pl	(revision 33141)
@@ -118,7 +118,11 @@
 {
     my $command = "$detectresponse --input $req_file --output $response_file --workdir $outdir";
+    if ($job_id) {
+        $command .= " --job_id $job_id";
+    } else {
+        $command .= " --ignore-wisdom";
+    }
     $command .= " --save-temps" if $save_temps;
     $command .= " --verbose" if $verbose;
-    $command .= " --ignore-wisdom" if !$job_id;
 
     my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
@@ -133,4 +137,5 @@
 	    my_die ("Update request indicated, but unable to find actual request!", $PS_EXIT_PROG_ERROR);
 	}
+        warn("Some inputs are not available must be updated.";
     }	
     
@@ -139,4 +144,5 @@
 my $result;
 unless ($job_id) {
+    # We are running as a parse job
     # If we returned correctly with a valid response file, get a job ID
     # for the completed work, and move the response to a standardized name.
@@ -152,5 +158,5 @@
             chomp $job_id;
             if ($job_id && -e $response_file) {
-                rename $response_file, "$outdir/response${job_id}.fits";
+                rename $response_file, "$outdir/response.${job_id}.fits";
             }
             $result = 0;
@@ -222,21 +228,28 @@
         my_die ("Parse fault!!", $fault);
     }
+    # This does not set the request state to stop.  That will happen with the request_finish.pl script, 
+    # which will notice that we've inserted the stopped job and decide we're finished. Easy enough.
+    {
+        my $command = "$pstamptool -updatereq -req_id $req_id -set_name $req_name -set_outProduct $product";
+        $command .= " -set_fault $result" if $result;
+
+        my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
+            run(command => $command, verbose => $verbose);
+        unless ($success) {
+            my_die("$command failed",$PS_EXIT_UNKNOWN_ERROR);
+        }
+    }
 } else {
+    # We are running as a job presumably because an input needed
+    # to be regenerated
+    if ($fault) {
         # in some cases we will need to finish off the request
         my_die ("Run fault!!", $fault);
-}
-
-# This does not set the request state to stop.  That will happen with the request_finish.pl script, 
-# which will notice that we've inserted the stopped job and decide we're finished. Easy enough.
-{
-    my $command = "$pstamptool -updatereq -req_id $req_id -set_name $req_name -set_outProduct $product";
-    $command .= " -set_fault $result" if $result;
-
-    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
-        run(command => $command, verbose => $verbose);
-    unless ($success) {
-        my_die("$command failed",$PS_EXIT_UNKNOWN_ERROR);
-    }
-}
+    }
+    if (-e $response_file) {
+        rename $response_file, "$outdir/response.${job_id}.fits";
+    }
+}
+
  
 exit 0;
