Is there a way how to create a Review Task of the same form template (Version) as the original submission in groovy?

We are using 

def taskParams = new ReviewTask()
taskParams.formDataXml = xmlData

taskParams.portal = portal
taskParams.form = taskForm

taskParams.reviewSubmission = origSubmission


def reviewTask = ServiceFactory.submissionTaskService.createReviewTask(taskParams)

however with the above code if the origSubmission is of the form version 2.0, the form version of the Review Task will be the current one (already 4.0). 

cheers, Miro

    CommentAdd your comment...

    1 answer


      Is the value of [taskForm] with version [4.0]? Try removing the line [taskParams.form = taskForm]

      1. Miroslav Botka

        thanks for the comment Radoslav, however unfortunately it didnt work. The problem is in the underlying TM APIs which take the current Template/Version when the "createReviewTask" method is called.

      2. Radoslav Ivanov

        According to implementation, form is taken from [taskParams.form] or [origSubmission.form]: // If form not specified then use the previous submissions form Form form = param.form; if (form == null) { form = param.reviewSubmission.getForm(); }

      3. Miroslav Botka

        Hi Radoslav, the problem is on this line submission.setVersion(form.getCurrentVersion()); Form is just a "parent" entity for specific form Versions (Template entities, 1:n relation) It'd be great if the service method accepts a Version object and takes that one as of which Form - Version the new task should be created.

      CommentAdd your comment...