       #inform Mongoose of changes made to the tasks object and save it
       record.markModified "transactions"
       record.save()      
-      console.log  "Task Status: " + record.status
+      #console.log  "Task Status: " + record.status
       #console.log "Result: " + record
 
 


messageStore = require "../middleware/messageStore"
Transaction = require("../model/transactions").Transaction
router = require "../middleware/router"









          #retrieve the transaction to rerun
          Transaction.findOne _id: transactionID, (err, transaction) ->
            #console.log(transaction)

            # construct the 'ctx' object to create a new transaction record with no response message
            ctx = new Object()
            ctx.path = transaction.request.path
            ctx.header = transaction.request.headers
            
            ctx.querystring = transaction.request.querystring
            ctx.body = transaction.request.body
            ctx.method = transaction.request.method

            ctx.request = new Object()
            ctx.request.url = transaction.request.path
            ctx.request.method = transaction.request.method
            ctx.request.querystring = transaction.request.querystring

            ctx.response = new Object()
            ctx.status = "Processing"

            #store the message without a response (before HTTP request is made)
            messageStore.storeTransaction ctx, (error, saveTransaction) ->               
              console.log(saveTransaction)




              ###
              # An HTTP request needs to made here and the response captured
              ###





              # The response received from the HTTP request needs to be updated in the transaction
              messageStore.storeTransaction ctx, (error, updateTransaction) ->               
                console.log(updateTransaction)  



