1
0
-1

I'm trying to create a transaction as part of a collaboration process, then immediately mark is as 'completed', and trigger the delivery service.

All seems to be working, except for the following code in my job action:

def statusService = new SubmissionStatusService()
statusService.updateFormStatusManually(submission, "Completed")
statusService.updateDeliveryStatusManually(submission, "Ready") 

The delivery status is updated correctly, but the form status remains as 'Saved'.

What am I doing wrong?

    CommentAdd your comment...

    2 answers

    1.  
      2
      1
      0

      Chris I've done it like this:

      submission.formStatus = Submission.STATUS_Submitted
      submission.attachmentsStatus = Submission.STATUS_Completed
      ServiceFactory.submissionStatusService.updateStatus(submission)
      DaoFactory.submissionDataDao.dataContext.commitChanges()
      1. Chris Reid

        Yep, this worked. Thanks Dave

      CommentAdd your comment...
    2.  
      1
      0
      -1

      Using the Fluent SDK you can achieve the same result more simply with:

      new TxnUpdater(txn)
              .setAttachmentsStatus(Txn.FORM_COMPLETED)
              .setFormStatus(Txn.FORM_COMPLETED)
              .update()

      See:

       

        CommentAdd your comment...