public Map<String, String> updateTask(String taskStatus) { Map<String, String> resultMap = new HashMap<String, String>(); String status = "E"; String message = null; XxntcCsCalendarActivitiesEOVOImpl vo = getXxntcCsCalendarActivitiesEOVO2Update(); Row row = vo.getCurrentRow(); Date startTime = (Date) row.getAttribute("StartTime"); Date endTime = (Date) row.getAttribute("EndTime"); Number incidentId = (Number) row.getAttribute("IncidentId"); Number resourceId = (Number) row.getAttribute("ResourceId"); _logger.warning("Before Calling API"); _logger.warning("taskStatus:" + taskStatus.toString()); _logger.warning("startTime:" + startTime.toString()); _logger.warning("endTime:" + endTime.toString()); _logger.warning("incidentId:" + incidentId.toString()); _logger.warning("resourceId:" + resourceId.toString()); CallableStatement cs = null; String statement = "BEGIN XXNTC_CALENDAR_PKG.SCHEDULE_SR_PRC(?, ?, ?, ?, ?, ?, ?); END;"; try { cs = getDBTransaction().createCallableStatement(statement, 0); cs.registerOutParameter(6, Types.VARCHAR); cs.registerOutParameter(7, Types.VARCHAR); cs.setString(1, taskStatus); cs.setDate(2, startTime.dateValue()); cs.setDate(3, endTime.dateValue()); cs.setInt(4, incidentId.intValue()); cs.setLong(5, resourceId.longValue()); cs.executeUpdate(); status = cs.getString(6); message = cs.getString(7); } catch (SQLException e) { _logger.severe("Sql Exception during statement call", e); } finally { try { if (cs != null) cs.close(); } catch (SQLException e) { _logger.severe("Sql Exception While Closing Callable Statement", e); } } resultMap.put("x_status", status); resultMap.put("x_error_message", message); _logger.warning("After API is called"); _logger.warning("x_status:" + status); _logger.warning("x_error_message:" + message); return resultMap; }
public String getCDEId() { Number cdeId = null; try { oracle.jbo.ViewObject cdeIdView = getViewObject().getApplicationModule().findViewObject("DeCdeIdView"); cdeIdView.setWhereClause("AC_IDSEQ='" + getDeIdseq() + "'"); Row row = cdeIdView.first(); if (row != null) { cdeId = (Number) row.getAttribute("MinCdeId"); } return cdeId.toString(); } // end try catch (Exception e) { log.error("Error in getCDEId(): ", e); return null; } }