}
if (ITaskWithAttachments.class.isAssignableFrom(taskClass)) {
ITaskWithAttachments taskWithAttachments = (ITaskWithAttachments) resultTask;
if (attachmentsElement != null) {
for (int i = 0; i < attachmentsElement.sizeOfAttachmentArray(); i++) {
com.intalio.bpms.workflow.taskManagementServices20051109.Attachment attachmentElement = attachmentsElement.getAttachmentArray(i);
if (attachmentElement != null) {
// The following line has been added to handle the case
// where an attachment element is present