Bom dia Segue o código para voce fazer está movimentação.
Criei um dataset para que voce possa testar
var dataset = DatasetBuilder.newDataset();
dataset.addColumn("ok");
var periodicService = ServiceManager.getService('ECMWorkflowEngineService');
var serviceHelper = periodicService.getBean();
var serviceLocator = periodicService.instantiate('com.totvs.technology.ecm.workflow.ws.ECMWorkflowEngineServiceService');
var service = serviceLocator.getWorkflowEngineServicePort();
var objectFactory = periodicService.instantiate("com.totvs.technology.ecm.workflow.ws.ObjectFactory");
var appointment = periodicService.instantiate("com.totvs.technology.ecm.workflow.ws.ProcessTaskAppointmentDtoArray");
var attachments = periodicService.instantiate("com.totvs.technology.ecm.workflow.ws.ProcessAttachmentDtoArray");
var user = "admin";
var password = "admin";
var companyId = 1;
var processInstanceId = 237;
var choosedState = 27;
var colleaguesId = periodicService.instantiate("net.java.dev.jaxb.array.StringArray");
colleaguesId.getItem().addAll(["admin"]);
var comments = "movimentado pelo fluig";
var userId = "admin";
var completeTask = true;
var cardData = periodicService.instantiate("net.java.dev.jaxb.array.StringArrayArray");
var managerMode = false;
var threadSequence = 0;
var result = service.saveAndSendTask(user,password,companyId,processInstanceId,choosedState,colleaguesId,comments,userId,completeTask,attachments,cardData,appointment,managerMode,threadSequence)
log.info("@@@ result "+ result.getItem().get(0).getItem().get(0));
dataset.addRow(new Array(
result.getItem().get(1).getItem().get(1)
));
return dataset;