Source:
<code>public WorkunitInfo createWUFromECL(WorkunitInfo wu) throws Exception { WorkunitInfo createdWU = null; if (wsWorkunitsServiceSoapProxy == null) throw new Exception("wsWorkunitsServiceSoapProxy not available"); else { WUCreateAndUpdate wucreateparameters = new WUCreateAndUpdate(); wucreateparameters.setAction(1); wucreateparameters.setQueryText(wu.getECL()); wucreateparameters.setApplicationValues(wu.getRawApplicationValues()); wucreateparameters.setDebugValues(wu.getDebugValues()); wucreateparameters.setJobname(wu.getJobname()); wucreateparameters.setClusterOrig(wu.getCluster()); wucreateparameters.setResultLimit(wu.getResultLimit()); wucreateparameters.setWuid(wu.getWuid()); WUUpdateResponse wuUpdateResponse = wsWorkunitsServiceSoapProxy.WUCreateAndUpdate(wucreateparameters); ArrayOfEspException exceptions = wuUpdateResponse.getExceptions(); if (exceptions != null) throwWsWUExceptions(exceptions, "Error compiling ECL query"); <START> if (wuUpdateResponse.getWorkunit().getStateID() != 1) END> { WUWaitCompiled wuwaitcompiledparameters = new WUWaitCompiled(); wuwaitcompiledparameters.setWait(10); wuwaitcompiledparameters.setWuid(wuUpdateResponse.getWorkunit().getWuid()); WUWaitResponse wuWaitResponse = wsWorkunitsServiceSoapProxy.WUWaitCompiled(wuwaitcompiledparameters); exceptions = wuWaitResponse.getExceptions(); if (exceptions != null) throwWsWUExceptions(exceptions, "Error compiling ECL query"); if (wuWaitResponse.getStateID() != 1) throw new Exception("Error: compilation exceeded timeout"); } createdWU = new WorkunitInfo(wuUpdateResponse.getWorkunit()); createdWU.setMaxMonitorMillis(wu.getMaxMonitorMillis()); createdWU.setCluster(wu.getCluster()); createdWU.setJobname(wu.getJobname()); createdWU.setSleepMillis(wu.getSleepMillis()); createdWU.setOriginalEclWatchUrl(getEclWatchUrl()); } return createdWU; }</code><technical_language>Do enum represent states</technical_language>

Target:
public WorkunitInfo createWUFromECL(WorkunitInfo wu) throws Exception { WorkunitInfo createdWU = null; if (wsWorkunitsServiceSoapProxy == null) throw new Exception("wsWorkunitsServiceSoapProxy not available"); else { WUCreateAndUpdate wucreateparameters = new WUCreateAndUpdate(); wucreateparameters.setAction(1); wucreateparameters.setQueryText(wu.getECL()); wucreateparameters.setApplicationValues(wu.getRawApplicationValues()); wucreateparameters.setDebugValues(wu.getDebugValues()); wucreateparameters.setJobname(wu.getJobname()); wucreateparameters.setClusterOrig(wu.getCluster()); wucreateparameters.setResultLimit(wu.getResultLimit()); wucreateparameters.setWuid(wu.getWuid()); WUUpdateResponse wuUpdateResponse = wsWorkunitsServiceSoapProxy.WUCreateAndUpdate(wucreateparameters); ArrayOfEspException exceptions = wuUpdateResponse.getExceptions(); if (exceptions == null) { createdWU = new WorkunitInfo(wuUpdateResponse.getWorkunit()); createdWU.setMaxMonitorMillis(wu.getMaxMonitorMillis()); createdWU.setCluster(wu.getCluster()); createdWU.setJobname(wu.getJobname()); createdWU.setSleepMillis(wu.getSleepMillis()); createdWU.setOriginalEclWatchUrl(getEclWatchUrl()); } else { throwWsWUExceptions(exceptions, "Error compiling ECL query"); } } return createdWU; }