1
0
-1

We are attempting to submit from a script back to Transact:

 

This runs as a dynamic data service

 

Simple script as follows: - tested in groovy console (so rejigged)

import com.avoka.core.groovy.GroovyLogger as logger
import com.avoka.fc.core.dao.SubmissionDataDao 
import com.avoka.fc.core.service.SubmissionTaskService.FormTaskParam
import com.avoka.fc.core.service.SubmissionTaskService.SavedFormParam 
import com.avoka.fc.core.service.SubmissionStatusService
import com.avoka.fc.core.service.SubmissionTaskService
import com.avoka.fc.core.dao.DaoFactory
import com.avoka.fc.core.dao.UserAccountDao
import com.avoka.fc.core.service.UserService
import com.avoka.fc.core.dao.UserProfileDao
import com.avoka.component.xml.XmlDoc
import org.apache.commons.lang.RandomStringUtils
import net.sf.json.*
import com.avoka.fc.core.dao.GroupDao
//def encoded = request.getParameter('InputData') 
//def dataXmlString = request.getParameter('InputData')//new String(decoded)
def dataXmlString = '''
<AvokaSmartForm>
</AvokaSmartForm>
'''

def formCode= 'transact-showcase-fm'; // quote-pdfv2
def space = 'Maguire' // Exin ES

def xmlDoc = new XmlDoc(dataXmlString) 
def form = DaoFactory.getFormDao().getFormByFormCode(formCode)
def portal = DaoFactory.getPortalDao().getPortalByName(space)



def savedFormParam = new SavedFormParam()
savedFormParam.form = form
savedFormParam.portal = portal
savedFormParam.submissionXml = dataXmlString
//savedFormParam.taskSubject = "Get Quote"


// Create the save form
def submissionTaskSevice = new SubmissionTaskService();
def submission = submissionTaskSevice.createAnonymousSavedForm(savedFormParam)

// Update submission properties
submission.setCreatedUsername(userName);
submission.setFormStatus("Completed");
def submissionStatusService = new SubmissionStatusService()
submissionStatusService.updateStatus(submission)
submissionStatusService.commitChanges()

 

 

However on any form, in any TM environment tested so far the transaction does not get marked past the Transaction Status of Receipt Render Pending at all.

 

 

Just sticks - is there some commit missing or status update that should be set

 

 

 

 

    CommentAdd your comment...

    2 answers

    1.  
      1
      0
      -1

      You can also set the submission status to 'Submitted' and let the Transaction Processing job to set this naturally. e.g.:

      SubmissionTaskService submissionTaskSevice = new SubmissionTaskService()
      Submission annonTask = submissionTaskSevice.createAnonymousSavedForm(savedFormParam)
      
      SubmissionStatusService submissionStatusService = new SubmissionStatusService()
      annonTask.setFormStatus(Submission.STATUS_Submitted)
      annonTask.setTimeSubmission(new Date())
      submissionStatusService.updateStatus(annonTask)

      There is an implicit commit within the SubmissionStatusService.updateStatus() method, so you don't need to call this explicitly.

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

        These transactions are currently not being picked up by the receipting code because the submissions deleted flag is set to null. I you set this to false it will work. Add the following code. We will improve this in a future release of TM. 

         

        submission.setDeletedFlag(false)

          CommentAdd your comment...