taskMetadataElement.setFailureReason(taskWithState.getFailureReason());
}
}
if (task instanceof ITaskWithDeadline) {
ITaskWithDeadline crTask = (ITaskWithDeadline) task;
if (crTask.getDeadline() != null)
taskMetadataElement.setDeadline(new XsdDateTime(crTask.getDeadline()));
}
if (task instanceof ITaskWithPriority) {
ITaskWithPriority crTask = (ITaskWithPriority) task;
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();