Journey Manager (JM) The transaction engine for the platform. | System Manager / DevOps | All versions This feature is related to all versions.
Manager allows you to create a service of the submission completed processor type, which is called immediately after a form submission has progressed to form status Completed.
To configure the submission completed processor service:
For more information, see groovy-services-api/submission-completed-processor.html.
You can create a service of the same type to cancel or abandon a task submission or a task that is a part of a collaboration job. This service will use the following job controller API:
/**
* @see IJobController#cancelJob(Job)
* @param job the job instance to cancel (required)
* @return true if the job was cancelled, or false if the job was already finished
*/
public boolean cancelJob(final Job job)
To configure the task cancellation processor service:
import com.avoka.component.xml.XmlDoc
import com.avoka.fc.core.dao.DaoFactory
import com.avoka.fc.core.service.ServiceFactory
import com.avoka.fc.core.entity.Job
import com.avoka.fc.core.service.ServiceLocator
def XPATH_TACKING_CODES = '//GettingStarted/TrackingCode/rptTrackingCode/TrackingCode'
def PIPE_SEPARATOR = '||'
def xmlDoc = new XmlDoc(submissionXml)
def submissionDao = DaoFactory.getSubmissionDao()
def jobControllerService = new JobControllerService()
def abandonService = ServiceFactory.getAbandonmentService()
def cancelledTasks = []
def notCancelledTasks = []
def trackingCodeNodes = xmlDoc.getNodeList(XPATH_TACKING_CODES)
// Loop all given tracking codes
for (def node : trackingCodeNodes) {
def isAbandoned = false
def taskSubject = ''
try {
// Get the submission object
def trackingCode = node.getTextContent()
def oSubmission = submissionDao.getSubmissionByTrackingNumber(trackingCode)
taskSubject = oSubmission.getTaskSubject()
// Get the job that the submission is part of, if any
def job = oSubmission.getJob()
// Check if submission is part of collaboratino job
if (job != null) {
// Submission is part of collaboration job
def jobController = ServiceLocator.getJobController(job)
isAbandoned = jobController.cancelJob(job)
} else {
// Submission is not part of collaboration job
isAbandoned = abandonService.performExplicitAdminAbandonment(oSubmission)
}
} catch (Exception e) {
} finally {
if (isAbandoned) {
cancelledTasks.add(taskSubject)
} else {
notCancelledTasks.add(taskSubject)
}
}
Next, learn how to view job services.