public void setFaultCode(String faultCode) {
this.faultCode = faultCode;
}
public ActionDocument createFaultData(XmlObject fault,String api,Throwable e){
ActionDocument document = ActionDocument.Factory.newInstance();
Action type = document.addNewAction();
type.setId("");
type.setApplication("lead");
type.setApi(api);
if(fault instanceof DataTransfer){
type.setDataTransferArray(new DataTransfer[]{(DataTransfer)fault});
}else if(fault instanceof Job){
type.setJobArray(new Job[]{(Job)fault});
}else if(fault instanceof Job){
type.setFileSystemArray(new FileSystem[]{(FileSystem)fault});
}else if(fault instanceof Application){
type.setCmdapplicationArray(new Application[]{(Application)fault});
}
type.setEndTime(formatter.format(new Date()));
Throwable cause = e;
while(cause.getCause() != null){
cause = cause.getCause();
}
return document;