if (crTask.getPriority() != null)
taskMetadataElement.setPriority(crTask.getPriority());
}
if (task instanceof ICompleteReportingTask) {
ICompleteReportingTask crTask = (ICompleteReportingTask) task;
taskMetadataElement.setUserProcessCompleteSOAPAction(crTask.getCompleteSOAPAction());
}
if (task instanceof ITaskWithAttachments) {
ITaskWithAttachments taskWithAttachments = (ITaskWithAttachments) task;
Attachments xmlAttachments = taskMetadataElement.addNewAttachments();