List of usage examples for javax.script Invocable invokeFunction
public Object invokeFunction(String name, Object... args) throws ScriptException, NoSuchMethodException;
From source file:org.tinymediamanager.scraper.util.YoutubeLinkExtractor.java
private String decryptSignature(String encryptedSignature) throws Exception { // first extract the player url and download the js player Matcher matcher = playerUrlPattern.matcher(jsonConfiguration); if (matcher.find()) { // only download the player javascript the first time if (StringUtils.isBlank(playerJavascript)) { Url jsPlayer = new Url("https:" + matcher.group(1).replaceAll("\\\\", "")); StringWriter writer = new StringWriter(); IOUtils.copy(jsPlayer.getInputStream(), writer, "UTF-8"); playerJavascript = writer.toString(); }/* w w w. j a va 2s. c o m*/ if (StringUtils.isBlank(playerJavascript)) { return ""; } // here comes the magic: extract the decrypt JS functions and translate them to Java :) matcher = patternDecryptFunction.matcher(playerJavascript); if (matcher.find()) { String decryptFunction = matcher.group(1); // extract relevant JS code String javaScript = extractJavascriptCode(playerJavascript, decryptFunction); // create a script engine manager ScriptEngineManager factory = new ScriptEngineManager(); ScriptEngine engine = factory.getEngineByName("JavaScript"); engine.eval(javaScript); Invocable inv = (Invocable) engine; // invoke the function to decrypt the signature String result = (String) inv.invokeFunction(decryptFunction, encryptedSignature); return result; } } return ""; }
From source file:org.wso2.carbon.identity.application.authentication.framework.config.model.graph.JsGraphBuilder.java
/** * Creates the graph with the given Script and step map. * * @param script the Dynamic authentication script. *///from w w w .j a v a 2 s. co m public JsGraphBuilder createWith(String script) { try { currentBuilder.set(this); Bindings globalBindings = engine.getBindings(ScriptContext.GLOBAL_SCOPE); Bindings engineBindings = engine.getBindings(ScriptContext.ENGINE_SCOPE); globalBindings.put(FrameworkConstants.JSAttributes.JS_FUNC_EXECUTE_STEP, (StepExecutor) this::executeStep); globalBindings.put(FrameworkConstants.JSAttributes.JS_FUNC_SEND_ERROR, (BiConsumer<String, Map>) this::sendError); globalBindings.put(FrameworkConstants.JSAttributes.JS_FUNC_SHOW_PROMPT, (PromptExecutor) this::addShowPrompt); engineBindings.put("exit", (RestrictedFunction) this::exitFunction); engineBindings.put("quit", (RestrictedFunction) this::quitFunction); JsFunctionRegistry jsFunctionRegistrar = FrameworkServiceDataHolder.getInstance() .getJsFunctionRegistry(); if (jsFunctionRegistrar != null) { Map<String, Object> functionMap = jsFunctionRegistrar .getSubsystemFunctionsMap(JsFunctionRegistry.Subsystem.SEQUENCE_HANDLER); functionMap.forEach(globalBindings::put); } Invocable invocable = (Invocable) engine; engine.eval(script); invocable.invokeFunction(FrameworkConstants.JSAttributes.JS_FUNC_ON_LOGIN_REQUEST, new JsAuthenticationContext(authenticationContext)); JsGraphBuilderFactory.persistCurrentContext(authenticationContext, engine); } catch (ScriptException e) { result.setBuildSuccessful(false); result.setErrorReason("Error in executing the Javascript. Nested exception is: " + e.getMessage()); if (log.isDebugEnabled()) { log.debug("Error in executing the Javascript.", e); } } catch (NoSuchMethodException e) { result.setBuildSuccessful(false); result.setErrorReason("Error in executing the Javascript. " + FrameworkConstants.JSAttributes.JS_FUNC_ON_LOGIN_REQUEST + " function is not defined."); if (log.isDebugEnabled()) { log.debug("Error in executing the Javascript.", e); } } finally { clearCurrentBuilder(); } return this; }
From source file:it.geosolutions.geobatch.action.scripting.ScriptingAction.java
/** * Default execute method.../*from ww w . j a v a 2 s .c om*/ */ @SuppressWarnings("unchecked") public Queue<FileSystemEvent> execute(Queue<FileSystemEvent> events) throws ActionException { try { listenerForwarder.started(); // // // data flow configuration and dataStore name must not be null. // // if (configuration == null) { throw new ActionException(this, "Configuration is null."); } final String scriptName = it.geosolutions.tools.commons.file.Path .findLocation(configuration.getScriptFile(), getConfigDir().getAbsolutePath()); if (scriptName == null) throw new ActionException(this, "Unable to locate the script file name: " + configuration.getScriptFile()); final File script = new File(scriptName); /** * Dynamic class-loading ... */ listenerForwarder.setTask("dynamic class loading ..."); final String moduleFolder = new File(script.getParentFile(), "jars").getAbsolutePath(); if (LOGGER.isInfoEnabled()) { LOGGER.info("Runtime class-loading from moduleFolder -> " + moduleFolder); } final File moduleDirectory = new File(moduleFolder); try { addFile(moduleDirectory.getParentFile()); addFile(moduleDirectory); } catch (IOException e) { throw new ActionException(this, e.getLocalizedMessage(), e); } final String classpath = System.getProperty("java.class.path"); final File[] moduleFiles = moduleDirectory.listFiles(); if (moduleFiles != null) { for (File moduleFile : moduleFiles) { final String name = moduleFile.getName(); if (name.endsWith(".jar")) { if (classpath.indexOf(name) == -1) { try { if (LOGGER.isInfoEnabled()) LOGGER.info("Adding: " + name); addFile(moduleFile); } catch (IOException e) { throw new ActionException(this, e.getLocalizedMessage(), e); } } } } } /** * Evaluating script ... */ listenerForwarder.setTask("evaluating script ..."); // Now, pass a different script context final ScriptContext newContext = new SimpleScriptContext(); final Bindings engineScope = newContext.getBindings(ScriptContext.ENGINE_SCOPE); // add variables to the new engineScope // engineScope.put("eventList", events); // engineScope.put("runningContext", getRunningContext()); // add properties as free vars in script final Map<String, Object> props = configuration.getProperties(); if (props != null) { final Set<Entry<String, Object>> set = props.entrySet(); final Iterator<Entry<String, Object>> it = set.iterator(); while (it.hasNext()) { final Entry<String, ?> prop = it.next(); if (prop == null) { continue; } if (LOGGER.isInfoEnabled()) LOGGER.info(" Adding script property: " + prop.getKey() + " : " + prop.getValue()); engineScope.put(prop.getKey(), prop.getValue()); } } // read the script FileReader reader = null; try { reader = new FileReader(script); engine.eval(reader, engineScope); } catch (FileNotFoundException e) { throw new ActionException(this, e.getLocalizedMessage(), e); } finally { IOUtils.closeQuietly(reader); } final Invocable inv = (Invocable) engine; listenerForwarder.setTask("Executing script: " + script.getName()); // check for incoming event list if (events == null) { throw new ActionException(this, "Unable to start the script using a null incoming list of events"); } // call the script final Map<String, Object> argsMap = new HashedMap(); argsMap.put(ScriptingAction.CONFIG_KEY, configuration); argsMap.put(ScriptingAction.TEMPDIR_KEY, getTempDir()); argsMap.put(ScriptingAction.CONFIGDIR_KEY, getConfigDir()); argsMap.put(ScriptingAction.EVENTS_KEY, events); argsMap.put(ScriptingAction.LISTENER_KEY, listenerForwarder); final Map<String, Object> mapOut = (Map<String, Object>) inv.invokeFunction("execute", new Object[] { argsMap }); // checking output final Queue<FileSystemEvent> ret = new LinkedList<FileSystemEvent>(); if (mapOut == null) { if (LOGGER.isWarnEnabled()) { LOGGER.warn("Caution returned map from script " + configuration.getScriptFile() + " is null.\nSimulating an empty return list."); } return ret; } final Object obj = mapOut.get(ScriptingAction.RETURN_KEY); if (obj == null) { if (LOGGER.isErrorEnabled()) { LOGGER.error("Caution returned object from script " + configuration.getScriptFile() + " is null.\nPassing an empty list to the next action!"); } return ret; } if (obj instanceof List) { final List<Object> list = (List<Object>) obj; for (final Object out : list) { if (out == null) { if (LOGGER.isWarnEnabled()) { LOGGER.warn("Caution returned object from script " + configuration.getScriptFile() + " is null.\nContinue with the next one."); } continue; } if (out instanceof FileSystemEvent) { FileSystemEvent ev = (FileSystemEvent) out; ret.add(ev); } else if (out instanceof File) { ret.add(new FileSystemEvent((File) out, FileSystemEventType.FILE_ADDED)); } else { final File file = new File(out.toString()); if (!file.exists() && LOGGER.isWarnEnabled()) { LOGGER.warn("Caution returned object from script " + configuration.getScriptFile() + " do not points to an existent file!"); } ret.add(new FileSystemEvent(file, FileSystemEventType.FILE_ADDED)); } } } else { if (LOGGER.isErrorEnabled()) { LOGGER.error("Caution returned object from script " + configuration.getScriptFile() + " is not a valid List.\nPassing an empty list to the next action!"); } return ret; } listenerForwarder.setTask("Completed"); listenerForwarder.completed(); return ret; } catch (Exception t) { listenerForwarder.setTask("Completed with errors"); listenerForwarder.failed(t); throw new ActionException(this, t.getMessage(), t); } finally { engine = null; factory = null; } }
From source file:talonetl.getproperties_0_2.getProperties.java
public void tFileInputXML_1Process(final java.util.Map<String, Object> globalMap) throws TalendException { globalMap.put("tFileInputXML_1_SUBPROCESS_STATE", 0); final boolean execStat = this.execStat; String iterateId = ""; int iterateLoop = 0; String currentComponent = ""; try {/*from w ww. j a v a 2 s . c o m*/ String currentMethodName = new Exception().getStackTrace()[0].getMethodName(); boolean resumeIt = currentMethodName.equals(resumeEntryMethodName); if (resumeEntryMethodName == null || resumeIt || globalResumeTicket) {// start // the // resume globalResumeTicket = true; tMysqlInput_1Process(globalMap); tMysqlInput_5Process(globalMap); tMysqlInput_3Process(globalMap); row1Struct row1 = new row1Struct(); stateInfoStruct stateInfo = new stateInfoStruct(); row2Struct row2 = new row2Struct(); row3Struct row3 = new row3Struct(); row5Struct row5 = new row5Struct(); loadNewStateInfoStruct loadNewStateInfo = new loadNewStateInfoStruct(); propertyDataStruct propertyData = new propertyDataStruct(); mappedDataStruct mappedData = new mappedDataStruct(); loadDataStruct loadData = new loadDataStruct(); row9Struct row9 = new row9Struct(); row14Struct row14 = new row14Struct(); mainPropertyDataLoadStruct mainPropertyDataLoad = new mainPropertyDataLoadStruct(); /** * [tFlowToIterate_1 begin ] start */ int NB_ITERATE_tFileInputJSON_1 = 0; // for statistics ok_Hash.put("tFlowToIterate_1", false); start_Hash.put("tFlowToIterate_1", System.currentTimeMillis()); currentComponent = "tFlowToIterate_1"; int tos_count_tFlowToIterate_1 = 0; int nb_line_tFlowToIterate_1 = 0; int counter_tFlowToIterate_1 = 0; /** * [tFlowToIterate_1 begin ] stop */ /** * [tMysqlOutput_1 begin ] start */ ok_Hash.put("tMysqlOutput_1", false); start_Hash.put("tMysqlOutput_1", System.currentTimeMillis()); currentComponent = "tMysqlOutput_1"; int tos_count_tMysqlOutput_1 = 0; int nb_line_tMysqlOutput_1 = 0; int nb_line_update_tMysqlOutput_1 = 0; int nb_line_inserted_tMysqlOutput_1 = 0; int nb_line_deleted_tMysqlOutput_1 = 0; int nb_line_rejected_tMysqlOutput_1 = 0; int deletedCount_tMysqlOutput_1 = 0; int updatedCount_tMysqlOutput_1 = 0; int insertedCount_tMysqlOutput_1 = 0; int rejectedCount_tMysqlOutput_1 = 0; String tableName_tMysqlOutput_1 = "PROPERTY_DATA"; boolean whetherReject_tMysqlOutput_1 = false; java.util.Calendar calendar_tMysqlOutput_1 = java.util.Calendar.getInstance(); calendar_tMysqlOutput_1.set(1, 0, 1, 0, 0, 0); long year1_tMysqlOutput_1 = calendar_tMysqlOutput_1.getTime().getTime(); calendar_tMysqlOutput_1.set(10000, 0, 1, 0, 0, 0); long year10000_tMysqlOutput_1 = calendar_tMysqlOutput_1.getTime().getTime(); long date_tMysqlOutput_1; java.sql.Connection conn_tMysqlOutput_1 = null; java.util.Map<String, routines.system.TalendDataSource> dataSources_tMysqlOutput_1 = (java.util.Map<String, routines.system.TalendDataSource>) globalMap .get(KEY_DB_DATASOURCES); if (null != dataSources_tMysqlOutput_1) { conn_tMysqlOutput_1 = dataSources_tMysqlOutput_1.get("").getConnection(); } else { String dbProperties_tMysqlOutput_1 = "noDatetimeStringSync=true"; String url_tMysqlOutput_1 = null; if (dbProperties_tMysqlOutput_1 == null || dbProperties_tMysqlOutput_1.trim().length() == 0) { url_tMysqlOutput_1 = "jdbc:mysql://" + "192.168.1.254" + ":" + "3306" + "/" + "TALONDB" + "?" + "rewriteBatchedStatements=true"; } else { String properties_tMysqlOutput_1 = "noDatetimeStringSync=true"; if (!properties_tMysqlOutput_1.contains("rewriteBatchedStatements")) { properties_tMysqlOutput_1 += "&rewriteBatchedStatements=true"; } url_tMysqlOutput_1 = "jdbc:mysql://" + "192.168.1.254" + ":" + "3306" + "/" + "TALONDB" + "?" + properties_tMysqlOutput_1; } String dbUser_tMysqlOutput_1 = "dbAdmin"; String dbPwd_tMysqlOutput_1 = "1nn0s2013"; java.lang.Class.forName("org.gjt.mm.mysql.Driver"); conn_tMysqlOutput_1 = java.sql.DriverManager.getConnection(url_tMysqlOutput_1, dbUser_tMysqlOutput_1, dbPwd_tMysqlOutput_1); } conn_tMysqlOutput_1.setAutoCommit(false); int commitEvery_tMysqlOutput_1 = 10000; int commitCounter_tMysqlOutput_1 = 0; int count_tMysqlOutput_1 = 0; String insert_tMysqlOutput_1 = "INSERT INTO `" + "PROPERTY_DATA" + "` (`ID`,`UUID`,`PROP_NAME`,`PRICE`,`SQFT`,`DESCRIPTION`,`NUM_BEDS`,`NUM_BATHS`,`TYPE`,`STATUS`,`STATE_INFO_ID`,`DATA_SOURCE_ID`) VALUES (?,?,?,?,?,?,?,?,?,?,?,?)"; int batchSize_tMysqlOutput_1 = 100; int batchSizeCounter_tMysqlOutput_1 = 0; java.sql.PreparedStatement pstmt_tMysqlOutput_1 = conn_tMysqlOutput_1 .prepareStatement(insert_tMysqlOutput_1); /** * [tMysqlOutput_1 begin ] stop */ /** * [tMap_8 begin ] start */ ok_Hash.put("tMap_8", false); start_Hash.put("tMap_8", System.currentTimeMillis()); currentComponent = "tMap_8"; int tos_count_tMap_8 = 0; // ############################### // # Lookup's keys initialization // ############################### // ############################### // # Vars initialization class Var__tMap_8__Struct { } Var__tMap_8__Struct Var__tMap_8 = new Var__tMap_8__Struct(); // ############################### // ############################### // # Outputs initialization mainPropertyDataLoadStruct mainPropertyDataLoad_tmp = new mainPropertyDataLoadStruct(); // ############################### /** * [tMap_8 begin ] stop */ /** * [tJavaRow_3 begin ] start */ ok_Hash.put("tJavaRow_3", false); start_Hash.put("tJavaRow_3", System.currentTimeMillis()); currentComponent = "tJavaRow_3"; int tos_count_tJavaRow_3 = 0; int nb_line_tJavaRow_3 = 0; /** * [tJavaRow_3 begin ] stop */ /** * [tJoin_3 begin ] start */ ok_Hash.put("tJoin_3", false); start_Hash.put("tJoin_3", System.currentTimeMillis()); currentComponent = "tJoin_3"; int tos_count_tJoin_3 = 0; final java.util.Map<getCurrentPropertiesStruct, getCurrentPropertiesStruct> tHash_tJoin_3 = (java.util.Map<getCurrentPropertiesStruct, getCurrentPropertiesStruct>) globalMap .get("tHash_getCurrentProperties"); class Util_tJoin_3 { getCurrentPropertiesStruct lookupValue = null; getCurrentPropertiesStruct getCurrentPropertiesHashKey = new getCurrentPropertiesStruct(); public boolean isJoined(loadDataStruct mainRow) { getCurrentPropertiesHashKey.PROP_NAME = mainRow.PROP_NAME; getCurrentPropertiesHashKey.hashCodeDirty = true; lookupValue = tHash_tJoin_3.get(getCurrentPropertiesHashKey); if (lookupValue != null) { return true; } return false; } } Util_tJoin_3 util_tJoin_3 = new Util_tJoin_3(); int nb_line_tJoin_3 = 0; /** * [tJoin_3 begin ] stop */ /** * [tMap_4 begin ] start */ ok_Hash.put("tMap_4", false); start_Hash.put("tMap_4", System.currentTimeMillis()); currentComponent = "tMap_4"; int tos_count_tMap_4 = 0; // ############################### // # Lookup's keys initialization org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<custDataStruct> tHash_Lookup_custData = (org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<custDataStruct>) ((org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<custDataStruct>) globalMap .get("tHash_Lookup_custData")); custDataStruct custDataHashKey = new custDataStruct(); custDataStruct custDataDefault = new custDataStruct(); // ############################### // ############################### // # Vars initialization class Var__tMap_4__Struct { } Var__tMap_4__Struct Var__tMap_4 = new Var__tMap_4__Struct(); // ############################### // ############################### // # Outputs initialization loadDataStruct loadData_tmp = new loadDataStruct(); // ############################### /** * [tMap_4 begin ] stop */ /** * [tMap_1 begin ] start */ ok_Hash.put("tMap_1", false); start_Hash.put("tMap_1", System.currentTimeMillis()); currentComponent = "tMap_1"; int tos_count_tMap_1 = 0; // ############################### // # Lookup's keys initialization org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row6Struct> tHash_Lookup_row6 = null; org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row6Struct> tHash_Lookup_Cache_row6 = org.talend.designer.components.lookup.memory.AdvancedMemoryLookup .<row6Struct>getLookup( org.talend.designer.components.lookup.common.ICommonLookup.MATCHING_MODE.UNIQUE_MATCH); org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row6Struct> tHash_Lookup_Real_row6 = null; row6Struct row6HashKey = new row6Struct(); row6Struct row6Default = new row6Struct(); // ############################### // ############################### // # Vars initialization class Var__tMap_1__Struct { } Var__tMap_1__Struct Var__tMap_1 = new Var__tMap_1__Struct(); // ############################### // ############################### // # Outputs initialization mappedDataStruct mappedData_tmp = new mappedDataStruct(); // ############################### /** * [tMap_1 begin ] stop */ /** * [tMap_2 begin ] start */ ok_Hash.put("tMap_2", false); start_Hash.put("tMap_2", System.currentTimeMillis()); currentComponent = "tMap_2"; int tos_count_tMap_2 = 0; // ############################### // # Lookup's keys initialization // ############################### // ############################### // # Vars initialization class Var__tMap_2__Struct { } Var__tMap_2__Struct Var__tMap_2 = new Var__tMap_2__Struct(); // ############################### // ############################### // # Outputs initialization stateInfoStruct stateInfo_tmp = new stateInfoStruct(); propertyDataStruct propertyData_tmp = new propertyDataStruct(); // ############################### /** * [tMap_2 begin ] stop */ /** * [tFileInputXML_1 begin ] start */ ok_Hash.put("tFileInputXML_1", false); start_Hash.put("tFileInputXML_1", System.currentTimeMillis()); currentComponent = "tFileInputXML_1"; int tos_count_tFileInputXML_1 = 0; int nb_line_tFileInputXML_1 = 0; String os_tFileInputXML_1 = System.getProperty("os.name").toLowerCase(); boolean isWindows_tFileInputXML_1 = false; if (os_tFileInputXML_1.indexOf("windows") > -1 || os_tFileInputXML_1.indexOf("nt") > -1) { isWindows_tFileInputXML_1 = true; } class XML_API_tFileInputXML_1 { public boolean isDefNull(String[] node) throws javax.xml.transform.TransformerException { if (node[0] != null && node[1] != null && ("true").equals(node[1])) { return true; } return false; } public boolean isMissing(String[] node) throws javax.xml.transform.TransformerException { return node[0] == null ? true : false; } public boolean isEmpty(String[] node) throws javax.xml.transform.TransformerException { if (node[0] != null) { return node[0].length() == 0; } return false; } } XML_API_tFileInputXML_1 xml_api_tFileInputXML_1 = new XML_API_tFileInputXML_1(); String[] queryPaths_tFileInputXML_1 = new String[] { "name", "name" + "/@xsi:nil", "../media/images/image/url", "../media/images/image/url" + "/@xsi:nil", "../media/images/image/title", "../media/images/image/title" + "/@xsi:nil", "pba__propertytype__c", "pba__propertytype__c" + "/@xsi:nil", "rented_status__c", "rented_status__c" + "/@xsi:nil", "zipcode__c", "zipcode__c" + "/@xsi:nil", "pba__city_pb__c", "pba__city_pb__c" + "/@xsi:nil", "pba__description_pb__c", "pba__description_pb__c" + "/@xsi:nil", "term_2__c", "term_2__c" + "/@xsi:nil", "term_1__c", "term_1__c" + "/@xsi:nil", "pba__status__c", "pba__status__c" + "/@xsi:nil", "year_built__c", "year_built__c" + "/@xsi:nil", "pba__address_pb__c", "pba__address_pb__c" + "/@xsi:nil", "financed_net_yield_1__c", "financed_net_yield_1__c" + "/@xsi:nil", "monthly_cash_flow_with_financing_2__c", "monthly_cash_flow_with_financing_2__c" + "/@xsi:nil", "financed_net_yield_2__c", "financed_net_yield_2__c" + "/@xsi:nil", "monthly_cash_flow_with_financing_1__c", "monthly_cash_flow_with_financing_1__c" + "/@xsi:nil", "interest_rate_2__c", "interest_rate_2__c" + "/@xsi:nil", "interest_rate_1__c", "interest_rate_1__c" + "/@xsi:nil", "monthly_cash_flow__c", "monthly_cash_flow__c" + "/@xsi:nil", "noi__c", "noi__c" + "/@xsi:nil", "noi_with_financing_2__c", "noi_with_financing_2__c" + "/@xsi:nil", "noi_with_financing_1__c", "noi_with_financing_1__c" + "/@xsi:nil", "price_per_ft__c", "price_per_ft__c" + "/@xsi:nil", "price__c", "price__c" + "/@xsi:nil", "yearly_interest_payment_1__c", "yearly_interest_payment_1__c" + "/@xsi:nil", "monthly_interest_payment_2__c", "monthly_interest_payment_2__c" + "/@xsi:nil", "interest_payment_1__c", "interest_payment_1__c" + "/@xsi:nil", "down_payment_2__c", "down_payment_2__c" + "/@xsi:nil", "down_payment_1__c", "down_payment_1__c" + "/@xsi:nil", "cash_net_yield__c", "cash_net_yield__c" + "/@xsi:nil", "monthly_management__c", "monthly_management__c" + "/@xsi:nil", "management__c", "management__c" + "/@xsi:nil", "monthly_insurance__c", "monthly_insurance__c" + "/@xsi:nil", "insurance__c", "insurance__c" + "/@xsi:nil", "taxes__c", "taxes__c" + "/@xsi:nil", "monthly_taxes__c", "monthly_taxes__c" + "/@xsi:nil", "monthlyrent__c", "monthlyrent__c" + "/@xsi:nil", "annual_rents__c", "annual_rents__c" + "/@xsi:nil", "est_of_market_value__c", "est_of_market_value__c" + "/@xsi:nil", "est_value_per_rent_multiplier__c", "est_value_per_rent_multiplier__c" + "/@xsi:nil", "estimated_value__c", "estimated_value__c" + "/@xsi:nil", "est_replacement_cost_per_sq_ft__c", "est_replacement_cost_per_sq_ft__c" + "/@xsi:nil", "est_replacement_cost__c", "est_replacement_cost__c" + "/@xsi:nil", "pba__totalarea_pb__c", "pba__totalarea_pb__c" + "/@xsi:nil", "bedrooms__c", "bedrooms__c" + "/@xsi:nil", "bathrooms__c", "bathrooms__c" + "/@xsi:nil" }; boolean[] asXMLs_tFileInputXML_1 = new boolean[] { false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false }; String str_tFileInputXML_1 = ""; String[] node_tFileInputXML_1 = null; org.talend.xml.sax.SAXLooper looper_tFileInputXML_1 = new org.talend.xml.sax.SAXLooper( "/result/listings/listing/data", queryPaths_tFileInputXML_1, asXMLs_tFileInputXML_1); looper_tFileInputXML_1.setEncoding("UTF-8"); Object filename_tFileInputXML_1 = null; try { filename_tFileInputXML_1 = ((java.io.InputStream) globalMap.get("tFileFetch_1_INPUT_STREAM")); } catch (Exception e) { System.err.println(e.getMessage()); } if (filename_tFileInputXML_1 != null && filename_tFileInputXML_1 instanceof String && filename_tFileInputXML_1.toString().startsWith("//")) { if (!isWindows_tFileInputXML_1) { filename_tFileInputXML_1 = filename_tFileInputXML_1.toString().replaceFirst("//", "/"); } } if (filename_tFileInputXML_1 instanceof java.io.InputStream) { looper_tFileInputXML_1.parse((java.io.InputStream) filename_tFileInputXML_1); } else { looper_tFileInputXML_1.parse(String.valueOf(filename_tFileInputXML_1)); } java.util.Iterator<java.util.Map<String, String>> it_tFileInputXML_1 = looper_tFileInputXML_1 .iterator(); while (it_tFileInputXML_1.hasNext()) { java.util.Map<String, String> row_tFileInputXML_1 = it_tFileInputXML_1.next(); nb_line_tFileInputXML_1++; row1 = null; boolean whetherReject_tFileInputXML_1 = false; row1 = new row1Struct(); try { str_tFileInputXML_1 = row_tFileInputXML_1.get("name"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("name" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.name = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1)) { row1.name = ""; } else if (xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.name = null; } else { row1.name = str_tFileInputXML_1; } str_tFileInputXML_1 = row_tFileInputXML_1.get("../media/images/image/url"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("../media/images/image/url" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.image_url = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1)) { row1.image_url = ""; } else if (xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.image_url = null; } else { row1.image_url = str_tFileInputXML_1; } str_tFileInputXML_1 = row_tFileInputXML_1.get("../media/images/image/title"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("../media/images/image/title" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.image_title = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1)) { row1.image_title = ""; } else if (xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.image_title = null; } else { row1.image_title = str_tFileInputXML_1; } str_tFileInputXML_1 = row_tFileInputXML_1.get("pba__propertytype__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("pba__propertytype__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.pba__propertytype__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1)) { row1.pba__propertytype__c = ""; } else if (xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.pba__propertytype__c = null; } else { row1.pba__propertytype__c = str_tFileInputXML_1; } str_tFileInputXML_1 = row_tFileInputXML_1.get("rented_status__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("rented_status__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.rented_status__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1)) { row1.rented_status__c = ""; } else if (xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.rented_status__c = null; } else { row1.rented_status__c = str_tFileInputXML_1; } str_tFileInputXML_1 = row_tFileInputXML_1.get("zipcode__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("zipcode__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.zipcode__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.zipcode__c = null; } else { row1.zipcode__c = ParserUtils.parseTo_Integer(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("pba__city_pb__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("pba__city_pb__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.pba__city_pb__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1)) { row1.pba__city_pb__c = ""; } else if (xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.pba__city_pb__c = null; } else { row1.pba__city_pb__c = str_tFileInputXML_1; } str_tFileInputXML_1 = row_tFileInputXML_1.get("pba__description_pb__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("pba__description_pb__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.pba__description_pb__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1)) { row1.pba__description_pb__c = ""; } else if (xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.pba__description_pb__c = null; } else { row1.pba__description_pb__c = str_tFileInputXML_1; } str_tFileInputXML_1 = row_tFileInputXML_1.get("term_2__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("term_2__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.term_2__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1)) { row1.term_2__c = ""; } else if (xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.term_2__c = null; } else { row1.term_2__c = str_tFileInputXML_1; } str_tFileInputXML_1 = row_tFileInputXML_1.get("term_1__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("term_1__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.term_1__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1)) { row1.term_1__c = ""; } else if (xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.term_1__c = null; } else { row1.term_1__c = str_tFileInputXML_1; } str_tFileInputXML_1 = row_tFileInputXML_1.get("pba__status__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("pba__status__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.pba__status__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1)) { row1.pba__status__c = ""; } else if (xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.pba__status__c = null; } else { row1.pba__status__c = str_tFileInputXML_1; } str_tFileInputXML_1 = row_tFileInputXML_1.get("year_built__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("year_built__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.year_built__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.year_built__c = null; } else { row1.year_built__c = ParserUtils.parseTo_Integer(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("pba__address_pb__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("pba__address_pb__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.pba__address_pb__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1)) { row1.pba__address_pb__c = ""; } else if (xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.pba__address_pb__c = null; } else { row1.pba__address_pb__c = str_tFileInputXML_1; } str_tFileInputXML_1 = row_tFileInputXML_1.get("financed_net_yield_1__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("financed_net_yield_1__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.financed_net_yield_1__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.financed_net_yield_1__c = null; } else { row1.financed_net_yield_1__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("monthly_cash_flow_with_financing_2__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("monthly_cash_flow_with_financing_2__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.monthly_cash_flow_with_financing_2__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.monthly_cash_flow_with_financing_2__c = null; } else { row1.monthly_cash_flow_with_financing_2__c = ParserUtils .parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("financed_net_yield_2__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("financed_net_yield_2__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.financed_net_yield_2__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.financed_net_yield_2__c = null; } else { row1.financed_net_yield_2__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("monthly_cash_flow_with_financing_1__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("monthly_cash_flow_with_financing_1__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.monthly_cash_flow_with_financing_1__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.monthly_cash_flow_with_financing_1__c = null; } else { row1.monthly_cash_flow_with_financing_1__c = ParserUtils .parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("interest_rate_2__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("interest_rate_2__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.interest_rate_2__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.interest_rate_2__c = null; } else { row1.interest_rate_2__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("interest_rate_1__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("interest_rate_1__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.interest_rate_1__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.interest_rate_1__c = null; } else { row1.interest_rate_1__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("monthly_cash_flow__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("monthly_cash_flow__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.monthly_cash_flow__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.monthly_cash_flow__c = null; } else { row1.monthly_cash_flow__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("noi__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("noi__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.noi__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.noi__c = null; } else { row1.noi__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("noi_with_financing_2__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("noi_with_financing_2__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.noi_with_financing_2__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.noi_with_financing_2__c = null; } else { row1.noi_with_financing_2__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("noi_with_financing_1__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("noi_with_financing_1__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.noi_with_financing_1__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.noi_with_financing_1__c = null; } else { row1.noi_with_financing_1__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("price_per_ft__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("price_per_ft__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.price_per_ft__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.price_per_ft__c = null; } else { row1.price_per_ft__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("price__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("price__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.price__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.price__c = null; } else { row1.price__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("yearly_interest_payment_1__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("yearly_interest_payment_1__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.yearly_interest_payment_1__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.yearly_interest_payment_1__c = null; } else { row1.yearly_interest_payment_1__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("monthly_interest_payment_2__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("monthly_interest_payment_2__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.monthly_interest_payment_2__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.monthly_interest_payment_2__c = null; } else { row1.monthly_interest_payment_2__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("interest_payment_1__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("interest_payment_1__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.interest_payment_1__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.interest_payment_1__c = null; } else { row1.interest_payment_1__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("down_payment_2__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("down_payment_2__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.down_payment_2__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.down_payment_2__c = null; } else { row1.down_payment_2__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("down_payment_1__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("down_payment_1__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.down_payment_1__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.down_payment_1__c = null; } else { row1.down_payment_1__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("cash_net_yield__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("cash_net_yield__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.cash_net_yield__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.cash_net_yield__c = null; } else { row1.cash_net_yield__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("monthly_management__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("monthly_management__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.monthly_management__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.monthly_management__c = null; } else { row1.monthly_management__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("management__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("management__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.management__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.management__c = null; } else { row1.management__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("monthly_insurance__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("monthly_insurance__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.monthly_insurance__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.monthly_insurance__c = null; } else { row1.monthly_insurance__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("insurance__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("insurance__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.insurance__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.insurance__c = null; } else { row1.insurance__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("taxes__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("taxes__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.taxes__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.taxes__c = null; } else { row1.taxes__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("monthly_taxes__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("monthly_taxes__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.monthly_taxes__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.monthly_taxes__c = null; } else { row1.monthly_taxes__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("monthlyrent__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("monthlyrent__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.monthlyrent__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.monthlyrent__c = null; } else { row1.monthlyrent__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("annual_rents__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("annual_rents__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.annual_rents__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.annual_rents__c = null; } else { row1.annual_rents__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("est_of_market_value__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("est_of_market_value__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.est_of_market_value__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.est_of_market_value__c = null; } else { row1.est_of_market_value__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("est_value_per_rent_multiplier__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("est_value_per_rent_multiplier__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.est_value_per_rent_multiplier__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.est_value_per_rent_multiplier__c = null; } else { row1.est_value_per_rent_multiplier__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("estimated_value__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("estimated_value__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.estimated_value__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1)) { row1.estimated_value__c = ""; } else if (xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.estimated_value__c = null; } else { row1.estimated_value__c = str_tFileInputXML_1; } str_tFileInputXML_1 = row_tFileInputXML_1.get("est_replacement_cost_per_sq_ft__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("est_replacement_cost_per_sq_ft__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.est_replacement_cost_per_sq_ft__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.est_replacement_cost_per_sq_ft__c = null; } else { row1.est_replacement_cost_per_sq_ft__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("est_replacement_cost__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("est_replacement_cost__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.est_replacement_cost__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.est_replacement_cost__c = null; } else { row1.est_replacement_cost__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("pba__totalarea_pb__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("pba__totalarea_pb__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.pba__totalarea_pb__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.pba__totalarea_pb__c = null; } else { row1.pba__totalarea_pb__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("bedrooms__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("bedrooms__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.bedrooms__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.bedrooms__c = null; } else { row1.bedrooms__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("bathrooms__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("bathrooms__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.bathrooms__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.bathrooms__c = null; } else { row1.bathrooms__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } } catch (Exception e) { whetherReject_tFileInputXML_1 = true; System.err.println(e.getMessage()); row1 = null; } /** * [tFileInputXML_1 begin ] stop */ /** * [tFileInputXML_1 main ] start */ currentComponent = "tFileInputXML_1"; tos_count_tFileInputXML_1++; /** * [tFileInputXML_1 main ] stop */ // Start of branch "row1" if (row1 != null) { /** * [tMap_2 main ] start */ currentComponent = "tMap_2"; boolean hasCasePrimitiveKeyWithNull_tMap_2 = false; // ############################### // # Input tables (lookups) boolean rejectedInnerJoin_tMap_2 = false; boolean mainRowRejected_tMap_2 = false; // ############################### { // start of Var scope // ############################### // # Vars tables Var__tMap_2__Struct Var = Var__tMap_2;// ############################### // ############################### // # Output tables stateInfo = null; propertyData = null; // # Output table : 'stateInfo' stateInfo_tmp.zipcode__c = row1.zipcode__c; stateInfo_tmp.pba__city_pb__c = row1.pba__city_pb__c; stateInfo = stateInfo_tmp; // # Output table : 'propertyData' propertyData_tmp.name = row1.name; propertyData_tmp.image_url = row1.image_url; propertyData_tmp.image_title = row1.image_title; propertyData_tmp.pba__propertytype__c = row1.pba__propertytype__c; propertyData_tmp.rented_status__c = row1.rented_status__c; propertyData_tmp.zipcode__c = row1.zipcode__c; propertyData_tmp.pba__city_pb__c = row1.pba__city_pb__c; propertyData_tmp.pba__description_pb__c = row1.pba__description_pb__c; propertyData_tmp.term_2__c = row1.term_2__c; propertyData_tmp.term_1__c = row1.term_1__c; propertyData_tmp.pba__status__c = row1.pba__status__c; propertyData_tmp.year_built__c = row1.year_built__c; propertyData_tmp.pba__address_pb__c = row1.pba__address_pb__c; propertyData_tmp.financed_net_yield_1__c = row1.financed_net_yield_1__c; propertyData_tmp.monthly_cash_flow_with_financing_2__c = row1.monthly_cash_flow_with_financing_2__c; propertyData_tmp.financed_net_yield_2__c = row1.financed_net_yield_2__c; propertyData_tmp.monthly_cash_flow_with_financing_1__c = row1.monthly_cash_flow_with_financing_1__c; propertyData_tmp.interest_rate_2__c = row1.interest_rate_2__c; propertyData_tmp.interest_rate_1__c = row1.interest_rate_1__c; propertyData_tmp.monthly_cash_flow__c = row1.monthly_cash_flow__c; propertyData_tmp.noi__c = row1.noi__c; propertyData_tmp.noi_with_financing_2__c = row1.noi_with_financing_2__c; propertyData_tmp.noi_with_financing_1__c = row1.noi_with_financing_1__c; propertyData_tmp.price_per_ft__c = row1.price_per_ft__c; propertyData_tmp.price__c = row1.price__c; propertyData_tmp.yearly_interest_payment_1__c = row1.yearly_interest_payment_1__c; propertyData_tmp.monthly_interest_payment_2__c = row1.monthly_interest_payment_2__c; propertyData_tmp.interest_payment_1__c = row1.interest_payment_1__c; propertyData_tmp.down_payment_2__c = row1.down_payment_2__c; propertyData_tmp.down_payment_1__c = row1.down_payment_1__c; propertyData_tmp.cash_net_yield__c = row1.cash_net_yield__c; propertyData_tmp.monthly_management__c = row1.monthly_management__c; propertyData_tmp.management__c = row1.management__c; propertyData_tmp.monthly_insurance__c = row1.monthly_insurance__c; propertyData_tmp.insurance__c = row1.insurance__c; propertyData_tmp.taxes__c = row1.taxes__c; propertyData_tmp.monthly_taxes__c = row1.monthly_taxes__c; propertyData_tmp.monthlyrent__c = row1.monthlyrent__c; propertyData_tmp.annual_rents__c = row1.annual_rents__c; propertyData_tmp.est_of_market_value__c = row1.est_of_market_value__c; propertyData_tmp.est_value_per_rent_multiplier__c = row1.est_value_per_rent_multiplier__c; propertyData_tmp.estimated_value__c = row1.estimated_value__c; propertyData_tmp.est_replacement_cost_per_sq_ft__c = row1.est_replacement_cost_per_sq_ft__c; propertyData_tmp.est_replacement_cost__c = row1.est_replacement_cost__c; propertyData_tmp.pba__totalarea_pb__c = row1.pba__totalarea_pb__c; propertyData_tmp.bedrooms__c = row1.bedrooms__c; propertyData_tmp.bathrooms__c = row1.bathrooms__c; propertyData = propertyData_tmp; // ############################### } // end of Var scope rejectedInnerJoin_tMap_2 = false; tos_count_tMap_2++; /** * [tMap_2 main ] stop */ // Start of branch "stateInfo" if (stateInfo != null) { /** * [tFlowToIterate_1 main ] start */ currentComponent = "tFlowToIterate_1"; globalMap.put("zipCode", stateInfo.zipcode__c); nb_line_tFlowToIterate_1++; counter_tFlowToIterate_1++; globalMap.put("tFlowToIterate_1_CURRENT_ITERATION", counter_tFlowToIterate_1); tos_count_tFlowToIterate_1++; /** * [tFlowToIterate_1 main ] stop */ NB_ITERATE_tFileInputJSON_1++; iterateLoop++; /** * [tMysqlOutput_4 begin ] start */ ok_Hash.put("tMysqlOutput_4", false); start_Hash.put("tMysqlOutput_4", System.currentTimeMillis()); currentComponent = "tMysqlOutput_4"; int tos_count_tMysqlOutput_4 = 0; int nb_line_tMysqlOutput_4 = 0; int nb_line_update_tMysqlOutput_4 = 0; int nb_line_inserted_tMysqlOutput_4 = 0; int nb_line_deleted_tMysqlOutput_4 = 0; int nb_line_rejected_tMysqlOutput_4 = 0; int deletedCount_tMysqlOutput_4 = 0; int updatedCount_tMysqlOutput_4 = 0; int insertedCount_tMysqlOutput_4 = 0; int rejectedCount_tMysqlOutput_4 = 0; String tableName_tMysqlOutput_4 = "STATE_INFO"; boolean whetherReject_tMysqlOutput_4 = false; java.util.Calendar calendar_tMysqlOutput_4 = java.util.Calendar.getInstance(); calendar_tMysqlOutput_4.set(1, 0, 1, 0, 0, 0); long year1_tMysqlOutput_4 = calendar_tMysqlOutput_4.getTime().getTime(); calendar_tMysqlOutput_4.set(10000, 0, 1, 0, 0, 0); long year10000_tMysqlOutput_4 = calendar_tMysqlOutput_4.getTime().getTime(); long date_tMysqlOutput_4; java.sql.Connection conn_tMysqlOutput_4 = null; java.util.Map<String, routines.system.TalendDataSource> dataSources_tMysqlOutput_4 = (java.util.Map<String, routines.system.TalendDataSource>) globalMap .get(KEY_DB_DATASOURCES); if (null != dataSources_tMysqlOutput_4) { conn_tMysqlOutput_4 = dataSources_tMysqlOutput_4.get("").getConnection(); } else { String dbProperties_tMysqlOutput_4 = "noDatetimeStringSync=true"; String url_tMysqlOutput_4 = null; if (dbProperties_tMysqlOutput_4 == null || dbProperties_tMysqlOutput_4.trim().length() == 0) { url_tMysqlOutput_4 = "jdbc:mysql://" + "192.168.1.254" + ":" + "3306" + "/" + "TALONDB" + "?" + "rewriteBatchedStatements=true"; } else { String properties_tMysqlOutput_4 = "noDatetimeStringSync=true"; if (!properties_tMysqlOutput_4.contains("rewriteBatchedStatements")) { properties_tMysqlOutput_4 += "&rewriteBatchedStatements=true"; } url_tMysqlOutput_4 = "jdbc:mysql://" + "192.168.1.254" + ":" + "3306" + "/" + "TALONDB" + "?" + properties_tMysqlOutput_4; } String dbUser_tMysqlOutput_4 = "dbAdmin"; String dbPwd_tMysqlOutput_4 = "1nn0s2013"; java.lang.Class.forName("org.gjt.mm.mysql.Driver"); conn_tMysqlOutput_4 = java.sql.DriverManager.getConnection(url_tMysqlOutput_4, dbUser_tMysqlOutput_4, dbPwd_tMysqlOutput_4); } conn_tMysqlOutput_4.setAutoCommit(false); int commitEvery_tMysqlOutput_4 = 1; int commitCounter_tMysqlOutput_4 = 0; int count_tMysqlOutput_4 = 0; String insert_tMysqlOutput_4 = "INSERT INTO `" + "STATE_INFO" + "` (`ID`,`STATE`,`CITY`,`ZIP`) VALUES (?,?,?,?)"; int batchSize_tMysqlOutput_4 = 1; int batchSizeCounter_tMysqlOutput_4 = 0; java.sql.PreparedStatement pstmt_tMysqlOutput_4 = conn_tMysqlOutput_4 .prepareStatement(insert_tMysqlOutput_4); /** * [tMysqlOutput_4 begin ] stop */ /** * [tMap_3 begin ] start */ ok_Hash.put("tMap_3", false); start_Hash.put("tMap_3", System.currentTimeMillis()); currentComponent = "tMap_3"; int tos_count_tMap_3 = 0; // ############################### // # Lookup's keys initialization // ############################### // ############################### // # Vars initialization class Var__tMap_3__Struct { } Var__tMap_3__Struct Var__tMap_3 = new Var__tMap_3__Struct(); // ############################### // ############################### // # Outputs initialization loadNewStateInfoStruct loadNewStateInfo_tmp = new loadNewStateInfoStruct(); // ############################### /** * [tMap_3 begin ] stop */ /** * [tJoin_1 begin ] start */ ok_Hash.put("tJoin_1", false); start_Hash.put("tJoin_1", System.currentTimeMillis()); currentComponent = "tJoin_1"; int tos_count_tJoin_1 = 0; final java.util.Map<row4Struct, row4Struct> tHash_tJoin_1 = (java.util.Map<row4Struct, row4Struct>) globalMap .get("tHash_row4"); class Util_tJoin_1 { row4Struct lookupValue = null; row4Struct row4HashKey = new row4Struct(); public boolean isJoined(row3Struct mainRow) { row4HashKey.ZIP = mainRow.zip; row4HashKey.hashCodeDirty = true; lookupValue = tHash_tJoin_1.get(row4HashKey); if (lookupValue != null) { return true; } return false; } } Util_tJoin_1 util_tJoin_1 = new Util_tJoin_1(); int nb_line_tJoin_1 = 0; /** * [tJoin_1 begin ] stop */ /** * [tJavaRow_1 begin ] start */ ok_Hash.put("tJavaRow_1", false); start_Hash.put("tJavaRow_1", System.currentTimeMillis()); currentComponent = "tJavaRow_1"; int tos_count_tJavaRow_1 = 0; int nb_line_tJavaRow_1 = 0; /** * [tJavaRow_1 begin ] stop */ /** * [tFileInputJSON_1 begin ] start */ ok_Hash.put("tFileInputJSON_1", false); start_Hash.put("tFileInputJSON_1", System.currentTimeMillis()); currentComponent = "tFileInputJSON_1"; int tos_count_tFileInputJSON_1 = 0; class JSONUtil_tFileInputJSON_1 { public int getData(String query, javax.script.Invocable invocableEngine, java.util.List<org.json.simple.JSONArray> jsonResultList, int recordMaxSize) { try { // only 2 types: String/Boolean String resultObj = invocableEngine.invokeFunction("jsonPath", query) .toString(); if (!"false".equals(resultObj)) { org.json.simple.JSONArray resultArray = (org.json.simple.JSONArray) org.json.simple.JSONValue .parse(resultObj); jsonResultList.add(resultArray); if (recordMaxSize != -1 && recordMaxSize != resultArray.size()) { // just give an error, don't // stop System.err.println( "The Json resource datas maybe have some problems, please make sure the data structure with the same fields."); } recordMaxSize = Math.max(recordMaxSize, resultArray.size()); } else { System.err.println("Can't find any data with JSONPath " + query); // add null to take a place in // List(buffer) jsonResultList.add(null); } } catch (Exception e) { e.printStackTrace(); } return recordMaxSize; } void setRowValue_0(row2Struct row2, java.util.List<org.json.simple.JSONArray> JSONResultList_tFileInputJSON_1, int nbResultArray_tFileInputJSON_1) throws java.io.UnsupportedEncodingException { if (JSONResultList_tFileInputJSON_1.get(0) != null && nbResultArray_tFileInputJSON_1 < JSONResultList_tFileInputJSON_1 .get(0).size() && JSONResultList_tFileInputJSON_1.get(0) .get(nbResultArray_tFileInputJSON_1) != null) { row2.city = JSONResultList_tFileInputJSON_1.get(0) .get(nbResultArray_tFileInputJSON_1).toString(); } else { row2.city = null; } if (JSONResultList_tFileInputJSON_1.get(1) != null && nbResultArray_tFileInputJSON_1 < JSONResultList_tFileInputJSON_1 .get(1).size() && JSONResultList_tFileInputJSON_1.get(1) .get(nbResultArray_tFileInputJSON_1) != null) { row2.state = JSONResultList_tFileInputJSON_1.get(1) .get(nbResultArray_tFileInputJSON_1).toString(); } else { row2.state = null; } if (JSONResultList_tFileInputJSON_1.get(2) != null && nbResultArray_tFileInputJSON_1 < JSONResultList_tFileInputJSON_1 .get(2).size() && JSONResultList_tFileInputJSON_1.get(2) .get(nbResultArray_tFileInputJSON_1) != null) { row2.country = JSONResultList_tFileInputJSON_1.get(2) .get(nbResultArray_tFileInputJSON_1).toString(); } else { row2.country = null; } } } int nb_line_tFileInputJSON_1 = 0; javax.script.ScriptEngineManager scriptEngineMgr_tFileInputJSON_1 = new javax.script.ScriptEngineManager(); javax.script.ScriptEngine jsEngine_tFileInputJSON_1 = scriptEngineMgr_tFileInputJSON_1 .getEngineByName("JavaScript"); if (jsEngine_tFileInputJSON_1 == null) { System.err.println("No script engine found for JavaScript"); } java.io.InputStream jsonis_tFileInputJSON_1 = com.jsonpath.test.ReadJar.class .getResource("json.js").openStream(); jsEngine_tFileInputJSON_1.eval(new java.io.BufferedReader( new java.io.InputStreamReader(jsonis_tFileInputJSON_1))); java.io.InputStream jsonpathis_tFileInputJSON_1 = com.jsonpath.test.ReadJar.class .getResource("jsonpath.js").openStream(); jsEngine_tFileInputJSON_1.eval(new java.io.BufferedReader( new java.io.InputStreamReader(jsonpathis_tFileInputJSON_1))); java.net.URL url_tFileInputJSON_1 = new java.net.URL( "http://ziptasticapi.com/" + ((Integer) globalMap.get("zipCode"))); java.net.URLConnection urlConn_tFileInputJSON_1 = url_tFileInputJSON_1.openConnection(); java.io.InputStreamReader fr_tFileInputJSON_1 = new java.io.InputStreamReader( urlConn_tFileInputJSON_1.getInputStream(), "UTF-8"); java.lang.Object jsonText_tFileInputJSON_1 = org.json.simple.JSONValue .parse(fr_tFileInputJSON_1); jsEngine_tFileInputJSON_1.eval("var obj=" + jsonText_tFileInputJSON_1.toString()); java.util.List<org.json.simple.JSONArray> JSONResultList_tFileInputJSON_1 = new java.util.ArrayList<org.json.simple.JSONArray>(); int recordMaxSize_tFileInputJSON_1 = -1; javax.script.Invocable invocableEngine_tFileInputJSON_1 = (javax.script.Invocable) jsEngine_tFileInputJSON_1; JSONUtil_tFileInputJSON_1 jsonUtil_tFileInputJSON_1 = new JSONUtil_tFileInputJSON_1(); recordMaxSize_tFileInputJSON_1 = jsonUtil_tFileInputJSON_1.getData("city", invocableEngine_tFileInputJSON_1, JSONResultList_tFileInputJSON_1, recordMaxSize_tFileInputJSON_1); recordMaxSize_tFileInputJSON_1 = jsonUtil_tFileInputJSON_1.getData("state", invocableEngine_tFileInputJSON_1, JSONResultList_tFileInputJSON_1, recordMaxSize_tFileInputJSON_1); recordMaxSize_tFileInputJSON_1 = jsonUtil_tFileInputJSON_1.getData("country", invocableEngine_tFileInputJSON_1, JSONResultList_tFileInputJSON_1, recordMaxSize_tFileInputJSON_1); for (int nbResultArray_tFileInputJSON_1 = 0; nbResultArray_tFileInputJSON_1 < recordMaxSize_tFileInputJSON_1; nbResultArray_tFileInputJSON_1++) { nb_line_tFileInputJSON_1++; jsonUtil_tFileInputJSON_1.setRowValue_0(row2, JSONResultList_tFileInputJSON_1, nbResultArray_tFileInputJSON_1); /** * [tFileInputJSON_1 begin ] stop */ /** * [tFileInputJSON_1 main ] start */ currentComponent = "tFileInputJSON_1"; tos_count_tFileInputJSON_1++; /** * [tFileInputJSON_1 main ] stop */ /** * [tJavaRow_1 main ] start */ currentComponent = "tJavaRow_1"; // Code generated according to input schema and // output schema row3.city = row2.city; row3.state = row2.state; row3.country = row2.country; row3.zip = ((Integer) globalMap.get("zipCode")); nb_line_tJavaRow_1++; tos_count_tJavaRow_1++; /** * [tJavaRow_1 main ] stop */ /** * [tJoin_1 main ] start */ currentComponent = "tJoin_1"; row5 = null; row5 = new row5Struct(); row5.city = row3.city; row5.state = row3.state; row5.country = row3.country; row5.zip = row3.zip; if (util_tJoin_1.isJoined(row3)) { row5 = null; } else { } // ///////////////////// tos_count_tJoin_1++; /** * [tJoin_1 main ] stop */ // Start of branch "row5" if (row5 != null) { /** * [tMap_3 main ] start */ currentComponent = "tMap_3"; boolean hasCasePrimitiveKeyWithNull_tMap_3 = false; // ############################### // # Input tables (lookups) boolean rejectedInnerJoin_tMap_3 = false; boolean mainRowRejected_tMap_3 = false; // ############################### { // start of Var scope // ############################### // # Vars tables Var__tMap_3__Struct Var = Var__tMap_3;// ############################### // ############################### // # Output tables loadNewStateInfo = null; // # Output table : 'loadNewStateInfo' loadNewStateInfo_tmp.ID = 0; loadNewStateInfo_tmp.STATE = row5.state; loadNewStateInfo_tmp.CITY = row5.city; loadNewStateInfo_tmp.ZIP = row5.zip; loadNewStateInfo = loadNewStateInfo_tmp; // ############################### } // end of Var scope rejectedInnerJoin_tMap_3 = false; tos_count_tMap_3++; /** * [tMap_3 main ] stop */ // Start of branch "loadNewStateInfo" if (loadNewStateInfo != null) { /** * [tMysqlOutput_4 main ] start */ currentComponent = "tMysqlOutput_4"; whetherReject_tMysqlOutput_4 = false; pstmt_tMysqlOutput_4.setInt(1, loadNewStateInfo.ID); if (loadNewStateInfo.STATE == null) { pstmt_tMysqlOutput_4.setNull(2, java.sql.Types.VARCHAR); } else { pstmt_tMysqlOutput_4.setString(2, loadNewStateInfo.STATE); } if (loadNewStateInfo.CITY == null) { pstmt_tMysqlOutput_4.setNull(3, java.sql.Types.VARCHAR); } else { pstmt_tMysqlOutput_4.setString(3, loadNewStateInfo.CITY); } pstmt_tMysqlOutput_4.setInt(4, loadNewStateInfo.ZIP); pstmt_tMysqlOutput_4.addBatch(); nb_line_tMysqlOutput_4++; batchSizeCounter_tMysqlOutput_4++; if (batchSize_tMysqlOutput_4 <= batchSizeCounter_tMysqlOutput_4) { try { int countSum_tMysqlOutput_4 = 0; for (int countEach_tMysqlOutput_4 : pstmt_tMysqlOutput_4 .executeBatch()) { countSum_tMysqlOutput_4 += (countEach_tMysqlOutput_4 < 0 ? 0 : countEach_tMysqlOutput_4); } insertedCount_tMysqlOutput_4 += countSum_tMysqlOutput_4; } catch (java.sql.BatchUpdateException e) { int countSum_tMysqlOutput_4 = 0; for (int countEach_tMysqlOutput_4 : e.getUpdateCounts()) { countSum_tMysqlOutput_4 += (countEach_tMysqlOutput_4 < 0 ? 0 : countEach_tMysqlOutput_4); } insertedCount_tMysqlOutput_4 += countSum_tMysqlOutput_4; System.err.println(e.getMessage()); } batchSizeCounter_tMysqlOutput_4 = 0; } commitCounter_tMysqlOutput_4++; if (commitEvery_tMysqlOutput_4 <= commitCounter_tMysqlOutput_4) { try { int countSum_tMysqlOutput_4 = 0; for (int countEach_tMysqlOutput_4 : pstmt_tMysqlOutput_4 .executeBatch()) { countSum_tMysqlOutput_4 += (countEach_tMysqlOutput_4 < 0 ? 0 : countEach_tMysqlOutput_4); } insertedCount_tMysqlOutput_4 += countSum_tMysqlOutput_4; } catch (java.sql.BatchUpdateException e) { int countSum_tMysqlOutput_4 = 0; for (int countEach_tMysqlOutput_4 : e.getUpdateCounts()) { countSum_tMysqlOutput_4 += (countEach_tMysqlOutput_4 < 0 ? 0 : countEach_tMysqlOutput_4); } insertedCount_tMysqlOutput_4 += countSum_tMysqlOutput_4; System.out.println(e.getMessage()); } conn_tMysqlOutput_4.commit(); commitCounter_tMysqlOutput_4 = 0; } tos_count_tMysqlOutput_4++; /** * [tMysqlOutput_4 main ] stop */ } // End of branch "loadNewStateInfo" } // End of branch "row5" /** * [tFileInputJSON_1 end ] start */ currentComponent = "tFileInputJSON_1"; } globalMap.put("tFileInputJSON_1_NB_LINE", nb_line_tFileInputJSON_1); ok_Hash.put("tFileInputJSON_1", true); end_Hash.put("tFileInputJSON_1", System.currentTimeMillis()); /** * [tFileInputJSON_1 end ] stop */ /** * [tJavaRow_1 end ] start */ currentComponent = "tJavaRow_1"; globalMap.put("tJavaRow_1_NB_LINE", nb_line_tJavaRow_1); ok_Hash.put("tJavaRow_1", true); end_Hash.put("tJavaRow_1", System.currentTimeMillis()); /** * [tJavaRow_1 end ] stop */ /** * [tJoin_1 end ] start */ currentComponent = "tJoin_1"; ok_Hash.put("tJoin_1", true); end_Hash.put("tJoin_1", System.currentTimeMillis()); /** * [tJoin_1 end ] stop */ /** * [tMap_3 end ] start */ currentComponent = "tMap_3"; // ############################### // # Lookup hashes releasing // ############################### ok_Hash.put("tMap_3", true); end_Hash.put("tMap_3", System.currentTimeMillis()); /** * [tMap_3 end ] stop */ /** * [tMysqlOutput_4 end ] start */ currentComponent = "tMysqlOutput_4"; try { if (batchSizeCounter_tMysqlOutput_4 != 0) { int countSum_tMysqlOutput_4 = 0; for (int countEach_tMysqlOutput_4 : pstmt_tMysqlOutput_4.executeBatch()) { countSum_tMysqlOutput_4 += (countEach_tMysqlOutput_4 < 0 ? 0 : countEach_tMysqlOutput_4); } insertedCount_tMysqlOutput_4 += countSum_tMysqlOutput_4; } } catch (java.sql.BatchUpdateException e) { int countSum_tMysqlOutput_4 = 0; for (int countEach_tMysqlOutput_4 : e.getUpdateCounts()) { countSum_tMysqlOutput_4 += (countEach_tMysqlOutput_4 < 0 ? 0 : countEach_tMysqlOutput_4); } insertedCount_tMysqlOutput_4 += countSum_tMysqlOutput_4; System.err.println(e.getMessage()); } batchSizeCounter_tMysqlOutput_4 = 0; try { if (pstmt_tMysqlOutput_4 != null) { int countSum_tMysqlOutput_4 = 0; for (int countEach_tMysqlOutput_4 : pstmt_tMysqlOutput_4.executeBatch()) { countSum_tMysqlOutput_4 += (countEach_tMysqlOutput_4 < 0 ? 0 : countEach_tMysqlOutput_4); } insertedCount_tMysqlOutput_4 += countSum_tMysqlOutput_4; } } catch (java.sql.BatchUpdateException e) { int countSum_tMysqlOutput_4 = 0; for (int countEach_tMysqlOutput_4 : e.getUpdateCounts()) { countSum_tMysqlOutput_4 += (countEach_tMysqlOutput_4 < 0 ? 0 : countEach_tMysqlOutput_4); } insertedCount_tMysqlOutput_4 += countSum_tMysqlOutput_4; System.out.println(e.getMessage()); } if (pstmt_tMysqlOutput_4 != null) { pstmt_tMysqlOutput_4.close(); } conn_tMysqlOutput_4.commit(); conn_tMysqlOutput_4.close(); nb_line_deleted_tMysqlOutput_4 = nb_line_deleted_tMysqlOutput_4 + deletedCount_tMysqlOutput_4; nb_line_update_tMysqlOutput_4 = nb_line_update_tMysqlOutput_4 + updatedCount_tMysqlOutput_4; nb_line_inserted_tMysqlOutput_4 = nb_line_inserted_tMysqlOutput_4 + insertedCount_tMysqlOutput_4; nb_line_rejected_tMysqlOutput_4 = nb_line_rejected_tMysqlOutput_4 + rejectedCount_tMysqlOutput_4; globalMap.put("tMysqlOutput_4_NB_LINE", nb_line_tMysqlOutput_4); globalMap.put("tMysqlOutput_4_NB_LINE_UPDATED", nb_line_update_tMysqlOutput_4); globalMap.put("tMysqlOutput_4_NB_LINE_INSERTED", nb_line_inserted_tMysqlOutput_4); globalMap.put("tMysqlOutput_4_NB_LINE_DELETED", nb_line_deleted_tMysqlOutput_4); globalMap.put("tMysqlOutput_4_NB_LINE_REJECTED", nb_line_rejected_tMysqlOutput_4); ok_Hash.put("tMysqlOutput_4", true); end_Hash.put("tMysqlOutput_4", System.currentTimeMillis()); /** * [tMysqlOutput_4 end ] stop */ } // End of branch "stateInfo" // Start of branch "propertyData" if (propertyData != null) { row9 = null; /** * [tMap_1 main ] start */ currentComponent = "tMap_1"; boolean hasCasePrimitiveKeyWithNull_tMap_1 = false; // ############################### // # Input tables (lookups) boolean rejectedInnerJoin_tMap_1 = false; boolean mainRowRejected_tMap_1 = false; // ///////////////////////////////////////////// // Starting Lookup Table "row6" // ///////////////////////////////////////////// boolean forceLooprow6 = false; row6Struct row6ObjectFromLookup = null; if (!rejectedInnerJoin_tMap_1) { // G_TM_M_020 hasCasePrimitiveKeyWithNull_tMap_1 = false; Object exprKeyValue_row6__ZIP = propertyData.zipcode__c; if (exprKeyValue_row6__ZIP == null) { hasCasePrimitiveKeyWithNull_tMap_1 = true; } else { row6HashKey.ZIP = (int) (Integer) exprKeyValue_row6__ZIP; } row6HashKey.hashCodeDirty = true; if (!hasCasePrimitiveKeyWithNull_tMap_1) { // G_TM_M_091 tHash_Lookup_Cache_row6.lookup(row6HashKey); if (tHash_Lookup_Cache_row6.hasNext()) { // G_TM_M_835 tHash_Lookup_row6 = tHash_Lookup_Cache_row6; } // G_TM_M_834 else { // G_TM_M_835 tMysqlInput_2Process(globalMap); tHash_Lookup_row6 = (org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row6Struct>) ((org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row6Struct>) globalMap .get("tHash_Lookup_row6")); tHash_Lookup_row6.initGet(); tHash_Lookup_row6.lookup(row6HashKey); } // G_TM_M_835 } // G_TM_M_091 if (hasCasePrimitiveKeyWithNull_tMap_1 || !tHash_Lookup_row6.hasNext()) { // G_TM_M_090 rejectedInnerJoin_tMap_1 = true; } // G_TM_M_090 } // G_TM_M_020 if (tHash_Lookup_row6 != null && tHash_Lookup_row6.getCount(row6HashKey) > 1) { // G // 071 // System.out.println("WARNING: UNIQUE MATCH is configured for the lookup 'row6' and it contains more one result from keys : row6.ZIP = '" // + row6HashKey.ZIP + "'"); } // G 071 row6Struct row6 = null; row6Struct fromLookup_row6 = null; row6 = row6Default; if (tHash_Lookup_row6 != null && tHash_Lookup_row6.hasNext()) { // G 099 fromLookup_row6 = tHash_Lookup_row6.next(); } // G 099 if (fromLookup_row6 != null) { row6 = fromLookup_row6; } if (tHash_Lookup_Cache_row6 != tHash_Lookup_row6) { tHash_Lookup_Cache_row6.put(row6); } // ############################### { // start of Var scope // ############################### // # Vars tables Var__tMap_1__Struct Var = Var__tMap_1;// ############################### // ############################### // # Output tables mappedData = null; if (!rejectedInnerJoin_tMap_1) { // # Output table : 'mappedData' mappedData_tmp.PROP_NAME = propertyData.name; mappedData_tmp.PRICE = propertyData.price__c; mappedData_tmp.SQFT = "1500"; mappedData_tmp.DESCRIPTION = propertyData.pba__description_pb__c; mappedData_tmp.NUM_BEDS = propertyData.bedrooms__c; mappedData_tmp.NUM_BATHS = propertyData.bathrooms__c; mappedData_tmp.STATE_INFO_ID = row6.ID; mappedData_tmp.customer = context.cusomterName; mappedData_tmp.status = propertyData.pba__status__c; mappedData_tmp.type = propertyData.pba__propertytype__c; mappedData = mappedData_tmp; } // closing inner join bracket (2) // ############################### } // end of Var scope rejectedInnerJoin_tMap_1 = false; tos_count_tMap_1++; /** * [tMap_1 main ] stop */ // Start of branch "mappedData" if (mappedData != null) { row9 = null; /** * [tMap_4 main ] start */ currentComponent = "tMap_4"; boolean hasCasePrimitiveKeyWithNull_tMap_4 = false; // ############################### // # Input tables (lookups) boolean rejectedInnerJoin_tMap_4 = false; boolean mainRowRejected_tMap_4 = false; // ///////////////////////////////////////////// // Starting Lookup Table "custData" // ///////////////////////////////////////////// boolean forceLoopcustData = false; custDataStruct custDataObjectFromLookup = null; if (!rejectedInnerJoin_tMap_4) { // G_TM_M_020 hasCasePrimitiveKeyWithNull_tMap_4 = false; custDataHashKey.CUST_NAME = mappedData.customer; custDataHashKey.hashCodeDirty = true; tHash_Lookup_custData.lookup(custDataHashKey); if (!tHash_Lookup_custData.hasNext()) { // G_TM_M_090 rejectedInnerJoin_tMap_4 = true; } // G_TM_M_090 } // G_TM_M_020 if (tHash_Lookup_custData != null && tHash_Lookup_custData.getCount(custDataHashKey) > 1) { // G // 071 // System.out.println("WARNING: UNIQUE MATCH is configured for the lookup 'custData' and it contains more one result from keys : custData.CUST_NAME = '" // + custDataHashKey.CUST_NAME + "'"); } // G 071 custDataStruct custData = null; custDataStruct fromLookup_custData = null; custData = custDataDefault; if (tHash_Lookup_custData != null && tHash_Lookup_custData.hasNext()) { // G // 099 fromLookup_custData = tHash_Lookup_custData.next(); } // G 099 if (fromLookup_custData != null) { custData = fromLookup_custData; } // ############################### { // start of Var scope // ############################### // # Vars tables Var__tMap_4__Struct Var = Var__tMap_4;// ############################### // ############################### // # Output tables loadData = null; if (!rejectedInnerJoin_tMap_4) { // # Output table : 'loadData' loadData_tmp.PROP_NAME = mappedData.PROP_NAME; loadData_tmp.PRICE = mappedData.PRICE; loadData_tmp.SQFT = mappedData.SQFT; loadData_tmp.DESCRIPTION = mappedData.DESCRIPTION; loadData_tmp.NUM_BEDS = mappedData.NUM_BEDS; loadData_tmp.NUM_BATHS = mappedData.NUM_BATHS; loadData_tmp.TYPE = mappedData.type; loadData_tmp.STATUS = mappedData.status; loadData_tmp.STATE_INFO_ID = mappedData.STATE_INFO_ID; loadData_tmp.DATA_SOURCE_ID = custData.DATA_SOURCE_ID; loadData = loadData_tmp; } // closing inner join bracket (2) // ############################### } // end of Var scope rejectedInnerJoin_tMap_4 = false; tos_count_tMap_4++; /** * [tMap_4 main ] stop */ // Start of branch "loadData" if (loadData != null) { row9 = null; /** * [tJoin_3 main ] start */ currentComponent = "tJoin_3"; row9 = null; row9 = new row9Struct(); row9.PROP_NAME = loadData.PROP_NAME; row9.PRICE = loadData.PRICE; row9.SQFT = loadData.SQFT; row9.DESCRIPTION = loadData.DESCRIPTION; row9.NUM_BEDS = loadData.NUM_BEDS; row9.NUM_BATHS = loadData.NUM_BATHS; row9.TYPE = loadData.TYPE; row9.STATUS = loadData.STATUS; row9.STATE_INFO_ID = loadData.STATE_INFO_ID; row9.DATA_SOURCE_ID = loadData.DATA_SOURCE_ID; if (util_tJoin_3.isJoined(loadData)) { row9 = null; } else { } // ///////////////////// tos_count_tJoin_3++; /** * [tJoin_3 main ] stop */ // Start of branch "row9" if (row9 != null) { /** * [tJavaRow_3 main ] start */ currentComponent = "tJavaRow_3"; // Code generated according to input // schema and output schema System.out.println( "***** Loading New Property Data for:" + row9.PROP_NAME + " *****"); row14.PROP_NAME = row9.PROP_NAME; row14.PRICE = row9.PRICE; row14.SQFT = row9.SQFT; row14.DESCRIPTION = row9.DESCRIPTION; row14.NUM_BEDS = row9.NUM_BEDS; row14.NUM_BATHS = row9.NUM_BATHS; row14.TYPE = row9.TYPE; row14.STATUS = row9.STATUS; row14.STATE_INFO_ID = row9.STATE_INFO_ID; row14.DATA_SOURCE_ID = row9.DATA_SOURCE_ID; row14.PROP_UUID = UUID.randomUUID().toString(); nb_line_tJavaRow_3++; tos_count_tJavaRow_3++; /** * [tJavaRow_3 main ] stop */ /** * [tMap_8 main ] start */ currentComponent = "tMap_8"; boolean hasCasePrimitiveKeyWithNull_tMap_8 = false; // ############################### // # Input tables (lookups) boolean rejectedInnerJoin_tMap_8 = false; boolean mainRowRejected_tMap_8 = false; // ############################### { // start of Var scope // ############################### // # Vars tables Var__tMap_8__Struct Var = Var__tMap_8;// ############################### // ############################### // # Output tables mainPropertyDataLoad = null; // # Output table : // 'mainPropertyDataLoad' mainPropertyDataLoad_tmp.ID = 0; mainPropertyDataLoad_tmp.UUID = row14.PROP_UUID; mainPropertyDataLoad_tmp.PROP_NAME = row14.PROP_NAME; mainPropertyDataLoad_tmp.PRICE = row14.PRICE; mainPropertyDataLoad_tmp.SQFT = row14.SQFT; mainPropertyDataLoad_tmp.DESCRIPTION = row14.DESCRIPTION; mainPropertyDataLoad_tmp.NUM_BEDS = row14.NUM_BEDS; mainPropertyDataLoad_tmp.NUM_BATHS = row14.NUM_BATHS; mainPropertyDataLoad_tmp.TYPE = row14.TYPE; mainPropertyDataLoad_tmp.STATUS = row14.STATUS; mainPropertyDataLoad_tmp.STATE_INFO_ID = row14.STATE_INFO_ID; mainPropertyDataLoad_tmp.DATA_SOURCE_ID = row14.DATA_SOURCE_ID; mainPropertyDataLoad = mainPropertyDataLoad_tmp; // ############################### } // end of Var scope rejectedInnerJoin_tMap_8 = false; tos_count_tMap_8++; /** * [tMap_8 main ] stop */ // Start of branch // "mainPropertyDataLoad" if (mainPropertyDataLoad != null) { /** * [tMysqlOutput_1 main ] start */ currentComponent = "tMysqlOutput_1"; whetherReject_tMysqlOutput_1 = false; pstmt_tMysqlOutput_1.setInt(1, mainPropertyDataLoad.ID); if (mainPropertyDataLoad.UUID == null) { pstmt_tMysqlOutput_1.setNull(2, java.sql.Types.VARCHAR); } else { pstmt_tMysqlOutput_1.setString(2, mainPropertyDataLoad.UUID); } if (mainPropertyDataLoad.PROP_NAME == null) { pstmt_tMysqlOutput_1.setNull(3, java.sql.Types.VARCHAR); } else { pstmt_tMysqlOutput_1.setString(3, mainPropertyDataLoad.PROP_NAME); } pstmt_tMysqlOutput_1.setFloat(4, mainPropertyDataLoad.PRICE); if (mainPropertyDataLoad.SQFT == null) { pstmt_tMysqlOutput_1.setNull(5, java.sql.Types.VARCHAR); } else { pstmt_tMysqlOutput_1.setString(5, mainPropertyDataLoad.SQFT); } if (mainPropertyDataLoad.DESCRIPTION == null) { pstmt_tMysqlOutput_1.setNull(6, java.sql.Types.VARCHAR); } else { pstmt_tMysqlOutput_1.setString(6, mainPropertyDataLoad.DESCRIPTION); } pstmt_tMysqlOutput_1.setFloat(7, mainPropertyDataLoad.NUM_BEDS); pstmt_tMysqlOutput_1.setFloat(8, mainPropertyDataLoad.NUM_BATHS); if (mainPropertyDataLoad.TYPE == null) { pstmt_tMysqlOutput_1.setNull(9, java.sql.Types.VARCHAR); } else { pstmt_tMysqlOutput_1.setString(9, mainPropertyDataLoad.TYPE); } if (mainPropertyDataLoad.STATUS == null) { pstmt_tMysqlOutput_1.setNull(10, java.sql.Types.VARCHAR); } else { pstmt_tMysqlOutput_1.setString(10, mainPropertyDataLoad.STATUS); } pstmt_tMysqlOutput_1.setInt(11, mainPropertyDataLoad.STATE_INFO_ID); pstmt_tMysqlOutput_1.setInt(12, mainPropertyDataLoad.DATA_SOURCE_ID); pstmt_tMysqlOutput_1.addBatch(); nb_line_tMysqlOutput_1++; batchSizeCounter_tMysqlOutput_1++; if (batchSize_tMysqlOutput_1 <= batchSizeCounter_tMysqlOutput_1) { try { int countSum_tMysqlOutput_1 = 0; for (int countEach_tMysqlOutput_1 : pstmt_tMysqlOutput_1 .executeBatch()) { countSum_tMysqlOutput_1 += (countEach_tMysqlOutput_1 < 0 ? 0 : countEach_tMysqlOutput_1); } insertedCount_tMysqlOutput_1 += countSum_tMysqlOutput_1; } catch (java.sql.BatchUpdateException e) { int countSum_tMysqlOutput_1 = 0; for (int countEach_tMysqlOutput_1 : e.getUpdateCounts()) { countSum_tMysqlOutput_1 += (countEach_tMysqlOutput_1 < 0 ? 0 : countEach_tMysqlOutput_1); } insertedCount_tMysqlOutput_1 += countSum_tMysqlOutput_1; System.err.println(e.getMessage()); } batchSizeCounter_tMysqlOutput_1 = 0; } commitCounter_tMysqlOutput_1++; if (commitEvery_tMysqlOutput_1 <= commitCounter_tMysqlOutput_1) { try { int countSum_tMysqlOutput_1 = 0; for (int countEach_tMysqlOutput_1 : pstmt_tMysqlOutput_1 .executeBatch()) { countSum_tMysqlOutput_1 += (countEach_tMysqlOutput_1 < 0 ? 0 : countEach_tMysqlOutput_1); } insertedCount_tMysqlOutput_1 += countSum_tMysqlOutput_1; } catch (java.sql.BatchUpdateException e) { int countSum_tMysqlOutput_1 = 0; for (int countEach_tMysqlOutput_1 : e.getUpdateCounts()) { countSum_tMysqlOutput_1 += (countEach_tMysqlOutput_1 < 0 ? 0 : countEach_tMysqlOutput_1); } insertedCount_tMysqlOutput_1 += countSum_tMysqlOutput_1; System.out.println(e.getMessage()); } conn_tMysqlOutput_1.commit(); commitCounter_tMysqlOutput_1 = 0; } tos_count_tMysqlOutput_1++; /** * [tMysqlOutput_1 main ] stop */ } // End of branch // "mainPropertyDataLoad" } // End of branch "row9" } // End of branch "loadData" } // End of branch "mappedData" } // End of branch "propertyData" } // End of branch "row1" /** * [tFileInputXML_1 end ] start */ currentComponent = "tFileInputXML_1"; } try { looper_tFileInputXML_1.handleTaskResponse(); } catch (Exception e) { System.err.println(e.getMessage()); } globalMap.put("tFileInputXML_1_NB_LINE", nb_line_tFileInputXML_1); ok_Hash.put("tFileInputXML_1", true); end_Hash.put("tFileInputXML_1", System.currentTimeMillis()); /** * [tFileInputXML_1 end ] stop */ /** * [tMap_2 end ] start */ currentComponent = "tMap_2"; // ############################### // # Lookup hashes releasing // ############################### ok_Hash.put("tMap_2", true); end_Hash.put("tMap_2", System.currentTimeMillis()); /** * [tMap_2 end ] stop */ /** * [tMap_1 end ] start */ currentComponent = "tMap_1"; // ############################### // # Lookup hashes releasing if (tHash_Lookup_row6 != null) { tHash_Lookup_row6.endGet(); } globalMap.remove("tHash_Lookup_row6"); tHash_Lookup_Cache_row6.endGet(); tHash_Lookup_Cache_row6 = null; tHash_Lookup_Real_row6 = null; // ############################### ok_Hash.put("tMap_1", true); end_Hash.put("tMap_1", System.currentTimeMillis()); /** * [tMap_1 end ] stop */ /** * [tMap_4 end ] start */ currentComponent = "tMap_4"; // ############################### // # Lookup hashes releasing if (tHash_Lookup_custData != null) { tHash_Lookup_custData.endGet(); } globalMap.remove("tHash_Lookup_custData"); // ############################### ok_Hash.put("tMap_4", true); end_Hash.put("tMap_4", System.currentTimeMillis()); /** * [tMap_4 end ] stop */ /** * [tJoin_3 end ] start */ currentComponent = "tJoin_3"; ok_Hash.put("tJoin_3", true); end_Hash.put("tJoin_3", System.currentTimeMillis()); /** * [tJoin_3 end ] stop */ /** * [tJavaRow_3 end ] start */ currentComponent = "tJavaRow_3"; globalMap.put("tJavaRow_3_NB_LINE", nb_line_tJavaRow_3); ok_Hash.put("tJavaRow_3", true); end_Hash.put("tJavaRow_3", System.currentTimeMillis()); /** * [tJavaRow_3 end ] stop */ /** * [tMap_8 end ] start */ currentComponent = "tMap_8"; // ############################### // # Lookup hashes releasing // ############################### ok_Hash.put("tMap_8", true); end_Hash.put("tMap_8", System.currentTimeMillis()); /** * [tMap_8 end ] stop */ /** * [tMysqlOutput_1 end ] start */ currentComponent = "tMysqlOutput_1"; try { if (batchSizeCounter_tMysqlOutput_1 != 0) { int countSum_tMysqlOutput_1 = 0; for (int countEach_tMysqlOutput_1 : pstmt_tMysqlOutput_1.executeBatch()) { countSum_tMysqlOutput_1 += (countEach_tMysqlOutput_1 < 0 ? 0 : countEach_tMysqlOutput_1); } insertedCount_tMysqlOutput_1 += countSum_tMysqlOutput_1; } } catch (java.sql.BatchUpdateException e) { int countSum_tMysqlOutput_1 = 0; for (int countEach_tMysqlOutput_1 : e.getUpdateCounts()) { countSum_tMysqlOutput_1 += (countEach_tMysqlOutput_1 < 0 ? 0 : countEach_tMysqlOutput_1); } insertedCount_tMysqlOutput_1 += countSum_tMysqlOutput_1; System.err.println(e.getMessage()); } batchSizeCounter_tMysqlOutput_1 = 0; try { if (pstmt_tMysqlOutput_1 != null) { int countSum_tMysqlOutput_1 = 0; for (int countEach_tMysqlOutput_1 : pstmt_tMysqlOutput_1.executeBatch()) { countSum_tMysqlOutput_1 += (countEach_tMysqlOutput_1 < 0 ? 0 : countEach_tMysqlOutput_1); } insertedCount_tMysqlOutput_1 += countSum_tMysqlOutput_1; } } catch (java.sql.BatchUpdateException e) { int countSum_tMysqlOutput_1 = 0; for (int countEach_tMysqlOutput_1 : e.getUpdateCounts()) { countSum_tMysqlOutput_1 += (countEach_tMysqlOutput_1 < 0 ? 0 : countEach_tMysqlOutput_1); } insertedCount_tMysqlOutput_1 += countSum_tMysqlOutput_1; System.out.println(e.getMessage()); } if (pstmt_tMysqlOutput_1 != null) { pstmt_tMysqlOutput_1.close(); } conn_tMysqlOutput_1.commit(); conn_tMysqlOutput_1.close(); nb_line_deleted_tMysqlOutput_1 = nb_line_deleted_tMysqlOutput_1 + deletedCount_tMysqlOutput_1; nb_line_update_tMysqlOutput_1 = nb_line_update_tMysqlOutput_1 + updatedCount_tMysqlOutput_1; nb_line_inserted_tMysqlOutput_1 = nb_line_inserted_tMysqlOutput_1 + insertedCount_tMysqlOutput_1; nb_line_rejected_tMysqlOutput_1 = nb_line_rejected_tMysqlOutput_1 + rejectedCount_tMysqlOutput_1; globalMap.put("tMysqlOutput_1_NB_LINE", nb_line_tMysqlOutput_1); globalMap.put("tMysqlOutput_1_NB_LINE_UPDATED", nb_line_update_tMysqlOutput_1); globalMap.put("tMysqlOutput_1_NB_LINE_INSERTED", nb_line_inserted_tMysqlOutput_1); globalMap.put("tMysqlOutput_1_NB_LINE_DELETED", nb_line_deleted_tMysqlOutput_1); globalMap.put("tMysqlOutput_1_NB_LINE_REJECTED", nb_line_rejected_tMysqlOutput_1); ok_Hash.put("tMysqlOutput_1", true); end_Hash.put("tMysqlOutput_1", System.currentTimeMillis()); /** * [tMysqlOutput_1 end ] stop */ /** * [tFlowToIterate_1 end ] start */ currentComponent = "tFlowToIterate_1"; globalMap.put("tFlowToIterate_1_NB_LINE", nb_line_tFlowToIterate_1); ok_Hash.put("tFlowToIterate_1", true); end_Hash.put("tFlowToIterate_1", System.currentTimeMillis()); /** * [tFlowToIterate_1 end ] stop */ } // end the resume if (resumeEntryMethodName == null || globalResumeTicket) { resumeUtil.addLog("CHECKPOINT", "CONNECTION:SUBJOB_OK:tFileInputXML_1:OnSubjobOk", "", Thread.currentThread().getId() + "", "", "", "", "", ""); } tJava_1Process(globalMap); } catch (Exception e) { throw new TalendException(e, currentComponent, globalMap); } catch (java.lang.Error error) { throw new java.lang.Error(error); } finally { // free memory for "tJoin_3" globalMap.put("tHash_getCurrentProperties", null); // free memory for "tMap_4" globalMap.put("tHash_Lookup_custData", null); // free memory for "tMap_1" globalMap.put("tHash_Lookup_row6", null); // free memory for "tJoin_1" globalMap.put("tHash_row4", null); } globalMap.put("tFileInputXML_1_SUBPROCESS_STATE", 1); }
From source file:talonetl.getproperties_0_3.getProperties.java
public void tFileInputXML_1Process(final java.util.Map<String, Object> globalMap) throws TalendException { globalMap.put("tFileInputXML_1_SUBPROCESS_STATE", 0); final boolean execStat = this.execStat; String iterateId = ""; int iterateLoop = 0; String currentComponent = ""; try {/*from w w w . j a v a2 s . c om*/ String currentMethodName = new Exception().getStackTrace()[0].getMethodName(); boolean resumeIt = currentMethodName.equals(resumeEntryMethodName); if (resumeEntryMethodName == null || resumeIt || globalResumeTicket) {// start // the // resume globalResumeTicket = true; tMysqlInput_1Process(globalMap); tMysqlInput_5Process(globalMap); tMysqlInput_3Process(globalMap); row1Struct row1 = new row1Struct(); stateInfoStruct stateInfo = new stateInfoStruct(); row2Struct row2 = new row2Struct(); row3Struct row3 = new row3Struct(); row5Struct row5 = new row5Struct(); loadNewStateInfoStruct loadNewStateInfo = new loadNewStateInfoStruct(); propertyDataStruct propertyData = new propertyDataStruct(); mappedDataStruct mappedData = new mappedDataStruct(); loadDataStruct loadData = new loadDataStruct(); row9Struct row9 = new row9Struct(); row14Struct row14 = new row14Struct(); mainPropertyDataLoadStruct mainPropertyDataLoad = new mainPropertyDataLoadStruct(); /** * [tFlowToIterate_1 begin ] start */ int NB_ITERATE_tFileInputJSON_1 = 0; // for statistics ok_Hash.put("tFlowToIterate_1", false); start_Hash.put("tFlowToIterate_1", System.currentTimeMillis()); currentComponent = "tFlowToIterate_1"; int tos_count_tFlowToIterate_1 = 0; int nb_line_tFlowToIterate_1 = 0; int counter_tFlowToIterate_1 = 0; /** * [tFlowToIterate_1 begin ] stop */ /** * [tMysqlOutput_1 begin ] start */ ok_Hash.put("tMysqlOutput_1", false); start_Hash.put("tMysqlOutput_1", System.currentTimeMillis()); currentComponent = "tMysqlOutput_1"; int tos_count_tMysqlOutput_1 = 0; int nb_line_tMysqlOutput_1 = 0; int nb_line_update_tMysqlOutput_1 = 0; int nb_line_inserted_tMysqlOutput_1 = 0; int nb_line_deleted_tMysqlOutput_1 = 0; int nb_line_rejected_tMysqlOutput_1 = 0; int deletedCount_tMysqlOutput_1 = 0; int updatedCount_tMysqlOutput_1 = 0; int insertedCount_tMysqlOutput_1 = 0; int rejectedCount_tMysqlOutput_1 = 0; String tableName_tMysqlOutput_1 = "PROPERTY_DATA"; boolean whetherReject_tMysqlOutput_1 = false; java.util.Calendar calendar_tMysqlOutput_1 = java.util.Calendar.getInstance(); calendar_tMysqlOutput_1.set(1, 0, 1, 0, 0, 0); long year1_tMysqlOutput_1 = calendar_tMysqlOutput_1.getTime().getTime(); calendar_tMysqlOutput_1.set(10000, 0, 1, 0, 0, 0); long year10000_tMysqlOutput_1 = calendar_tMysqlOutput_1.getTime().getTime(); long date_tMysqlOutput_1; java.sql.Connection conn_tMysqlOutput_1 = null; java.util.Map<String, routines.system.TalendDataSource> dataSources_tMysqlOutput_1 = (java.util.Map<String, routines.system.TalendDataSource>) globalMap .get(KEY_DB_DATASOURCES); if (null != dataSources_tMysqlOutput_1) { conn_tMysqlOutput_1 = dataSources_tMysqlOutput_1.get("").getConnection(); } else { String dbProperties_tMysqlOutput_1 = "noDatetimeStringSync=true"; String url_tMysqlOutput_1 = null; if (dbProperties_tMysqlOutput_1 == null || dbProperties_tMysqlOutput_1.trim().length() == 0) { url_tMysqlOutput_1 = "jdbc:mysql://" + "192.168.1.254" + ":" + "3306" + "/" + "TALONDB" + "?" + "rewriteBatchedStatements=true"; } else { String properties_tMysqlOutput_1 = "noDatetimeStringSync=true"; if (!properties_tMysqlOutput_1.contains("rewriteBatchedStatements")) { properties_tMysqlOutput_1 += "&rewriteBatchedStatements=true"; } url_tMysqlOutput_1 = "jdbc:mysql://" + "192.168.1.254" + ":" + "3306" + "/" + "TALONDB" + "?" + properties_tMysqlOutput_1; } String dbUser_tMysqlOutput_1 = "dbAdmin"; String dbPwd_tMysqlOutput_1 = "1nn0s2013"; java.lang.Class.forName("org.gjt.mm.mysql.Driver"); conn_tMysqlOutput_1 = java.sql.DriverManager.getConnection(url_tMysqlOutput_1, dbUser_tMysqlOutput_1, dbPwd_tMysqlOutput_1); } conn_tMysqlOutput_1.setAutoCommit(false); int commitEvery_tMysqlOutput_1 = 10000; int commitCounter_tMysqlOutput_1 = 0; int count_tMysqlOutput_1 = 0; String insert_tMysqlOutput_1 = "INSERT INTO `" + "PROPERTY_DATA" + "` (`ID`,`UUID`,`PROP_NAME`,`PRICE`,`SQFT`,`DESCRIPTION`,`NUM_BEDS`,`NUM_BATHS`,`TYPE`,`STATUS`,`STATE_INFO_ID`,`DATA_SOURCE_ID`) VALUES (?,?,?,?,?,?,?,?,?,?,?,?)"; int batchSize_tMysqlOutput_1 = 100; int batchSizeCounter_tMysqlOutput_1 = 0; java.sql.PreparedStatement pstmt_tMysqlOutput_1 = conn_tMysqlOutput_1 .prepareStatement(insert_tMysqlOutput_1); /** * [tMysqlOutput_1 begin ] stop */ /** * [tMap_8 begin ] start */ ok_Hash.put("tMap_8", false); start_Hash.put("tMap_8", System.currentTimeMillis()); currentComponent = "tMap_8"; int tos_count_tMap_8 = 0; // ############################### // # Lookup's keys initialization // ############################### // ############################### // # Vars initialization class Var__tMap_8__Struct { } Var__tMap_8__Struct Var__tMap_8 = new Var__tMap_8__Struct(); // ############################### // ############################### // # Outputs initialization mainPropertyDataLoadStruct mainPropertyDataLoad_tmp = new mainPropertyDataLoadStruct(); // ############################### /** * [tMap_8 begin ] stop */ /** * [tJavaRow_3 begin ] start */ ok_Hash.put("tJavaRow_3", false); start_Hash.put("tJavaRow_3", System.currentTimeMillis()); currentComponent = "tJavaRow_3"; int tos_count_tJavaRow_3 = 0; int nb_line_tJavaRow_3 = 0; /** * [tJavaRow_3 begin ] stop */ /** * [tJoin_3 begin ] start */ ok_Hash.put("tJoin_3", false); start_Hash.put("tJoin_3", System.currentTimeMillis()); currentComponent = "tJoin_3"; int tos_count_tJoin_3 = 0; final java.util.Map<getCurrentPropertiesStruct, getCurrentPropertiesStruct> tHash_tJoin_3 = (java.util.Map<getCurrentPropertiesStruct, getCurrentPropertiesStruct>) globalMap .get("tHash_getCurrentProperties"); class Util_tJoin_3 { getCurrentPropertiesStruct lookupValue = null; getCurrentPropertiesStruct getCurrentPropertiesHashKey = new getCurrentPropertiesStruct(); public boolean isJoined(loadDataStruct mainRow) { getCurrentPropertiesHashKey.PROP_NAME = mainRow.PROP_NAME; getCurrentPropertiesHashKey.hashCodeDirty = true; lookupValue = tHash_tJoin_3.get(getCurrentPropertiesHashKey); if (lookupValue != null) { return true; } return false; } } Util_tJoin_3 util_tJoin_3 = new Util_tJoin_3(); int nb_line_tJoin_3 = 0; /** * [tJoin_3 begin ] stop */ /** * [tMap_4 begin ] start */ ok_Hash.put("tMap_4", false); start_Hash.put("tMap_4", System.currentTimeMillis()); currentComponent = "tMap_4"; int tos_count_tMap_4 = 0; // ############################### // # Lookup's keys initialization org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<custDataStruct> tHash_Lookup_custData = (org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<custDataStruct>) ((org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<custDataStruct>) globalMap .get("tHash_Lookup_custData")); custDataStruct custDataHashKey = new custDataStruct(); custDataStruct custDataDefault = new custDataStruct(); // ############################### // ############################### // # Vars initialization class Var__tMap_4__Struct { } Var__tMap_4__Struct Var__tMap_4 = new Var__tMap_4__Struct(); // ############################### // ############################### // # Outputs initialization loadDataStruct loadData_tmp = new loadDataStruct(); // ############################### /** * [tMap_4 begin ] stop */ /** * [tMap_1 begin ] start */ ok_Hash.put("tMap_1", false); start_Hash.put("tMap_1", System.currentTimeMillis()); currentComponent = "tMap_1"; int tos_count_tMap_1 = 0; // ############################### // # Lookup's keys initialization org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row6Struct> tHash_Lookup_row6 = null; org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row6Struct> tHash_Lookup_Cache_row6 = org.talend.designer.components.lookup.memory.AdvancedMemoryLookup .<row6Struct>getLookup( org.talend.designer.components.lookup.common.ICommonLookup.MATCHING_MODE.UNIQUE_MATCH); org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row6Struct> tHash_Lookup_Real_row6 = null; row6Struct row6HashKey = new row6Struct(); row6Struct row6Default = new row6Struct(); // ############################### // ############################### // # Vars initialization class Var__tMap_1__Struct { } Var__tMap_1__Struct Var__tMap_1 = new Var__tMap_1__Struct(); // ############################### // ############################### // # Outputs initialization mappedDataStruct mappedData_tmp = new mappedDataStruct(); // ############################### /** * [tMap_1 begin ] stop */ /** * [tMap_2 begin ] start */ ok_Hash.put("tMap_2", false); start_Hash.put("tMap_2", System.currentTimeMillis()); currentComponent = "tMap_2"; int tos_count_tMap_2 = 0; // ############################### // # Lookup's keys initialization // ############################### // ############################### // # Vars initialization class Var__tMap_2__Struct { } Var__tMap_2__Struct Var__tMap_2 = new Var__tMap_2__Struct(); // ############################### // ############################### // # Outputs initialization stateInfoStruct stateInfo_tmp = new stateInfoStruct(); propertyDataStruct propertyData_tmp = new propertyDataStruct(); // ############################### /** * [tMap_2 begin ] stop */ /** * [tFileInputXML_1 begin ] start */ ok_Hash.put("tFileInputXML_1", false); start_Hash.put("tFileInputXML_1", System.currentTimeMillis()); currentComponent = "tFileInputXML_1"; int tos_count_tFileInputXML_1 = 0; int nb_line_tFileInputXML_1 = 0; String os_tFileInputXML_1 = System.getProperty("os.name").toLowerCase(); boolean isWindows_tFileInputXML_1 = false; if (os_tFileInputXML_1.indexOf("windows") > -1 || os_tFileInputXML_1.indexOf("nt") > -1) { isWindows_tFileInputXML_1 = true; } class XML_API_tFileInputXML_1 { public boolean isDefNull(String[] node) throws javax.xml.transform.TransformerException { if (node[0] != null && node[1] != null && ("true").equals(node[1])) { return true; } return false; } public boolean isMissing(String[] node) throws javax.xml.transform.TransformerException { return node[0] == null ? true : false; } public boolean isEmpty(String[] node) throws javax.xml.transform.TransformerException { if (node[0] != null) { return node[0].length() == 0; } return false; } } XML_API_tFileInputXML_1 xml_api_tFileInputXML_1 = new XML_API_tFileInputXML_1(); String[] queryPaths_tFileInputXML_1 = new String[] { "name", "name" + "/@xsi:nil", "../media/images/image/url", "../media/images/image/url" + "/@xsi:nil", "../media/images/image/title", "../media/images/image/title" + "/@xsi:nil", "pba__propertytype__c", "pba__propertytype__c" + "/@xsi:nil", "rented_status__c", "rented_status__c" + "/@xsi:nil", "zipcode__c", "zipcode__c" + "/@xsi:nil", "pba__city_pb__c", "pba__city_pb__c" + "/@xsi:nil", "pba__description_pb__c", "pba__description_pb__c" + "/@xsi:nil", "term_2__c", "term_2__c" + "/@xsi:nil", "term_1__c", "term_1__c" + "/@xsi:nil", "pba__status__c", "pba__status__c" + "/@xsi:nil", "year_built__c", "year_built__c" + "/@xsi:nil", "pba__address_pb__c", "pba__address_pb__c" + "/@xsi:nil", "financed_net_yield_1__c", "financed_net_yield_1__c" + "/@xsi:nil", "monthly_cash_flow_with_financing_2__c", "monthly_cash_flow_with_financing_2__c" + "/@xsi:nil", "financed_net_yield_2__c", "financed_net_yield_2__c" + "/@xsi:nil", "monthly_cash_flow_with_financing_1__c", "monthly_cash_flow_with_financing_1__c" + "/@xsi:nil", "interest_rate_2__c", "interest_rate_2__c" + "/@xsi:nil", "interest_rate_1__c", "interest_rate_1__c" + "/@xsi:nil", "monthly_cash_flow__c", "monthly_cash_flow__c" + "/@xsi:nil", "noi__c", "noi__c" + "/@xsi:nil", "noi_with_financing_2__c", "noi_with_financing_2__c" + "/@xsi:nil", "noi_with_financing_1__c", "noi_with_financing_1__c" + "/@xsi:nil", "price_per_ft__c", "price_per_ft__c" + "/@xsi:nil", "price__c", "price__c" + "/@xsi:nil", "yearly_interest_payment_1__c", "yearly_interest_payment_1__c" + "/@xsi:nil", "monthly_interest_payment_2__c", "monthly_interest_payment_2__c" + "/@xsi:nil", "interest_payment_1__c", "interest_payment_1__c" + "/@xsi:nil", "down_payment_2__c", "down_payment_2__c" + "/@xsi:nil", "down_payment_1__c", "down_payment_1__c" + "/@xsi:nil", "cash_net_yield__c", "cash_net_yield__c" + "/@xsi:nil", "monthly_management__c", "monthly_management__c" + "/@xsi:nil", "management__c", "management__c" + "/@xsi:nil", "monthly_insurance__c", "monthly_insurance__c" + "/@xsi:nil", "insurance__c", "insurance__c" + "/@xsi:nil", "taxes__c", "taxes__c" + "/@xsi:nil", "monthly_taxes__c", "monthly_taxes__c" + "/@xsi:nil", "monthlyrent__c", "monthlyrent__c" + "/@xsi:nil", "annual_rents__c", "annual_rents__c" + "/@xsi:nil", "est_of_market_value__c", "est_of_market_value__c" + "/@xsi:nil", "est_value_per_rent_multiplier__c", "est_value_per_rent_multiplier__c" + "/@xsi:nil", "estimated_value__c", "estimated_value__c" + "/@xsi:nil", "est_replacement_cost_per_sq_ft__c", "est_replacement_cost_per_sq_ft__c" + "/@xsi:nil", "est_replacement_cost__c", "est_replacement_cost__c" + "/@xsi:nil", "pba__totalarea_pb__c", "pba__totalarea_pb__c" + "/@xsi:nil", "bedrooms__c", "bedrooms__c" + "/@xsi:nil", "bathrooms__c", "bathrooms__c" + "/@xsi:nil" }; boolean[] asXMLs_tFileInputXML_1 = new boolean[] { false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false }; String str_tFileInputXML_1 = ""; String[] node_tFileInputXML_1 = null; org.talend.xml.sax.SAXLooper looper_tFileInputXML_1 = new org.talend.xml.sax.SAXLooper( "/result/listings/listing/data", queryPaths_tFileInputXML_1, asXMLs_tFileInputXML_1); looper_tFileInputXML_1.setEncoding("UTF-8"); Object filename_tFileInputXML_1 = null; try { filename_tFileInputXML_1 = ((java.io.InputStream) globalMap.get("tFileFetch_1_INPUT_STREAM")); } catch (Exception e) { System.err.println(e.getMessage()); } if (filename_tFileInputXML_1 != null && filename_tFileInputXML_1 instanceof String && filename_tFileInputXML_1.toString().startsWith("//")) { if (!isWindows_tFileInputXML_1) { filename_tFileInputXML_1 = filename_tFileInputXML_1.toString().replaceFirst("//", "/"); } } if (filename_tFileInputXML_1 instanceof java.io.InputStream) { looper_tFileInputXML_1.parse((java.io.InputStream) filename_tFileInputXML_1); } else { looper_tFileInputXML_1.parse(String.valueOf(filename_tFileInputXML_1)); } java.util.Iterator<java.util.Map<String, String>> it_tFileInputXML_1 = looper_tFileInputXML_1 .iterator(); while (it_tFileInputXML_1.hasNext()) { java.util.Map<String, String> row_tFileInputXML_1 = it_tFileInputXML_1.next(); nb_line_tFileInputXML_1++; row1 = null; boolean whetherReject_tFileInputXML_1 = false; row1 = new row1Struct(); try { str_tFileInputXML_1 = row_tFileInputXML_1.get("name"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("name" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.name = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1)) { row1.name = ""; } else if (xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.name = null; } else { row1.name = str_tFileInputXML_1; } str_tFileInputXML_1 = row_tFileInputXML_1.get("../media/images/image/url"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("../media/images/image/url" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.image_url = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1)) { row1.image_url = ""; } else if (xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.image_url = null; } else { row1.image_url = str_tFileInputXML_1; } str_tFileInputXML_1 = row_tFileInputXML_1.get("../media/images/image/title"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("../media/images/image/title" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.image_title = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1)) { row1.image_title = ""; } else if (xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.image_title = null; } else { row1.image_title = str_tFileInputXML_1; } str_tFileInputXML_1 = row_tFileInputXML_1.get("pba__propertytype__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("pba__propertytype__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.pba__propertytype__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1)) { row1.pba__propertytype__c = ""; } else if (xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.pba__propertytype__c = null; } else { row1.pba__propertytype__c = str_tFileInputXML_1; } str_tFileInputXML_1 = row_tFileInputXML_1.get("rented_status__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("rented_status__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.rented_status__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1)) { row1.rented_status__c = ""; } else if (xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.rented_status__c = null; } else { row1.rented_status__c = str_tFileInputXML_1; } str_tFileInputXML_1 = row_tFileInputXML_1.get("zipcode__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("zipcode__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.zipcode__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.zipcode__c = null; } else { row1.zipcode__c = ParserUtils.parseTo_Integer(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("pba__city_pb__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("pba__city_pb__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.pba__city_pb__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1)) { row1.pba__city_pb__c = ""; } else if (xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.pba__city_pb__c = null; } else { row1.pba__city_pb__c = str_tFileInputXML_1; } str_tFileInputXML_1 = row_tFileInputXML_1.get("pba__description_pb__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("pba__description_pb__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.pba__description_pb__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1)) { row1.pba__description_pb__c = ""; } else if (xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.pba__description_pb__c = null; } else { row1.pba__description_pb__c = str_tFileInputXML_1; } str_tFileInputXML_1 = row_tFileInputXML_1.get("term_2__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("term_2__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.term_2__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1)) { row1.term_2__c = ""; } else if (xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.term_2__c = null; } else { row1.term_2__c = str_tFileInputXML_1; } str_tFileInputXML_1 = row_tFileInputXML_1.get("term_1__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("term_1__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.term_1__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1)) { row1.term_1__c = ""; } else if (xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.term_1__c = null; } else { row1.term_1__c = str_tFileInputXML_1; } str_tFileInputXML_1 = row_tFileInputXML_1.get("pba__status__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("pba__status__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.pba__status__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1)) { row1.pba__status__c = ""; } else if (xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.pba__status__c = null; } else { row1.pba__status__c = str_tFileInputXML_1; } str_tFileInputXML_1 = row_tFileInputXML_1.get("year_built__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("year_built__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.year_built__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.year_built__c = null; } else { row1.year_built__c = ParserUtils.parseTo_Integer(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("pba__address_pb__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("pba__address_pb__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.pba__address_pb__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1)) { row1.pba__address_pb__c = ""; } else if (xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.pba__address_pb__c = null; } else { row1.pba__address_pb__c = str_tFileInputXML_1; } str_tFileInputXML_1 = row_tFileInputXML_1.get("financed_net_yield_1__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("financed_net_yield_1__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.financed_net_yield_1__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.financed_net_yield_1__c = null; } else { row1.financed_net_yield_1__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("monthly_cash_flow_with_financing_2__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("monthly_cash_flow_with_financing_2__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.monthly_cash_flow_with_financing_2__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.monthly_cash_flow_with_financing_2__c = null; } else { row1.monthly_cash_flow_with_financing_2__c = ParserUtils .parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("financed_net_yield_2__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("financed_net_yield_2__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.financed_net_yield_2__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.financed_net_yield_2__c = null; } else { row1.financed_net_yield_2__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("monthly_cash_flow_with_financing_1__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("monthly_cash_flow_with_financing_1__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.monthly_cash_flow_with_financing_1__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.monthly_cash_flow_with_financing_1__c = null; } else { row1.monthly_cash_flow_with_financing_1__c = ParserUtils .parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("interest_rate_2__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("interest_rate_2__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.interest_rate_2__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.interest_rate_2__c = null; } else { row1.interest_rate_2__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("interest_rate_1__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("interest_rate_1__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.interest_rate_1__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.interest_rate_1__c = null; } else { row1.interest_rate_1__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("monthly_cash_flow__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("monthly_cash_flow__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.monthly_cash_flow__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.monthly_cash_flow__c = null; } else { row1.monthly_cash_flow__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("noi__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("noi__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.noi__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.noi__c = null; } else { row1.noi__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("noi_with_financing_2__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("noi_with_financing_2__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.noi_with_financing_2__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.noi_with_financing_2__c = null; } else { row1.noi_with_financing_2__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("noi_with_financing_1__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("noi_with_financing_1__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.noi_with_financing_1__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.noi_with_financing_1__c = null; } else { row1.noi_with_financing_1__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("price_per_ft__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("price_per_ft__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.price_per_ft__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.price_per_ft__c = null; } else { row1.price_per_ft__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("price__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("price__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.price__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.price__c = null; } else { row1.price__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("yearly_interest_payment_1__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("yearly_interest_payment_1__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.yearly_interest_payment_1__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.yearly_interest_payment_1__c = null; } else { row1.yearly_interest_payment_1__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("monthly_interest_payment_2__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("monthly_interest_payment_2__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.monthly_interest_payment_2__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.monthly_interest_payment_2__c = null; } else { row1.monthly_interest_payment_2__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("interest_payment_1__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("interest_payment_1__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.interest_payment_1__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.interest_payment_1__c = null; } else { row1.interest_payment_1__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("down_payment_2__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("down_payment_2__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.down_payment_2__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.down_payment_2__c = null; } else { row1.down_payment_2__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("down_payment_1__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("down_payment_1__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.down_payment_1__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.down_payment_1__c = null; } else { row1.down_payment_1__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("cash_net_yield__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("cash_net_yield__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.cash_net_yield__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.cash_net_yield__c = null; } else { row1.cash_net_yield__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("monthly_management__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("monthly_management__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.monthly_management__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.monthly_management__c = null; } else { row1.monthly_management__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("management__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("management__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.management__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.management__c = null; } else { row1.management__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("monthly_insurance__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("monthly_insurance__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.monthly_insurance__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.monthly_insurance__c = null; } else { row1.monthly_insurance__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("insurance__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("insurance__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.insurance__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.insurance__c = null; } else { row1.insurance__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("taxes__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("taxes__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.taxes__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.taxes__c = null; } else { row1.taxes__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("monthly_taxes__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("monthly_taxes__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.monthly_taxes__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.monthly_taxes__c = null; } else { row1.monthly_taxes__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("monthlyrent__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("monthlyrent__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.monthlyrent__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.monthlyrent__c = null; } else { row1.monthlyrent__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("annual_rents__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("annual_rents__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.annual_rents__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.annual_rents__c = null; } else { row1.annual_rents__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("est_of_market_value__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("est_of_market_value__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.est_of_market_value__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.est_of_market_value__c = null; } else { row1.est_of_market_value__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("est_value_per_rent_multiplier__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("est_value_per_rent_multiplier__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.est_value_per_rent_multiplier__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.est_value_per_rent_multiplier__c = null; } else { row1.est_value_per_rent_multiplier__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("estimated_value__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("estimated_value__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.estimated_value__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1)) { row1.estimated_value__c = ""; } else if (xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.estimated_value__c = null; } else { row1.estimated_value__c = str_tFileInputXML_1; } str_tFileInputXML_1 = row_tFileInputXML_1.get("est_replacement_cost_per_sq_ft__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("est_replacement_cost_per_sq_ft__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.est_replacement_cost_per_sq_ft__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.est_replacement_cost_per_sq_ft__c = null; } else { row1.est_replacement_cost_per_sq_ft__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("est_replacement_cost__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("est_replacement_cost__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.est_replacement_cost__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.est_replacement_cost__c = null; } else { row1.est_replacement_cost__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("pba__totalarea_pb__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("pba__totalarea_pb__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.pba__totalarea_pb__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.pba__totalarea_pb__c = null; } else { row1.pba__totalarea_pb__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("bedrooms__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("bedrooms__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.bedrooms__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.bedrooms__c = null; } else { row1.bedrooms__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("bathrooms__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("bathrooms__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.bathrooms__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.bathrooms__c = null; } else { row1.bathrooms__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } } catch (Exception e) { whetherReject_tFileInputXML_1 = true; System.err.println(e.getMessage()); row1 = null; } /** * [tFileInputXML_1 begin ] stop */ /** * [tFileInputXML_1 main ] start */ currentComponent = "tFileInputXML_1"; tos_count_tFileInputXML_1++; /** * [tFileInputXML_1 main ] stop */ // Start of branch "row1" if (row1 != null) { /** * [tMap_2 main ] start */ currentComponent = "tMap_2"; boolean hasCasePrimitiveKeyWithNull_tMap_2 = false; // ############################### // # Input tables (lookups) boolean rejectedInnerJoin_tMap_2 = false; boolean mainRowRejected_tMap_2 = false; // ############################### { // start of Var scope // ############################### // # Vars tables Var__tMap_2__Struct Var = Var__tMap_2;// ############################### // ############################### // # Output tables stateInfo = null; propertyData = null; // # Output table : 'stateInfo' stateInfo_tmp.zipcode__c = row1.zipcode__c; stateInfo_tmp.pba__city_pb__c = row1.pba__city_pb__c; stateInfo = stateInfo_tmp; // # Output table : 'propertyData' propertyData_tmp.name = row1.name; propertyData_tmp.image_url = row1.image_url; propertyData_tmp.image_title = row1.image_title; propertyData_tmp.pba__propertytype__c = row1.pba__propertytype__c; propertyData_tmp.rented_status__c = row1.rented_status__c; propertyData_tmp.zipcode__c = row1.zipcode__c; propertyData_tmp.pba__city_pb__c = row1.pba__city_pb__c; propertyData_tmp.pba__description_pb__c = row1.pba__description_pb__c; propertyData_tmp.term_2__c = row1.term_2__c; propertyData_tmp.term_1__c = row1.term_1__c; propertyData_tmp.pba__status__c = row1.pba__status__c; propertyData_tmp.year_built__c = row1.year_built__c; propertyData_tmp.pba__address_pb__c = row1.pba__address_pb__c; propertyData_tmp.financed_net_yield_1__c = row1.financed_net_yield_1__c; propertyData_tmp.monthly_cash_flow_with_financing_2__c = row1.monthly_cash_flow_with_financing_2__c; propertyData_tmp.financed_net_yield_2__c = row1.financed_net_yield_2__c; propertyData_tmp.monthly_cash_flow_with_financing_1__c = row1.monthly_cash_flow_with_financing_1__c; propertyData_tmp.interest_rate_2__c = row1.interest_rate_2__c; propertyData_tmp.interest_rate_1__c = row1.interest_rate_1__c; propertyData_tmp.monthly_cash_flow__c = row1.monthly_cash_flow__c; propertyData_tmp.noi__c = row1.noi__c; propertyData_tmp.noi_with_financing_2__c = row1.noi_with_financing_2__c; propertyData_tmp.noi_with_financing_1__c = row1.noi_with_financing_1__c; propertyData_tmp.price_per_ft__c = row1.price_per_ft__c; propertyData_tmp.price__c = row1.price__c; propertyData_tmp.yearly_interest_payment_1__c = row1.yearly_interest_payment_1__c; propertyData_tmp.monthly_interest_payment_2__c = row1.monthly_interest_payment_2__c; propertyData_tmp.interest_payment_1__c = row1.interest_payment_1__c; propertyData_tmp.down_payment_2__c = row1.down_payment_2__c; propertyData_tmp.down_payment_1__c = row1.down_payment_1__c; propertyData_tmp.cash_net_yield__c = row1.cash_net_yield__c; propertyData_tmp.monthly_management__c = row1.monthly_management__c; propertyData_tmp.management__c = row1.management__c; propertyData_tmp.monthly_insurance__c = row1.monthly_insurance__c; propertyData_tmp.insurance__c = row1.insurance__c; propertyData_tmp.taxes__c = row1.taxes__c; propertyData_tmp.monthly_taxes__c = row1.monthly_taxes__c; propertyData_tmp.monthlyrent__c = row1.monthlyrent__c; propertyData_tmp.annual_rents__c = row1.annual_rents__c; propertyData_tmp.est_of_market_value__c = row1.est_of_market_value__c; propertyData_tmp.est_value_per_rent_multiplier__c = row1.est_value_per_rent_multiplier__c; propertyData_tmp.estimated_value__c = row1.estimated_value__c; propertyData_tmp.est_replacement_cost_per_sq_ft__c = row1.est_replacement_cost_per_sq_ft__c; propertyData_tmp.est_replacement_cost__c = row1.est_replacement_cost__c; propertyData_tmp.pba__totalarea_pb__c = row1.pba__totalarea_pb__c; propertyData_tmp.bedrooms__c = row1.bedrooms__c; propertyData_tmp.bathrooms__c = row1.bathrooms__c; propertyData = propertyData_tmp; // ############################### } // end of Var scope rejectedInnerJoin_tMap_2 = false; tos_count_tMap_2++; /** * [tMap_2 main ] stop */ // Start of branch "stateInfo" if (stateInfo != null) { /** * [tFlowToIterate_1 main ] start */ currentComponent = "tFlowToIterate_1"; globalMap.put("zipCode", stateInfo.zipcode__c); nb_line_tFlowToIterate_1++; counter_tFlowToIterate_1++; globalMap.put("tFlowToIterate_1_CURRENT_ITERATION", counter_tFlowToIterate_1); tos_count_tFlowToIterate_1++; /** * [tFlowToIterate_1 main ] stop */ NB_ITERATE_tFileInputJSON_1++; iterateLoop++; /** * [tMysqlOutput_4 begin ] start */ ok_Hash.put("tMysqlOutput_4", false); start_Hash.put("tMysqlOutput_4", System.currentTimeMillis()); currentComponent = "tMysqlOutput_4"; int tos_count_tMysqlOutput_4 = 0; int nb_line_tMysqlOutput_4 = 0; int nb_line_update_tMysqlOutput_4 = 0; int nb_line_inserted_tMysqlOutput_4 = 0; int nb_line_deleted_tMysqlOutput_4 = 0; int nb_line_rejected_tMysqlOutput_4 = 0; int deletedCount_tMysqlOutput_4 = 0; int updatedCount_tMysqlOutput_4 = 0; int insertedCount_tMysqlOutput_4 = 0; int rejectedCount_tMysqlOutput_4 = 0; String tableName_tMysqlOutput_4 = "STATE_INFO"; boolean whetherReject_tMysqlOutput_4 = false; java.util.Calendar calendar_tMysqlOutput_4 = java.util.Calendar.getInstance(); calendar_tMysqlOutput_4.set(1, 0, 1, 0, 0, 0); long year1_tMysqlOutput_4 = calendar_tMysqlOutput_4.getTime().getTime(); calendar_tMysqlOutput_4.set(10000, 0, 1, 0, 0, 0); long year10000_tMysqlOutput_4 = calendar_tMysqlOutput_4.getTime().getTime(); long date_tMysqlOutput_4; java.sql.Connection conn_tMysqlOutput_4 = null; java.util.Map<String, routines.system.TalendDataSource> dataSources_tMysqlOutput_4 = (java.util.Map<String, routines.system.TalendDataSource>) globalMap .get(KEY_DB_DATASOURCES); if (null != dataSources_tMysqlOutput_4) { conn_tMysqlOutput_4 = dataSources_tMysqlOutput_4.get("").getConnection(); } else { String dbProperties_tMysqlOutput_4 = "noDatetimeStringSync=true"; String url_tMysqlOutput_4 = null; if (dbProperties_tMysqlOutput_4 == null || dbProperties_tMysqlOutput_4.trim().length() == 0) { url_tMysqlOutput_4 = "jdbc:mysql://" + "192.168.1.254" + ":" + "3306" + "/" + "TALONDB" + "?" + "rewriteBatchedStatements=true"; } else { String properties_tMysqlOutput_4 = "noDatetimeStringSync=true"; if (!properties_tMysqlOutput_4.contains("rewriteBatchedStatements")) { properties_tMysqlOutput_4 += "&rewriteBatchedStatements=true"; } url_tMysqlOutput_4 = "jdbc:mysql://" + "192.168.1.254" + ":" + "3306" + "/" + "TALONDB" + "?" + properties_tMysqlOutput_4; } String dbUser_tMysqlOutput_4 = "dbAdmin"; String dbPwd_tMysqlOutput_4 = "1nn0s2013"; java.lang.Class.forName("org.gjt.mm.mysql.Driver"); conn_tMysqlOutput_4 = java.sql.DriverManager.getConnection(url_tMysqlOutput_4, dbUser_tMysqlOutput_4, dbPwd_tMysqlOutput_4); } conn_tMysqlOutput_4.setAutoCommit(false); int commitEvery_tMysqlOutput_4 = 1; int commitCounter_tMysqlOutput_4 = 0; int count_tMysqlOutput_4 = 0; String insert_tMysqlOutput_4 = "INSERT INTO `" + "STATE_INFO" + "` (`ID`,`STATE`,`CITY`,`ZIP`) VALUES (?,?,?,?)"; int batchSize_tMysqlOutput_4 = 1; int batchSizeCounter_tMysqlOutput_4 = 0; java.sql.PreparedStatement pstmt_tMysqlOutput_4 = conn_tMysqlOutput_4 .prepareStatement(insert_tMysqlOutput_4); /** * [tMysqlOutput_4 begin ] stop */ /** * [tMap_3 begin ] start */ ok_Hash.put("tMap_3", false); start_Hash.put("tMap_3", System.currentTimeMillis()); currentComponent = "tMap_3"; int tos_count_tMap_3 = 0; // ############################### // # Lookup's keys initialization // ############################### // ############################### // # Vars initialization class Var__tMap_3__Struct { } Var__tMap_3__Struct Var__tMap_3 = new Var__tMap_3__Struct(); // ############################### // ############################### // # Outputs initialization loadNewStateInfoStruct loadNewStateInfo_tmp = new loadNewStateInfoStruct(); // ############################### /** * [tMap_3 begin ] stop */ /** * [tJoin_1 begin ] start */ ok_Hash.put("tJoin_1", false); start_Hash.put("tJoin_1", System.currentTimeMillis()); currentComponent = "tJoin_1"; int tos_count_tJoin_1 = 0; final java.util.Map<row4Struct, row4Struct> tHash_tJoin_1 = (java.util.Map<row4Struct, row4Struct>) globalMap .get("tHash_row4"); class Util_tJoin_1 { row4Struct lookupValue = null; row4Struct row4HashKey = new row4Struct(); public boolean isJoined(row3Struct mainRow) { row4HashKey.ZIP = mainRow.zip; row4HashKey.hashCodeDirty = true; lookupValue = tHash_tJoin_1.get(row4HashKey); if (lookupValue != null) { return true; } return false; } } Util_tJoin_1 util_tJoin_1 = new Util_tJoin_1(); int nb_line_tJoin_1 = 0; /** * [tJoin_1 begin ] stop */ /** * [tJavaRow_1 begin ] start */ ok_Hash.put("tJavaRow_1", false); start_Hash.put("tJavaRow_1", System.currentTimeMillis()); currentComponent = "tJavaRow_1"; int tos_count_tJavaRow_1 = 0; int nb_line_tJavaRow_1 = 0; /** * [tJavaRow_1 begin ] stop */ /** * [tFileInputJSON_1 begin ] start */ ok_Hash.put("tFileInputJSON_1", false); start_Hash.put("tFileInputJSON_1", System.currentTimeMillis()); currentComponent = "tFileInputJSON_1"; int tos_count_tFileInputJSON_1 = 0; class JSONUtil_tFileInputJSON_1 { public int getData(String query, javax.script.Invocable invocableEngine, java.util.List<org.json.simple.JSONArray> jsonResultList, int recordMaxSize) { try { // only 2 types: String/Boolean String resultObj = invocableEngine.invokeFunction("jsonPath", query) .toString(); if (!"false".equals(resultObj)) { org.json.simple.JSONArray resultArray = (org.json.simple.JSONArray) org.json.simple.JSONValue .parse(resultObj); jsonResultList.add(resultArray); if (recordMaxSize != -1 && recordMaxSize != resultArray.size()) { // just give an error, don't // stop System.err.println( "The Json resource datas maybe have some problems, please make sure the data structure with the same fields."); } recordMaxSize = Math.max(recordMaxSize, resultArray.size()); } else { System.err.println("Can't find any data with JSONPath " + query); // add null to take a place in // List(buffer) jsonResultList.add(null); } } catch (Exception e) { e.printStackTrace(); } return recordMaxSize; } void setRowValue_0(row2Struct row2, java.util.List<org.json.simple.JSONArray> JSONResultList_tFileInputJSON_1, int nbResultArray_tFileInputJSON_1) throws java.io.UnsupportedEncodingException { if (JSONResultList_tFileInputJSON_1.get(0) != null && nbResultArray_tFileInputJSON_1 < JSONResultList_tFileInputJSON_1 .get(0).size() && JSONResultList_tFileInputJSON_1.get(0) .get(nbResultArray_tFileInputJSON_1) != null) { row2.city = JSONResultList_tFileInputJSON_1.get(0) .get(nbResultArray_tFileInputJSON_1).toString(); } else { row2.city = null; } if (JSONResultList_tFileInputJSON_1.get(1) != null && nbResultArray_tFileInputJSON_1 < JSONResultList_tFileInputJSON_1 .get(1).size() && JSONResultList_tFileInputJSON_1.get(1) .get(nbResultArray_tFileInputJSON_1) != null) { row2.state = JSONResultList_tFileInputJSON_1.get(1) .get(nbResultArray_tFileInputJSON_1).toString(); } else { row2.state = null; } if (JSONResultList_tFileInputJSON_1.get(2) != null && nbResultArray_tFileInputJSON_1 < JSONResultList_tFileInputJSON_1 .get(2).size() && JSONResultList_tFileInputJSON_1.get(2) .get(nbResultArray_tFileInputJSON_1) != null) { row2.country = JSONResultList_tFileInputJSON_1.get(2) .get(nbResultArray_tFileInputJSON_1).toString(); } else { row2.country = null; } } } int nb_line_tFileInputJSON_1 = 0; javax.script.ScriptEngineManager scriptEngineMgr_tFileInputJSON_1 = new javax.script.ScriptEngineManager(); javax.script.ScriptEngine jsEngine_tFileInputJSON_1 = scriptEngineMgr_tFileInputJSON_1 .getEngineByName("JavaScript"); if (jsEngine_tFileInputJSON_1 == null) { System.err.println("No script engine found for JavaScript"); } java.io.InputStream jsonis_tFileInputJSON_1 = com.jsonpath.test.ReadJar.class .getResource("json.js").openStream(); jsEngine_tFileInputJSON_1.eval(new java.io.BufferedReader( new java.io.InputStreamReader(jsonis_tFileInputJSON_1))); java.io.InputStream jsonpathis_tFileInputJSON_1 = com.jsonpath.test.ReadJar.class .getResource("jsonpath.js").openStream(); jsEngine_tFileInputJSON_1.eval(new java.io.BufferedReader( new java.io.InputStreamReader(jsonpathis_tFileInputJSON_1))); java.net.URL url_tFileInputJSON_1 = new java.net.URL( "http://ziptasticapi.com/" + ((Integer) globalMap.get("zipCode"))); java.net.URLConnection urlConn_tFileInputJSON_1 = url_tFileInputJSON_1.openConnection(); java.io.InputStreamReader fr_tFileInputJSON_1 = new java.io.InputStreamReader( urlConn_tFileInputJSON_1.getInputStream(), "UTF-8"); java.lang.Object jsonText_tFileInputJSON_1 = org.json.simple.JSONValue .parse(fr_tFileInputJSON_1); jsEngine_tFileInputJSON_1.eval("var obj=" + jsonText_tFileInputJSON_1.toString()); java.util.List<org.json.simple.JSONArray> JSONResultList_tFileInputJSON_1 = new java.util.ArrayList<org.json.simple.JSONArray>(); int recordMaxSize_tFileInputJSON_1 = -1; javax.script.Invocable invocableEngine_tFileInputJSON_1 = (javax.script.Invocable) jsEngine_tFileInputJSON_1; JSONUtil_tFileInputJSON_1 jsonUtil_tFileInputJSON_1 = new JSONUtil_tFileInputJSON_1(); recordMaxSize_tFileInputJSON_1 = jsonUtil_tFileInputJSON_1.getData("city", invocableEngine_tFileInputJSON_1, JSONResultList_tFileInputJSON_1, recordMaxSize_tFileInputJSON_1); recordMaxSize_tFileInputJSON_1 = jsonUtil_tFileInputJSON_1.getData("state", invocableEngine_tFileInputJSON_1, JSONResultList_tFileInputJSON_1, recordMaxSize_tFileInputJSON_1); recordMaxSize_tFileInputJSON_1 = jsonUtil_tFileInputJSON_1.getData("country", invocableEngine_tFileInputJSON_1, JSONResultList_tFileInputJSON_1, recordMaxSize_tFileInputJSON_1); for (int nbResultArray_tFileInputJSON_1 = 0; nbResultArray_tFileInputJSON_1 < recordMaxSize_tFileInputJSON_1; nbResultArray_tFileInputJSON_1++) { nb_line_tFileInputJSON_1++; jsonUtil_tFileInputJSON_1.setRowValue_0(row2, JSONResultList_tFileInputJSON_1, nbResultArray_tFileInputJSON_1); /** * [tFileInputJSON_1 begin ] stop */ /** * [tFileInputJSON_1 main ] start */ currentComponent = "tFileInputJSON_1"; tos_count_tFileInputJSON_1++; /** * [tFileInputJSON_1 main ] stop */ /** * [tJavaRow_1 main ] start */ currentComponent = "tJavaRow_1"; // Code generated according to input schema and // output schema row3.city = row2.city; row3.state = row2.state; row3.country = row2.country; row3.zip = ((Integer) globalMap.get("zipCode")); nb_line_tJavaRow_1++; tos_count_tJavaRow_1++; /** * [tJavaRow_1 main ] stop */ /** * [tJoin_1 main ] start */ currentComponent = "tJoin_1"; row5 = null; row5 = new row5Struct(); row5.city = row3.city; row5.state = row3.state; row5.country = row3.country; row5.zip = row3.zip; if (util_tJoin_1.isJoined(row3)) { row5 = null; } else { } // ///////////////////// tos_count_tJoin_1++; /** * [tJoin_1 main ] stop */ // Start of branch "row5" if (row5 != null) { /** * [tMap_3 main ] start */ currentComponent = "tMap_3"; boolean hasCasePrimitiveKeyWithNull_tMap_3 = false; // ############################### // # Input tables (lookups) boolean rejectedInnerJoin_tMap_3 = false; boolean mainRowRejected_tMap_3 = false; // ############################### { // start of Var scope // ############################### // # Vars tables Var__tMap_3__Struct Var = Var__tMap_3;// ############################### // ############################### // # Output tables loadNewStateInfo = null; // # Output table : 'loadNewStateInfo' loadNewStateInfo_tmp.ID = 0; loadNewStateInfo_tmp.STATE = row5.state; loadNewStateInfo_tmp.CITY = row5.city; loadNewStateInfo_tmp.ZIP = row5.zip; loadNewStateInfo = loadNewStateInfo_tmp; // ############################### } // end of Var scope rejectedInnerJoin_tMap_3 = false; tos_count_tMap_3++; /** * [tMap_3 main ] stop */ // Start of branch "loadNewStateInfo" if (loadNewStateInfo != null) { /** * [tMysqlOutput_4 main ] start */ currentComponent = "tMysqlOutput_4"; whetherReject_tMysqlOutput_4 = false; pstmt_tMysqlOutput_4.setInt(1, loadNewStateInfo.ID); if (loadNewStateInfo.STATE == null) { pstmt_tMysqlOutput_4.setNull(2, java.sql.Types.VARCHAR); } else { pstmt_tMysqlOutput_4.setString(2, loadNewStateInfo.STATE); } if (loadNewStateInfo.CITY == null) { pstmt_tMysqlOutput_4.setNull(3, java.sql.Types.VARCHAR); } else { pstmt_tMysqlOutput_4.setString(3, loadNewStateInfo.CITY); } pstmt_tMysqlOutput_4.setInt(4, loadNewStateInfo.ZIP); pstmt_tMysqlOutput_4.addBatch(); nb_line_tMysqlOutput_4++; batchSizeCounter_tMysqlOutput_4++; if (batchSize_tMysqlOutput_4 <= batchSizeCounter_tMysqlOutput_4) { try { int countSum_tMysqlOutput_4 = 0; for (int countEach_tMysqlOutput_4 : pstmt_tMysqlOutput_4 .executeBatch()) { countSum_tMysqlOutput_4 += (countEach_tMysqlOutput_4 < 0 ? 0 : countEach_tMysqlOutput_4); } insertedCount_tMysqlOutput_4 += countSum_tMysqlOutput_4; } catch (java.sql.BatchUpdateException e) { int countSum_tMysqlOutput_4 = 0; for (int countEach_tMysqlOutput_4 : e.getUpdateCounts()) { countSum_tMysqlOutput_4 += (countEach_tMysqlOutput_4 < 0 ? 0 : countEach_tMysqlOutput_4); } insertedCount_tMysqlOutput_4 += countSum_tMysqlOutput_4; System.err.println(e.getMessage()); } batchSizeCounter_tMysqlOutput_4 = 0; } commitCounter_tMysqlOutput_4++; if (commitEvery_tMysqlOutput_4 <= commitCounter_tMysqlOutput_4) { try { int countSum_tMysqlOutput_4 = 0; for (int countEach_tMysqlOutput_4 : pstmt_tMysqlOutput_4 .executeBatch()) { countSum_tMysqlOutput_4 += (countEach_tMysqlOutput_4 < 0 ? 0 : countEach_tMysqlOutput_4); } insertedCount_tMysqlOutput_4 += countSum_tMysqlOutput_4; } catch (java.sql.BatchUpdateException e) { int countSum_tMysqlOutput_4 = 0; for (int countEach_tMysqlOutput_4 : e.getUpdateCounts()) { countSum_tMysqlOutput_4 += (countEach_tMysqlOutput_4 < 0 ? 0 : countEach_tMysqlOutput_4); } insertedCount_tMysqlOutput_4 += countSum_tMysqlOutput_4; System.out.println(e.getMessage()); } conn_tMysqlOutput_4.commit(); commitCounter_tMysqlOutput_4 = 0; } tos_count_tMysqlOutput_4++; /** * [tMysqlOutput_4 main ] stop */ } // End of branch "loadNewStateInfo" } // End of branch "row5" /** * [tFileInputJSON_1 end ] start */ currentComponent = "tFileInputJSON_1"; } globalMap.put("tFileInputJSON_1_NB_LINE", nb_line_tFileInputJSON_1); ok_Hash.put("tFileInputJSON_1", true); end_Hash.put("tFileInputJSON_1", System.currentTimeMillis()); /** * [tFileInputJSON_1 end ] stop */ /** * [tJavaRow_1 end ] start */ currentComponent = "tJavaRow_1"; globalMap.put("tJavaRow_1_NB_LINE", nb_line_tJavaRow_1); ok_Hash.put("tJavaRow_1", true); end_Hash.put("tJavaRow_1", System.currentTimeMillis()); /** * [tJavaRow_1 end ] stop */ /** * [tJoin_1 end ] start */ currentComponent = "tJoin_1"; ok_Hash.put("tJoin_1", true); end_Hash.put("tJoin_1", System.currentTimeMillis()); /** * [tJoin_1 end ] stop */ /** * [tMap_3 end ] start */ currentComponent = "tMap_3"; // ############################### // # Lookup hashes releasing // ############################### ok_Hash.put("tMap_3", true); end_Hash.put("tMap_3", System.currentTimeMillis()); /** * [tMap_3 end ] stop */ /** * [tMysqlOutput_4 end ] start */ currentComponent = "tMysqlOutput_4"; try { if (batchSizeCounter_tMysqlOutput_4 != 0) { int countSum_tMysqlOutput_4 = 0; for (int countEach_tMysqlOutput_4 : pstmt_tMysqlOutput_4.executeBatch()) { countSum_tMysqlOutput_4 += (countEach_tMysqlOutput_4 < 0 ? 0 : countEach_tMysqlOutput_4); } insertedCount_tMysqlOutput_4 += countSum_tMysqlOutput_4; } } catch (java.sql.BatchUpdateException e) { int countSum_tMysqlOutput_4 = 0; for (int countEach_tMysqlOutput_4 : e.getUpdateCounts()) { countSum_tMysqlOutput_4 += (countEach_tMysqlOutput_4 < 0 ? 0 : countEach_tMysqlOutput_4); } insertedCount_tMysqlOutput_4 += countSum_tMysqlOutput_4; System.err.println(e.getMessage()); } batchSizeCounter_tMysqlOutput_4 = 0; try { if (pstmt_tMysqlOutput_4 != null) { int countSum_tMysqlOutput_4 = 0; for (int countEach_tMysqlOutput_4 : pstmt_tMysqlOutput_4.executeBatch()) { countSum_tMysqlOutput_4 += (countEach_tMysqlOutput_4 < 0 ? 0 : countEach_tMysqlOutput_4); } insertedCount_tMysqlOutput_4 += countSum_tMysqlOutput_4; } } catch (java.sql.BatchUpdateException e) { int countSum_tMysqlOutput_4 = 0; for (int countEach_tMysqlOutput_4 : e.getUpdateCounts()) { countSum_tMysqlOutput_4 += (countEach_tMysqlOutput_4 < 0 ? 0 : countEach_tMysqlOutput_4); } insertedCount_tMysqlOutput_4 += countSum_tMysqlOutput_4; System.out.println(e.getMessage()); } if (pstmt_tMysqlOutput_4 != null) { pstmt_tMysqlOutput_4.close(); } conn_tMysqlOutput_4.commit(); conn_tMysqlOutput_4.close(); nb_line_deleted_tMysqlOutput_4 = nb_line_deleted_tMysqlOutput_4 + deletedCount_tMysqlOutput_4; nb_line_update_tMysqlOutput_4 = nb_line_update_tMysqlOutput_4 + updatedCount_tMysqlOutput_4; nb_line_inserted_tMysqlOutput_4 = nb_line_inserted_tMysqlOutput_4 + insertedCount_tMysqlOutput_4; nb_line_rejected_tMysqlOutput_4 = nb_line_rejected_tMysqlOutput_4 + rejectedCount_tMysqlOutput_4; globalMap.put("tMysqlOutput_4_NB_LINE", nb_line_tMysqlOutput_4); globalMap.put("tMysqlOutput_4_NB_LINE_UPDATED", nb_line_update_tMysqlOutput_4); globalMap.put("tMysqlOutput_4_NB_LINE_INSERTED", nb_line_inserted_tMysqlOutput_4); globalMap.put("tMysqlOutput_4_NB_LINE_DELETED", nb_line_deleted_tMysqlOutput_4); globalMap.put("tMysqlOutput_4_NB_LINE_REJECTED", nb_line_rejected_tMysqlOutput_4); ok_Hash.put("tMysqlOutput_4", true); end_Hash.put("tMysqlOutput_4", System.currentTimeMillis()); /** * [tMysqlOutput_4 end ] stop */ } // End of branch "stateInfo" // Start of branch "propertyData" if (propertyData != null) { row9 = null; /** * [tMap_1 main ] start */ currentComponent = "tMap_1"; boolean hasCasePrimitiveKeyWithNull_tMap_1 = false; // ############################### // # Input tables (lookups) boolean rejectedInnerJoin_tMap_1 = false; boolean mainRowRejected_tMap_1 = false; // ///////////////////////////////////////////// // Starting Lookup Table "row6" // ///////////////////////////////////////////// boolean forceLooprow6 = false; row6Struct row6ObjectFromLookup = null; if (!rejectedInnerJoin_tMap_1) { // G_TM_M_020 hasCasePrimitiveKeyWithNull_tMap_1 = false; Object exprKeyValue_row6__ZIP = propertyData.zipcode__c; if (exprKeyValue_row6__ZIP == null) { hasCasePrimitiveKeyWithNull_tMap_1 = true; } else { row6HashKey.ZIP = (int) (Integer) exprKeyValue_row6__ZIP; } row6HashKey.hashCodeDirty = true; if (!hasCasePrimitiveKeyWithNull_tMap_1) { // G_TM_M_091 tHash_Lookup_Cache_row6.lookup(row6HashKey); if (tHash_Lookup_Cache_row6.hasNext()) { // G_TM_M_835 tHash_Lookup_row6 = tHash_Lookup_Cache_row6; } // G_TM_M_834 else { // G_TM_M_835 tMysqlInput_2Process(globalMap); tHash_Lookup_row6 = (org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row6Struct>) ((org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row6Struct>) globalMap .get("tHash_Lookup_row6")); tHash_Lookup_row6.initGet(); tHash_Lookup_row6.lookup(row6HashKey); } // G_TM_M_835 } // G_TM_M_091 if (hasCasePrimitiveKeyWithNull_tMap_1 || !tHash_Lookup_row6.hasNext()) { // G_TM_M_090 rejectedInnerJoin_tMap_1 = true; } // G_TM_M_090 } // G_TM_M_020 if (tHash_Lookup_row6 != null && tHash_Lookup_row6.getCount(row6HashKey) > 1) { // G // 071 // System.out.println("WARNING: UNIQUE MATCH is configured for the lookup 'row6' and it contains more one result from keys : row6.ZIP = '" // + row6HashKey.ZIP + "'"); } // G 071 row6Struct row6 = null; row6Struct fromLookup_row6 = null; row6 = row6Default; if (tHash_Lookup_row6 != null && tHash_Lookup_row6.hasNext()) { // G 099 fromLookup_row6 = tHash_Lookup_row6.next(); } // G 099 if (fromLookup_row6 != null) { row6 = fromLookup_row6; } if (tHash_Lookup_Cache_row6 != tHash_Lookup_row6) { tHash_Lookup_Cache_row6.put(row6); } // ############################### { // start of Var scope // ############################### // # Vars tables Var__tMap_1__Struct Var = Var__tMap_1;// ############################### // ############################### // # Output tables mappedData = null; if (!rejectedInnerJoin_tMap_1) { // # Output table : 'mappedData' mappedData_tmp.PROP_NAME = propertyData.name; mappedData_tmp.PRICE = propertyData.price__c; mappedData_tmp.SQFT = "1500"; mappedData_tmp.DESCRIPTION = propertyData.pba__description_pb__c; mappedData_tmp.NUM_BEDS = propertyData.bedrooms__c; mappedData_tmp.NUM_BATHS = propertyData.bathrooms__c; mappedData_tmp.STATE_INFO_ID = row6.ID; mappedData_tmp.customer = context.cusomterName; mappedData_tmp.status = propertyData.pba__status__c; mappedData_tmp.type = propertyData.pba__propertytype__c; mappedData = mappedData_tmp; } // closing inner join bracket (2) // ############################### } // end of Var scope rejectedInnerJoin_tMap_1 = false; tos_count_tMap_1++; /** * [tMap_1 main ] stop */ // Start of branch "mappedData" if (mappedData != null) { row9 = null; /** * [tMap_4 main ] start */ currentComponent = "tMap_4"; boolean hasCasePrimitiveKeyWithNull_tMap_4 = false; // ############################### // # Input tables (lookups) boolean rejectedInnerJoin_tMap_4 = false; boolean mainRowRejected_tMap_4 = false; // ///////////////////////////////////////////// // Starting Lookup Table "custData" // ///////////////////////////////////////////// boolean forceLoopcustData = false; custDataStruct custDataObjectFromLookup = null; if (!rejectedInnerJoin_tMap_4) { // G_TM_M_020 hasCasePrimitiveKeyWithNull_tMap_4 = false; custDataHashKey.CUST_NAME = mappedData.customer; custDataHashKey.hashCodeDirty = true; tHash_Lookup_custData.lookup(custDataHashKey); if (!tHash_Lookup_custData.hasNext()) { // G_TM_M_090 rejectedInnerJoin_tMap_4 = true; } // G_TM_M_090 } // G_TM_M_020 if (tHash_Lookup_custData != null && tHash_Lookup_custData.getCount(custDataHashKey) > 1) { // G // 071 // System.out.println("WARNING: UNIQUE MATCH is configured for the lookup 'custData' and it contains more one result from keys : custData.CUST_NAME = '" // + custDataHashKey.CUST_NAME + "'"); } // G 071 custDataStruct custData = null; custDataStruct fromLookup_custData = null; custData = custDataDefault; if (tHash_Lookup_custData != null && tHash_Lookup_custData.hasNext()) { // G // 099 fromLookup_custData = tHash_Lookup_custData.next(); } // G 099 if (fromLookup_custData != null) { custData = fromLookup_custData; } // ############################### { // start of Var scope // ############################### // # Vars tables Var__tMap_4__Struct Var = Var__tMap_4;// ############################### // ############################### // # Output tables loadData = null; if (!rejectedInnerJoin_tMap_4) { // # Output table : 'loadData' loadData_tmp.PROP_NAME = mappedData.PROP_NAME; loadData_tmp.PRICE = mappedData.PRICE; loadData_tmp.SQFT = mappedData.SQFT; loadData_tmp.DESCRIPTION = mappedData.DESCRIPTION; loadData_tmp.NUM_BEDS = mappedData.NUM_BEDS; loadData_tmp.NUM_BATHS = mappedData.NUM_BATHS; loadData_tmp.TYPE = mappedData.type; loadData_tmp.STATUS = mappedData.status; loadData_tmp.STATE_INFO_ID = mappedData.STATE_INFO_ID; loadData_tmp.DATA_SOURCE_ID = custData.DATA_SOURCE_ID; loadData = loadData_tmp; } // closing inner join bracket (2) // ############################### } // end of Var scope rejectedInnerJoin_tMap_4 = false; tos_count_tMap_4++; /** * [tMap_4 main ] stop */ // Start of branch "loadData" if (loadData != null) { row9 = null; /** * [tJoin_3 main ] start */ currentComponent = "tJoin_3"; row9 = null; row9 = new row9Struct(); row9.PROP_NAME = loadData.PROP_NAME; row9.PRICE = loadData.PRICE; row9.SQFT = loadData.SQFT; row9.DESCRIPTION = loadData.DESCRIPTION; row9.NUM_BEDS = loadData.NUM_BEDS; row9.NUM_BATHS = loadData.NUM_BATHS; row9.TYPE = loadData.TYPE; row9.STATUS = loadData.STATUS; row9.STATE_INFO_ID = loadData.STATE_INFO_ID; row9.DATA_SOURCE_ID = loadData.DATA_SOURCE_ID; if (util_tJoin_3.isJoined(loadData)) { row9 = null; } else { } // ///////////////////// tos_count_tJoin_3++; /** * [tJoin_3 main ] stop */ // Start of branch "row9" if (row9 != null) { /** * [tJavaRow_3 main ] start */ currentComponent = "tJavaRow_3"; // Code generated according to input // schema and output schema System.out.println( "***** Loading New Property Data for:" + row9.PROP_NAME + " *****"); row14.PROP_NAME = row9.PROP_NAME; row14.PRICE = row9.PRICE; row14.SQFT = row9.SQFT; row14.DESCRIPTION = row9.DESCRIPTION; row14.NUM_BEDS = row9.NUM_BEDS; row14.NUM_BATHS = row9.NUM_BATHS; row14.TYPE = row9.TYPE; row14.STATUS = row9.STATUS; row14.STATE_INFO_ID = row9.STATE_INFO_ID; row14.DATA_SOURCE_ID = row9.DATA_SOURCE_ID; row14.PROP_UUID = UUID.randomUUID().toString(); nb_line_tJavaRow_3++; tos_count_tJavaRow_3++; /** * [tJavaRow_3 main ] stop */ /** * [tMap_8 main ] start */ currentComponent = "tMap_8"; boolean hasCasePrimitiveKeyWithNull_tMap_8 = false; // ############################### // # Input tables (lookups) boolean rejectedInnerJoin_tMap_8 = false; boolean mainRowRejected_tMap_8 = false; // ############################### { // start of Var scope // ############################### // # Vars tables Var__tMap_8__Struct Var = Var__tMap_8;// ############################### // ############################### // # Output tables mainPropertyDataLoad = null; // # Output table : // 'mainPropertyDataLoad' mainPropertyDataLoad_tmp.ID = 0; mainPropertyDataLoad_tmp.UUID = row14.PROP_UUID; mainPropertyDataLoad_tmp.PROP_NAME = row14.PROP_NAME; mainPropertyDataLoad_tmp.PRICE = row14.PRICE; mainPropertyDataLoad_tmp.SQFT = row14.SQFT; mainPropertyDataLoad_tmp.DESCRIPTION = row14.DESCRIPTION; mainPropertyDataLoad_tmp.NUM_BEDS = row14.NUM_BEDS; mainPropertyDataLoad_tmp.NUM_BATHS = row14.NUM_BATHS; mainPropertyDataLoad_tmp.TYPE = row14.TYPE; mainPropertyDataLoad_tmp.STATUS = row14.STATUS; mainPropertyDataLoad_tmp.STATE_INFO_ID = row14.STATE_INFO_ID; mainPropertyDataLoad_tmp.DATA_SOURCE_ID = row14.DATA_SOURCE_ID; mainPropertyDataLoad = mainPropertyDataLoad_tmp; // ############################### } // end of Var scope rejectedInnerJoin_tMap_8 = false; tos_count_tMap_8++; /** * [tMap_8 main ] stop */ // Start of branch // "mainPropertyDataLoad" if (mainPropertyDataLoad != null) { /** * [tMysqlOutput_1 main ] start */ currentComponent = "tMysqlOutput_1"; whetherReject_tMysqlOutput_1 = false; pstmt_tMysqlOutput_1.setInt(1, mainPropertyDataLoad.ID); if (mainPropertyDataLoad.UUID == null) { pstmt_tMysqlOutput_1.setNull(2, java.sql.Types.VARCHAR); } else { pstmt_tMysqlOutput_1.setString(2, mainPropertyDataLoad.UUID); } if (mainPropertyDataLoad.PROP_NAME == null) { pstmt_tMysqlOutput_1.setNull(3, java.sql.Types.VARCHAR); } else { pstmt_tMysqlOutput_1.setString(3, mainPropertyDataLoad.PROP_NAME); } pstmt_tMysqlOutput_1.setFloat(4, mainPropertyDataLoad.PRICE); if (mainPropertyDataLoad.SQFT == null) { pstmt_tMysqlOutput_1.setNull(5, java.sql.Types.VARCHAR); } else { pstmt_tMysqlOutput_1.setString(5, mainPropertyDataLoad.SQFT); } if (mainPropertyDataLoad.DESCRIPTION == null) { pstmt_tMysqlOutput_1.setNull(6, java.sql.Types.VARCHAR); } else { pstmt_tMysqlOutput_1.setString(6, mainPropertyDataLoad.DESCRIPTION); } pstmt_tMysqlOutput_1.setFloat(7, mainPropertyDataLoad.NUM_BEDS); pstmt_tMysqlOutput_1.setFloat(8, mainPropertyDataLoad.NUM_BATHS); if (mainPropertyDataLoad.TYPE == null) { pstmt_tMysqlOutput_1.setNull(9, java.sql.Types.VARCHAR); } else { pstmt_tMysqlOutput_1.setString(9, mainPropertyDataLoad.TYPE); } if (mainPropertyDataLoad.STATUS == null) { pstmt_tMysqlOutput_1.setNull(10, java.sql.Types.VARCHAR); } else { pstmt_tMysqlOutput_1.setString(10, mainPropertyDataLoad.STATUS); } pstmt_tMysqlOutput_1.setInt(11, mainPropertyDataLoad.STATE_INFO_ID); pstmt_tMysqlOutput_1.setInt(12, mainPropertyDataLoad.DATA_SOURCE_ID); pstmt_tMysqlOutput_1.addBatch(); nb_line_tMysqlOutput_1++; batchSizeCounter_tMysqlOutput_1++; if (batchSize_tMysqlOutput_1 <= batchSizeCounter_tMysqlOutput_1) { try { int countSum_tMysqlOutput_1 = 0; for (int countEach_tMysqlOutput_1 : pstmt_tMysqlOutput_1 .executeBatch()) { countSum_tMysqlOutput_1 += (countEach_tMysqlOutput_1 < 0 ? 0 : countEach_tMysqlOutput_1); } insertedCount_tMysqlOutput_1 += countSum_tMysqlOutput_1; } catch (java.sql.BatchUpdateException e) { int countSum_tMysqlOutput_1 = 0; for (int countEach_tMysqlOutput_1 : e.getUpdateCounts()) { countSum_tMysqlOutput_1 += (countEach_tMysqlOutput_1 < 0 ? 0 : countEach_tMysqlOutput_1); } insertedCount_tMysqlOutput_1 += countSum_tMysqlOutput_1; System.err.println(e.getMessage()); } batchSizeCounter_tMysqlOutput_1 = 0; } commitCounter_tMysqlOutput_1++; if (commitEvery_tMysqlOutput_1 <= commitCounter_tMysqlOutput_1) { try { int countSum_tMysqlOutput_1 = 0; for (int countEach_tMysqlOutput_1 : pstmt_tMysqlOutput_1 .executeBatch()) { countSum_tMysqlOutput_1 += (countEach_tMysqlOutput_1 < 0 ? 0 : countEach_tMysqlOutput_1); } insertedCount_tMysqlOutput_1 += countSum_tMysqlOutput_1; } catch (java.sql.BatchUpdateException e) { int countSum_tMysqlOutput_1 = 0; for (int countEach_tMysqlOutput_1 : e.getUpdateCounts()) { countSum_tMysqlOutput_1 += (countEach_tMysqlOutput_1 < 0 ? 0 : countEach_tMysqlOutput_1); } insertedCount_tMysqlOutput_1 += countSum_tMysqlOutput_1; System.out.println(e.getMessage()); } conn_tMysqlOutput_1.commit(); commitCounter_tMysqlOutput_1 = 0; } tos_count_tMysqlOutput_1++; /** * [tMysqlOutput_1 main ] stop */ } // End of branch // "mainPropertyDataLoad" } // End of branch "row9" } // End of branch "loadData" } // End of branch "mappedData" } // End of branch "propertyData" } // End of branch "row1" /** * [tFileInputXML_1 end ] start */ currentComponent = "tFileInputXML_1"; } try { looper_tFileInputXML_1.handleTaskResponse(); } catch (Exception e) { System.err.println(e.getMessage()); } globalMap.put("tFileInputXML_1_NB_LINE", nb_line_tFileInputXML_1); ok_Hash.put("tFileInputXML_1", true); end_Hash.put("tFileInputXML_1", System.currentTimeMillis()); /** * [tFileInputXML_1 end ] stop */ /** * [tMap_2 end ] start */ currentComponent = "tMap_2"; // ############################### // # Lookup hashes releasing // ############################### ok_Hash.put("tMap_2", true); end_Hash.put("tMap_2", System.currentTimeMillis()); /** * [tMap_2 end ] stop */ /** * [tMap_1 end ] start */ currentComponent = "tMap_1"; // ############################### // # Lookup hashes releasing if (tHash_Lookup_row6 != null) { tHash_Lookup_row6.endGet(); } globalMap.remove("tHash_Lookup_row6"); tHash_Lookup_Cache_row6.endGet(); tHash_Lookup_Cache_row6 = null; tHash_Lookup_Real_row6 = null; // ############################### ok_Hash.put("tMap_1", true); end_Hash.put("tMap_1", System.currentTimeMillis()); /** * [tMap_1 end ] stop */ /** * [tMap_4 end ] start */ currentComponent = "tMap_4"; // ############################### // # Lookup hashes releasing if (tHash_Lookup_custData != null) { tHash_Lookup_custData.endGet(); } globalMap.remove("tHash_Lookup_custData"); // ############################### ok_Hash.put("tMap_4", true); end_Hash.put("tMap_4", System.currentTimeMillis()); /** * [tMap_4 end ] stop */ /** * [tJoin_3 end ] start */ currentComponent = "tJoin_3"; ok_Hash.put("tJoin_3", true); end_Hash.put("tJoin_3", System.currentTimeMillis()); /** * [tJoin_3 end ] stop */ /** * [tJavaRow_3 end ] start */ currentComponent = "tJavaRow_3"; globalMap.put("tJavaRow_3_NB_LINE", nb_line_tJavaRow_3); ok_Hash.put("tJavaRow_3", true); end_Hash.put("tJavaRow_3", System.currentTimeMillis()); /** * [tJavaRow_3 end ] stop */ /** * [tMap_8 end ] start */ currentComponent = "tMap_8"; // ############################### // # Lookup hashes releasing // ############################### ok_Hash.put("tMap_8", true); end_Hash.put("tMap_8", System.currentTimeMillis()); /** * [tMap_8 end ] stop */ /** * [tMysqlOutput_1 end ] start */ currentComponent = "tMysqlOutput_1"; try { if (batchSizeCounter_tMysqlOutput_1 != 0) { int countSum_tMysqlOutput_1 = 0; for (int countEach_tMysqlOutput_1 : pstmt_tMysqlOutput_1.executeBatch()) { countSum_tMysqlOutput_1 += (countEach_tMysqlOutput_1 < 0 ? 0 : countEach_tMysqlOutput_1); } insertedCount_tMysqlOutput_1 += countSum_tMysqlOutput_1; } } catch (java.sql.BatchUpdateException e) { int countSum_tMysqlOutput_1 = 0; for (int countEach_tMysqlOutput_1 : e.getUpdateCounts()) { countSum_tMysqlOutput_1 += (countEach_tMysqlOutput_1 < 0 ? 0 : countEach_tMysqlOutput_1); } insertedCount_tMysqlOutput_1 += countSum_tMysqlOutput_1; System.err.println(e.getMessage()); } batchSizeCounter_tMysqlOutput_1 = 0; try { if (pstmt_tMysqlOutput_1 != null) { int countSum_tMysqlOutput_1 = 0; for (int countEach_tMysqlOutput_1 : pstmt_tMysqlOutput_1.executeBatch()) { countSum_tMysqlOutput_1 += (countEach_tMysqlOutput_1 < 0 ? 0 : countEach_tMysqlOutput_1); } insertedCount_tMysqlOutput_1 += countSum_tMysqlOutput_1; } } catch (java.sql.BatchUpdateException e) { int countSum_tMysqlOutput_1 = 0; for (int countEach_tMysqlOutput_1 : e.getUpdateCounts()) { countSum_tMysqlOutput_1 += (countEach_tMysqlOutput_1 < 0 ? 0 : countEach_tMysqlOutput_1); } insertedCount_tMysqlOutput_1 += countSum_tMysqlOutput_1; System.out.println(e.getMessage()); } if (pstmt_tMysqlOutput_1 != null) { pstmt_tMysqlOutput_1.close(); } conn_tMysqlOutput_1.commit(); conn_tMysqlOutput_1.close(); nb_line_deleted_tMysqlOutput_1 = nb_line_deleted_tMysqlOutput_1 + deletedCount_tMysqlOutput_1; nb_line_update_tMysqlOutput_1 = nb_line_update_tMysqlOutput_1 + updatedCount_tMysqlOutput_1; nb_line_inserted_tMysqlOutput_1 = nb_line_inserted_tMysqlOutput_1 + insertedCount_tMysqlOutput_1; nb_line_rejected_tMysqlOutput_1 = nb_line_rejected_tMysqlOutput_1 + rejectedCount_tMysqlOutput_1; globalMap.put("tMysqlOutput_1_NB_LINE", nb_line_tMysqlOutput_1); globalMap.put("tMysqlOutput_1_NB_LINE_UPDATED", nb_line_update_tMysqlOutput_1); globalMap.put("tMysqlOutput_1_NB_LINE_INSERTED", nb_line_inserted_tMysqlOutput_1); globalMap.put("tMysqlOutput_1_NB_LINE_DELETED", nb_line_deleted_tMysqlOutput_1); globalMap.put("tMysqlOutput_1_NB_LINE_REJECTED", nb_line_rejected_tMysqlOutput_1); ok_Hash.put("tMysqlOutput_1", true); end_Hash.put("tMysqlOutput_1", System.currentTimeMillis()); /** * [tMysqlOutput_1 end ] stop */ /** * [tFlowToIterate_1 end ] start */ currentComponent = "tFlowToIterate_1"; globalMap.put("tFlowToIterate_1_NB_LINE", nb_line_tFlowToIterate_1); ok_Hash.put("tFlowToIterate_1", true); end_Hash.put("tFlowToIterate_1", System.currentTimeMillis()); /** * [tFlowToIterate_1 end ] stop */ } // end the resume if (resumeEntryMethodName == null || globalResumeTicket) { resumeUtil.addLog("CHECKPOINT", "CONNECTION:SUBJOB_OK:tFileInputXML_1:OnSubjobOk", "", Thread.currentThread().getId() + "", "", "", "", "", ""); } tJava_1Process(globalMap); } catch (Exception e) { throw new TalendException(e, currentComponent, globalMap); } catch (java.lang.Error error) { throw new java.lang.Error(error); } finally { // free memory for "tJoin_1" globalMap.put("tHash_row4", null); // free memory for "tJoin_3" globalMap.put("tHash_getCurrentProperties", null); // free memory for "tMap_4" globalMap.put("tHash_Lookup_custData", null); // free memory for "tMap_1" globalMap.put("tHash_Lookup_row6", null); } globalMap.put("tFileInputXML_1_SUBPROCESS_STATE", 1); }
From source file:talonetl.getproperties_0_4.getProperties.java
public void tFileInputXML_1Process(final java.util.Map<String, Object> globalMap) throws TalendException { globalMap.put("tFileInputXML_1_SUBPROCESS_STATE", 0); final boolean execStat = this.execStat; String iterateId = ""; int iterateLoop = 0; String currentComponent = ""; try {//from w w w . j ava 2 s . c om String currentMethodName = new Exception().getStackTrace()[0].getMethodName(); boolean resumeIt = currentMethodName.equals(resumeEntryMethodName); if (resumeEntryMethodName == null || resumeIt || globalResumeTicket) {// start // the // resume globalResumeTicket = true; tMysqlInput_1Process(globalMap); tMysqlInput_5Process(globalMap); tMysqlInput_3Process(globalMap); row1Struct row1 = new row1Struct(); stateInfoStruct stateInfo = new stateInfoStruct(); row2Struct row2 = new row2Struct(); row3Struct row3 = new row3Struct(); row5Struct row5 = new row5Struct(); loadNewStateInfoStruct loadNewStateInfo = new loadNewStateInfoStruct(); propertyDataStruct propertyData = new propertyDataStruct(); mappedDataStruct mappedData = new mappedDataStruct(); loadDataStruct loadData = new loadDataStruct(); row9Struct row9 = new row9Struct(); row14Struct row14 = new row14Struct(); mainPropertyDataLoadStruct mainPropertyDataLoad = new mainPropertyDataLoadStruct(); /** * [tFlowToIterate_1 begin ] start */ int NB_ITERATE_tFileInputJSON_1 = 0; // for statistics ok_Hash.put("tFlowToIterate_1", false); start_Hash.put("tFlowToIterate_1", System.currentTimeMillis()); currentComponent = "tFlowToIterate_1"; int tos_count_tFlowToIterate_1 = 0; int nb_line_tFlowToIterate_1 = 0; int counter_tFlowToIterate_1 = 0; /** * [tFlowToIterate_1 begin ] stop */ /** * [tMysqlOutput_1 begin ] start */ ok_Hash.put("tMysqlOutput_1", false); start_Hash.put("tMysqlOutput_1", System.currentTimeMillis()); currentComponent = "tMysqlOutput_1"; int tos_count_tMysqlOutput_1 = 0; int nb_line_tMysqlOutput_1 = 0; int nb_line_update_tMysqlOutput_1 = 0; int nb_line_inserted_tMysqlOutput_1 = 0; int nb_line_deleted_tMysqlOutput_1 = 0; int nb_line_rejected_tMysqlOutput_1 = 0; int deletedCount_tMysqlOutput_1 = 0; int updatedCount_tMysqlOutput_1 = 0; int insertedCount_tMysqlOutput_1 = 0; int rejectedCount_tMysqlOutput_1 = 0; String tableName_tMysqlOutput_1 = "PROPERTY_DATA"; boolean whetherReject_tMysqlOutput_1 = false; java.util.Calendar calendar_tMysqlOutput_1 = java.util.Calendar.getInstance(); calendar_tMysqlOutput_1.set(1, 0, 1, 0, 0, 0); long year1_tMysqlOutput_1 = calendar_tMysqlOutput_1.getTime().getTime(); calendar_tMysqlOutput_1.set(10000, 0, 1, 0, 0, 0); long year10000_tMysqlOutput_1 = calendar_tMysqlOutput_1.getTime().getTime(); long date_tMysqlOutput_1; java.sql.Connection conn_tMysqlOutput_1 = null; java.util.Map<String, routines.system.TalendDataSource> dataSources_tMysqlOutput_1 = (java.util.Map<String, routines.system.TalendDataSource>) globalMap .get(KEY_DB_DATASOURCES); if (null != dataSources_tMysqlOutput_1) { conn_tMysqlOutput_1 = dataSources_tMysqlOutput_1.get("").getConnection(); } else { String dbProperties_tMysqlOutput_1 = "noDatetimeStringSync=true"; String url_tMysqlOutput_1 = null; if (dbProperties_tMysqlOutput_1 == null || dbProperties_tMysqlOutput_1.trim().length() == 0) { url_tMysqlOutput_1 = "jdbc:mysql://" + "192.168.1.201" + ":" + "3306" + "/" + "TALONDB" + "?" + "rewriteBatchedStatements=true"; } else { String properties_tMysqlOutput_1 = "noDatetimeStringSync=true"; if (!properties_tMysqlOutput_1.contains("rewriteBatchedStatements")) { properties_tMysqlOutput_1 += "&rewriteBatchedStatements=true"; } url_tMysqlOutput_1 = "jdbc:mysql://" + "192.168.1.201" + ":" + "3306" + "/" + "TALONDB" + "?" + properties_tMysqlOutput_1; } String dbUser_tMysqlOutput_1 = "dbAdmin"; String dbPwd_tMysqlOutput_1 = "1nn0s2013"; java.lang.Class.forName("org.gjt.mm.mysql.Driver"); conn_tMysqlOutput_1 = java.sql.DriverManager.getConnection(url_tMysqlOutput_1, dbUser_tMysqlOutput_1, dbPwd_tMysqlOutput_1); } conn_tMysqlOutput_1.setAutoCommit(false); int commitEvery_tMysqlOutput_1 = 10000; int commitCounter_tMysqlOutput_1 = 0; int count_tMysqlOutput_1 = 0; String insert_tMysqlOutput_1 = "INSERT INTO `" + "PROPERTY_DATA" + "` (`ID`,`UUID`,`PROP_NAME`,`PRICE`,`SQFT`,`DESCRIPTION`,`NUM_BEDS`,`NUM_BATHS`,`TYPE`,`STATUS`,`STATE_INFO_ID`,`DATA_SOURCE_ID`) VALUES (?,?,?,?,?,?,?,?,?,?,?,?)"; int batchSize_tMysqlOutput_1 = 100; int batchSizeCounter_tMysqlOutput_1 = 0; java.sql.PreparedStatement pstmt_tMysqlOutput_1 = conn_tMysqlOutput_1 .prepareStatement(insert_tMysqlOutput_1); /** * [tMysqlOutput_1 begin ] stop */ /** * [tMap_8 begin ] start */ ok_Hash.put("tMap_8", false); start_Hash.put("tMap_8", System.currentTimeMillis()); currentComponent = "tMap_8"; int tos_count_tMap_8 = 0; // ############################### // # Lookup's keys initialization // ############################### // ############################### // # Vars initialization class Var__tMap_8__Struct { } Var__tMap_8__Struct Var__tMap_8 = new Var__tMap_8__Struct(); // ############################### // ############################### // # Outputs initialization mainPropertyDataLoadStruct mainPropertyDataLoad_tmp = new mainPropertyDataLoadStruct(); // ############################### /** * [tMap_8 begin ] stop */ /** * [tJavaRow_3 begin ] start */ ok_Hash.put("tJavaRow_3", false); start_Hash.put("tJavaRow_3", System.currentTimeMillis()); currentComponent = "tJavaRow_3"; int tos_count_tJavaRow_3 = 0; int nb_line_tJavaRow_3 = 0; /** * [tJavaRow_3 begin ] stop */ /** * [tJoin_3 begin ] start */ ok_Hash.put("tJoin_3", false); start_Hash.put("tJoin_3", System.currentTimeMillis()); currentComponent = "tJoin_3"; int tos_count_tJoin_3 = 0; final java.util.Map<getCurrentPropertiesStruct, getCurrentPropertiesStruct> tHash_tJoin_3 = (java.util.Map<getCurrentPropertiesStruct, getCurrentPropertiesStruct>) globalMap .get("tHash_getCurrentProperties"); class Util_tJoin_3 { getCurrentPropertiesStruct lookupValue = null; getCurrentPropertiesStruct getCurrentPropertiesHashKey = new getCurrentPropertiesStruct(); public boolean isJoined(loadDataStruct mainRow) { getCurrentPropertiesHashKey.PROP_NAME = mainRow.PROP_NAME; getCurrentPropertiesHashKey.hashCodeDirty = true; lookupValue = tHash_tJoin_3.get(getCurrentPropertiesHashKey); if (lookupValue != null) { return true; } return false; } } Util_tJoin_3 util_tJoin_3 = new Util_tJoin_3(); int nb_line_tJoin_3 = 0; /** * [tJoin_3 begin ] stop */ /** * [tMap_4 begin ] start */ ok_Hash.put("tMap_4", false); start_Hash.put("tMap_4", System.currentTimeMillis()); currentComponent = "tMap_4"; int tos_count_tMap_4 = 0; // ############################### // # Lookup's keys initialization org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<custDataStruct> tHash_Lookup_custData = (org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<custDataStruct>) ((org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<custDataStruct>) globalMap .get("tHash_Lookup_custData")); custDataStruct custDataHashKey = new custDataStruct(); custDataStruct custDataDefault = new custDataStruct(); // ############################### // ############################### // # Vars initialization class Var__tMap_4__Struct { } Var__tMap_4__Struct Var__tMap_4 = new Var__tMap_4__Struct(); // ############################### // ############################### // # Outputs initialization loadDataStruct loadData_tmp = new loadDataStruct(); // ############################### /** * [tMap_4 begin ] stop */ /** * [tMap_1 begin ] start */ ok_Hash.put("tMap_1", false); start_Hash.put("tMap_1", System.currentTimeMillis()); currentComponent = "tMap_1"; int tos_count_tMap_1 = 0; // ############################### // # Lookup's keys initialization org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row6Struct> tHash_Lookup_row6 = null; org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row6Struct> tHash_Lookup_Cache_row6 = org.talend.designer.components.lookup.memory.AdvancedMemoryLookup .<row6Struct>getLookup( org.talend.designer.components.lookup.common.ICommonLookup.MATCHING_MODE.UNIQUE_MATCH); org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row6Struct> tHash_Lookup_Real_row6 = null; row6Struct row6HashKey = new row6Struct(); row6Struct row6Default = new row6Struct(); // ############################### // ############################### // # Vars initialization class Var__tMap_1__Struct { } Var__tMap_1__Struct Var__tMap_1 = new Var__tMap_1__Struct(); // ############################### // ############################### // # Outputs initialization mappedDataStruct mappedData_tmp = new mappedDataStruct(); // ############################### /** * [tMap_1 begin ] stop */ /** * [tMap_2 begin ] start */ ok_Hash.put("tMap_2", false); start_Hash.put("tMap_2", System.currentTimeMillis()); currentComponent = "tMap_2"; int tos_count_tMap_2 = 0; // ############################### // # Lookup's keys initialization // ############################### // ############################### // # Vars initialization class Var__tMap_2__Struct { } Var__tMap_2__Struct Var__tMap_2 = new Var__tMap_2__Struct(); // ############################### // ############################### // # Outputs initialization stateInfoStruct stateInfo_tmp = new stateInfoStruct(); propertyDataStruct propertyData_tmp = new propertyDataStruct(); // ############################### /** * [tMap_2 begin ] stop */ /** * [tFileInputXML_1 begin ] start */ ok_Hash.put("tFileInputXML_1", false); start_Hash.put("tFileInputXML_1", System.currentTimeMillis()); currentComponent = "tFileInputXML_1"; int tos_count_tFileInputXML_1 = 0; int nb_line_tFileInputXML_1 = 0; String os_tFileInputXML_1 = System.getProperty("os.name").toLowerCase(); boolean isWindows_tFileInputXML_1 = false; if (os_tFileInputXML_1.indexOf("windows") > -1 || os_tFileInputXML_1.indexOf("nt") > -1) { isWindows_tFileInputXML_1 = true; } class XML_API_tFileInputXML_1 { public boolean isDefNull(String[] node) throws javax.xml.transform.TransformerException { if (node[0] != null && node[1] != null && ("true").equals(node[1])) { return true; } return false; } public boolean isMissing(String[] node) throws javax.xml.transform.TransformerException { return node[0] == null ? true : false; } public boolean isEmpty(String[] node) throws javax.xml.transform.TransformerException { if (node[0] != null) { return node[0].length() == 0; } return false; } } XML_API_tFileInputXML_1 xml_api_tFileInputXML_1 = new XML_API_tFileInputXML_1(); String[] queryPaths_tFileInputXML_1 = new String[] { "name", "name" + "/@xsi:nil", "../media/images/image/url", "../media/images/image/url" + "/@xsi:nil", "../media/images/image/title", "../media/images/image/title" + "/@xsi:nil", "pba__propertytype__c", "pba__propertytype__c" + "/@xsi:nil", "rented_status__c", "rented_status__c" + "/@xsi:nil", "zipcode__c", "zipcode__c" + "/@xsi:nil", "pba__city_pb__c", "pba__city_pb__c" + "/@xsi:nil", "pba__description_pb__c", "pba__description_pb__c" + "/@xsi:nil", "term_2__c", "term_2__c" + "/@xsi:nil", "term_1__c", "term_1__c" + "/@xsi:nil", "pba__status__c", "pba__status__c" + "/@xsi:nil", "year_built__c", "year_built__c" + "/@xsi:nil", "pba__address_pb__c", "pba__address_pb__c" + "/@xsi:nil", "financed_net_yield_1__c", "financed_net_yield_1__c" + "/@xsi:nil", "monthly_cash_flow_with_financing_2__c", "monthly_cash_flow_with_financing_2__c" + "/@xsi:nil", "financed_net_yield_2__c", "financed_net_yield_2__c" + "/@xsi:nil", "monthly_cash_flow_with_financing_1__c", "monthly_cash_flow_with_financing_1__c" + "/@xsi:nil", "interest_rate_2__c", "interest_rate_2__c" + "/@xsi:nil", "interest_rate_1__c", "interest_rate_1__c" + "/@xsi:nil", "monthly_cash_flow__c", "monthly_cash_flow__c" + "/@xsi:nil", "noi__c", "noi__c" + "/@xsi:nil", "noi_with_financing_2__c", "noi_with_financing_2__c" + "/@xsi:nil", "noi_with_financing_1__c", "noi_with_financing_1__c" + "/@xsi:nil", "price_per_ft__c", "price_per_ft__c" + "/@xsi:nil", "price__c", "price__c" + "/@xsi:nil", "yearly_interest_payment_1__c", "yearly_interest_payment_1__c" + "/@xsi:nil", "monthly_interest_payment_2__c", "monthly_interest_payment_2__c" + "/@xsi:nil", "interest_payment_1__c", "interest_payment_1__c" + "/@xsi:nil", "down_payment_2__c", "down_payment_2__c" + "/@xsi:nil", "down_payment_1__c", "down_payment_1__c" + "/@xsi:nil", "cash_net_yield__c", "cash_net_yield__c" + "/@xsi:nil", "monthly_management__c", "monthly_management__c" + "/@xsi:nil", "management__c", "management__c" + "/@xsi:nil", "monthly_insurance__c", "monthly_insurance__c" + "/@xsi:nil", "insurance__c", "insurance__c" + "/@xsi:nil", "taxes__c", "taxes__c" + "/@xsi:nil", "monthly_taxes__c", "monthly_taxes__c" + "/@xsi:nil", "monthlyrent__c", "monthlyrent__c" + "/@xsi:nil", "annual_rents__c", "annual_rents__c" + "/@xsi:nil", "est_of_market_value__c", "est_of_market_value__c" + "/@xsi:nil", "est_value_per_rent_multiplier__c", "est_value_per_rent_multiplier__c" + "/@xsi:nil", "estimated_value__c", "estimated_value__c" + "/@xsi:nil", "est_replacement_cost_per_sq_ft__c", "est_replacement_cost_per_sq_ft__c" + "/@xsi:nil", "est_replacement_cost__c", "est_replacement_cost__c" + "/@xsi:nil", "pba__totalarea_pb__c", "pba__totalarea_pb__c" + "/@xsi:nil", "bedrooms__c", "bedrooms__c" + "/@xsi:nil", "bathrooms__c", "bathrooms__c" + "/@xsi:nil" }; boolean[] asXMLs_tFileInputXML_1 = new boolean[] { false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false }; String str_tFileInputXML_1 = ""; String[] node_tFileInputXML_1 = null; org.talend.xml.sax.SAXLooper looper_tFileInputXML_1 = new org.talend.xml.sax.SAXLooper( "/result/listings/listing/data", queryPaths_tFileInputXML_1, asXMLs_tFileInputXML_1); looper_tFileInputXML_1.setEncoding("UTF-8"); Object filename_tFileInputXML_1 = null; try { filename_tFileInputXML_1 = ((java.io.InputStream) globalMap.get("tFileFetch_1_INPUT_STREAM")); } catch (Exception e) { System.err.println(e.getMessage()); } if (filename_tFileInputXML_1 != null && filename_tFileInputXML_1 instanceof String && filename_tFileInputXML_1.toString().startsWith("//")) { if (!isWindows_tFileInputXML_1) { filename_tFileInputXML_1 = filename_tFileInputXML_1.toString().replaceFirst("//", "/"); } } if (filename_tFileInputXML_1 instanceof java.io.InputStream) { looper_tFileInputXML_1.parse((java.io.InputStream) filename_tFileInputXML_1); } else { looper_tFileInputXML_1.parse(String.valueOf(filename_tFileInputXML_1)); } java.util.Iterator<java.util.Map<String, String>> it_tFileInputXML_1 = looper_tFileInputXML_1 .iterator(); while (it_tFileInputXML_1.hasNext()) { java.util.Map<String, String> row_tFileInputXML_1 = it_tFileInputXML_1.next(); nb_line_tFileInputXML_1++; row1 = null; boolean whetherReject_tFileInputXML_1 = false; row1 = new row1Struct(); try { str_tFileInputXML_1 = row_tFileInputXML_1.get("name"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("name" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.name = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1)) { row1.name = ""; } else if (xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.name = null; } else { row1.name = str_tFileInputXML_1; } str_tFileInputXML_1 = row_tFileInputXML_1.get("../media/images/image/url"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("../media/images/image/url" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.image_url = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1)) { row1.image_url = ""; } else if (xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.image_url = null; } else { row1.image_url = str_tFileInputXML_1; } str_tFileInputXML_1 = row_tFileInputXML_1.get("../media/images/image/title"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("../media/images/image/title" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.image_title = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1)) { row1.image_title = ""; } else if (xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.image_title = null; } else { row1.image_title = str_tFileInputXML_1; } str_tFileInputXML_1 = row_tFileInputXML_1.get("pba__propertytype__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("pba__propertytype__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.pba__propertytype__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1)) { row1.pba__propertytype__c = ""; } else if (xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.pba__propertytype__c = null; } else { row1.pba__propertytype__c = str_tFileInputXML_1; } str_tFileInputXML_1 = row_tFileInputXML_1.get("rented_status__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("rented_status__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.rented_status__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1)) { row1.rented_status__c = ""; } else if (xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.rented_status__c = null; } else { row1.rented_status__c = str_tFileInputXML_1; } str_tFileInputXML_1 = row_tFileInputXML_1.get("zipcode__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("zipcode__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.zipcode__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.zipcode__c = null; } else { row1.zipcode__c = ParserUtils.parseTo_Integer(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("pba__city_pb__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("pba__city_pb__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.pba__city_pb__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1)) { row1.pba__city_pb__c = ""; } else if (xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.pba__city_pb__c = null; } else { row1.pba__city_pb__c = str_tFileInputXML_1; } str_tFileInputXML_1 = row_tFileInputXML_1.get("pba__description_pb__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("pba__description_pb__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.pba__description_pb__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1)) { row1.pba__description_pb__c = ""; } else if (xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.pba__description_pb__c = null; } else { row1.pba__description_pb__c = str_tFileInputXML_1; } str_tFileInputXML_1 = row_tFileInputXML_1.get("term_2__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("term_2__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.term_2__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1)) { row1.term_2__c = ""; } else if (xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.term_2__c = null; } else { row1.term_2__c = str_tFileInputXML_1; } str_tFileInputXML_1 = row_tFileInputXML_1.get("term_1__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("term_1__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.term_1__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1)) { row1.term_1__c = ""; } else if (xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.term_1__c = null; } else { row1.term_1__c = str_tFileInputXML_1; } str_tFileInputXML_1 = row_tFileInputXML_1.get("pba__status__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("pba__status__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.pba__status__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1)) { row1.pba__status__c = ""; } else if (xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.pba__status__c = null; } else { row1.pba__status__c = str_tFileInputXML_1; } str_tFileInputXML_1 = row_tFileInputXML_1.get("year_built__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("year_built__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.year_built__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.year_built__c = null; } else { row1.year_built__c = ParserUtils.parseTo_Integer(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("pba__address_pb__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("pba__address_pb__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.pba__address_pb__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1)) { row1.pba__address_pb__c = ""; } else if (xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.pba__address_pb__c = null; } else { row1.pba__address_pb__c = str_tFileInputXML_1; } str_tFileInputXML_1 = row_tFileInputXML_1.get("financed_net_yield_1__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("financed_net_yield_1__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.financed_net_yield_1__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.financed_net_yield_1__c = null; } else { row1.financed_net_yield_1__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("monthly_cash_flow_with_financing_2__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("monthly_cash_flow_with_financing_2__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.monthly_cash_flow_with_financing_2__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.monthly_cash_flow_with_financing_2__c = null; } else { row1.monthly_cash_flow_with_financing_2__c = ParserUtils .parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("financed_net_yield_2__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("financed_net_yield_2__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.financed_net_yield_2__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.financed_net_yield_2__c = null; } else { row1.financed_net_yield_2__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("monthly_cash_flow_with_financing_1__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("monthly_cash_flow_with_financing_1__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.monthly_cash_flow_with_financing_1__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.monthly_cash_flow_with_financing_1__c = null; } else { row1.monthly_cash_flow_with_financing_1__c = ParserUtils .parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("interest_rate_2__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("interest_rate_2__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.interest_rate_2__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.interest_rate_2__c = null; } else { row1.interest_rate_2__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("interest_rate_1__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("interest_rate_1__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.interest_rate_1__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.interest_rate_1__c = null; } else { row1.interest_rate_1__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("monthly_cash_flow__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("monthly_cash_flow__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.monthly_cash_flow__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.monthly_cash_flow__c = null; } else { row1.monthly_cash_flow__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("noi__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("noi__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.noi__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.noi__c = null; } else { row1.noi__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("noi_with_financing_2__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("noi_with_financing_2__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.noi_with_financing_2__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.noi_with_financing_2__c = null; } else { row1.noi_with_financing_2__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("noi_with_financing_1__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("noi_with_financing_1__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.noi_with_financing_1__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.noi_with_financing_1__c = null; } else { row1.noi_with_financing_1__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("price_per_ft__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("price_per_ft__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.price_per_ft__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.price_per_ft__c = null; } else { row1.price_per_ft__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("price__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("price__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.price__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.price__c = null; } else { row1.price__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("yearly_interest_payment_1__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("yearly_interest_payment_1__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.yearly_interest_payment_1__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.yearly_interest_payment_1__c = null; } else { row1.yearly_interest_payment_1__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("monthly_interest_payment_2__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("monthly_interest_payment_2__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.monthly_interest_payment_2__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.monthly_interest_payment_2__c = null; } else { row1.monthly_interest_payment_2__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("interest_payment_1__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("interest_payment_1__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.interest_payment_1__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.interest_payment_1__c = null; } else { row1.interest_payment_1__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("down_payment_2__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("down_payment_2__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.down_payment_2__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.down_payment_2__c = null; } else { row1.down_payment_2__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("down_payment_1__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("down_payment_1__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.down_payment_1__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.down_payment_1__c = null; } else { row1.down_payment_1__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("cash_net_yield__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("cash_net_yield__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.cash_net_yield__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.cash_net_yield__c = null; } else { row1.cash_net_yield__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("monthly_management__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("monthly_management__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.monthly_management__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.monthly_management__c = null; } else { row1.monthly_management__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("management__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("management__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.management__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.management__c = null; } else { row1.management__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("monthly_insurance__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("monthly_insurance__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.monthly_insurance__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.monthly_insurance__c = null; } else { row1.monthly_insurance__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("insurance__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("insurance__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.insurance__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.insurance__c = null; } else { row1.insurance__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("taxes__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("taxes__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.taxes__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.taxes__c = null; } else { row1.taxes__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("monthly_taxes__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("monthly_taxes__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.monthly_taxes__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.monthly_taxes__c = null; } else { row1.monthly_taxes__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("monthlyrent__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("monthlyrent__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.monthlyrent__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.monthlyrent__c = null; } else { row1.monthlyrent__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("annual_rents__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("annual_rents__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.annual_rents__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.annual_rents__c = null; } else { row1.annual_rents__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("est_of_market_value__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("est_of_market_value__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.est_of_market_value__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.est_of_market_value__c = null; } else { row1.est_of_market_value__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("est_value_per_rent_multiplier__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("est_value_per_rent_multiplier__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.est_value_per_rent_multiplier__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.est_value_per_rent_multiplier__c = null; } else { row1.est_value_per_rent_multiplier__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("estimated_value__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("estimated_value__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.estimated_value__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1)) { row1.estimated_value__c = ""; } else if (xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.estimated_value__c = null; } else { row1.estimated_value__c = str_tFileInputXML_1; } str_tFileInputXML_1 = row_tFileInputXML_1.get("est_replacement_cost_per_sq_ft__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("est_replacement_cost_per_sq_ft__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.est_replacement_cost_per_sq_ft__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.est_replacement_cost_per_sq_ft__c = null; } else { row1.est_replacement_cost_per_sq_ft__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("est_replacement_cost__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("est_replacement_cost__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.est_replacement_cost__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.est_replacement_cost__c = null; } else { row1.est_replacement_cost__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("pba__totalarea_pb__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("pba__totalarea_pb__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.pba__totalarea_pb__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.pba__totalarea_pb__c = null; } else { row1.pba__totalarea_pb__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("bedrooms__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("bedrooms__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.bedrooms__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.bedrooms__c = null; } else { row1.bedrooms__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("bathrooms__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("bathrooms__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.bathrooms__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.bathrooms__c = null; } else { row1.bathrooms__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } } catch (Exception e) { whetherReject_tFileInputXML_1 = true; System.err.println(e.getMessage()); row1 = null; } /** * [tFileInputXML_1 begin ] stop */ /** * [tFileInputXML_1 main ] start */ currentComponent = "tFileInputXML_1"; tos_count_tFileInputXML_1++; /** * [tFileInputXML_1 main ] stop */ // Start of branch "row1" if (row1 != null) { /** * [tMap_2 main ] start */ currentComponent = "tMap_2"; boolean hasCasePrimitiveKeyWithNull_tMap_2 = false; // ############################### // # Input tables (lookups) boolean rejectedInnerJoin_tMap_2 = false; boolean mainRowRejected_tMap_2 = false; // ############################### { // start of Var scope // ############################### // # Vars tables Var__tMap_2__Struct Var = Var__tMap_2;// ############################### // ############################### // # Output tables stateInfo = null; propertyData = null; // # Output table : 'stateInfo' stateInfo_tmp.zipcode__c = row1.zipcode__c; stateInfo_tmp.pba__city_pb__c = row1.pba__city_pb__c; stateInfo = stateInfo_tmp; // # Output table : 'propertyData' propertyData_tmp.name = row1.name; propertyData_tmp.image_url = row1.image_url; propertyData_tmp.image_title = row1.image_title; propertyData_tmp.pba__propertytype__c = row1.pba__propertytype__c; propertyData_tmp.rented_status__c = row1.rented_status__c; propertyData_tmp.zipcode__c = row1.zipcode__c; propertyData_tmp.pba__city_pb__c = row1.pba__city_pb__c; propertyData_tmp.pba__description_pb__c = row1.pba__description_pb__c; propertyData_tmp.term_2__c = row1.term_2__c; propertyData_tmp.term_1__c = row1.term_1__c; propertyData_tmp.pba__status__c = row1.pba__status__c; propertyData_tmp.year_built__c = row1.year_built__c; propertyData_tmp.pba__address_pb__c = row1.pba__address_pb__c; propertyData_tmp.financed_net_yield_1__c = row1.financed_net_yield_1__c; propertyData_tmp.monthly_cash_flow_with_financing_2__c = row1.monthly_cash_flow_with_financing_2__c; propertyData_tmp.financed_net_yield_2__c = row1.financed_net_yield_2__c; propertyData_tmp.monthly_cash_flow_with_financing_1__c = row1.monthly_cash_flow_with_financing_1__c; propertyData_tmp.interest_rate_2__c = row1.interest_rate_2__c; propertyData_tmp.interest_rate_1__c = row1.interest_rate_1__c; propertyData_tmp.monthly_cash_flow__c = row1.monthly_cash_flow__c; propertyData_tmp.noi__c = row1.noi__c; propertyData_tmp.noi_with_financing_2__c = row1.noi_with_financing_2__c; propertyData_tmp.noi_with_financing_1__c = row1.noi_with_financing_1__c; propertyData_tmp.price_per_ft__c = row1.price_per_ft__c; propertyData_tmp.price__c = row1.price__c; propertyData_tmp.yearly_interest_payment_1__c = row1.yearly_interest_payment_1__c; propertyData_tmp.monthly_interest_payment_2__c = row1.monthly_interest_payment_2__c; propertyData_tmp.interest_payment_1__c = row1.interest_payment_1__c; propertyData_tmp.down_payment_2__c = row1.down_payment_2__c; propertyData_tmp.down_payment_1__c = row1.down_payment_1__c; propertyData_tmp.cash_net_yield__c = row1.cash_net_yield__c; propertyData_tmp.monthly_management__c = row1.monthly_management__c; propertyData_tmp.management__c = row1.management__c; propertyData_tmp.monthly_insurance__c = row1.monthly_insurance__c; propertyData_tmp.insurance__c = row1.insurance__c; propertyData_tmp.taxes__c = row1.taxes__c; propertyData_tmp.monthly_taxes__c = row1.monthly_taxes__c; propertyData_tmp.monthlyrent__c = row1.monthlyrent__c; propertyData_tmp.annual_rents__c = row1.annual_rents__c; propertyData_tmp.est_of_market_value__c = row1.est_of_market_value__c; propertyData_tmp.est_value_per_rent_multiplier__c = row1.est_value_per_rent_multiplier__c; propertyData_tmp.estimated_value__c = row1.estimated_value__c; propertyData_tmp.est_replacement_cost_per_sq_ft__c = row1.est_replacement_cost_per_sq_ft__c; propertyData_tmp.est_replacement_cost__c = row1.est_replacement_cost__c; propertyData_tmp.pba__totalarea_pb__c = row1.pba__totalarea_pb__c; propertyData_tmp.bedrooms__c = row1.bedrooms__c; propertyData_tmp.bathrooms__c = row1.bathrooms__c; propertyData = propertyData_tmp; // ############################### } // end of Var scope rejectedInnerJoin_tMap_2 = false; tos_count_tMap_2++; /** * [tMap_2 main ] stop */ // Start of branch "stateInfo" if (stateInfo != null) { /** * [tFlowToIterate_1 main ] start */ currentComponent = "tFlowToIterate_1"; globalMap.put("zipCode", stateInfo.zipcode__c); nb_line_tFlowToIterate_1++; counter_tFlowToIterate_1++; globalMap.put("tFlowToIterate_1_CURRENT_ITERATION", counter_tFlowToIterate_1); tos_count_tFlowToIterate_1++; /** * [tFlowToIterate_1 main ] stop */ NB_ITERATE_tFileInputJSON_1++; iterateLoop++; /** * [tMysqlOutput_4 begin ] start */ ok_Hash.put("tMysqlOutput_4", false); start_Hash.put("tMysqlOutput_4", System.currentTimeMillis()); currentComponent = "tMysqlOutput_4"; int tos_count_tMysqlOutput_4 = 0; int nb_line_tMysqlOutput_4 = 0; int nb_line_update_tMysqlOutput_4 = 0; int nb_line_inserted_tMysqlOutput_4 = 0; int nb_line_deleted_tMysqlOutput_4 = 0; int nb_line_rejected_tMysqlOutput_4 = 0; int deletedCount_tMysqlOutput_4 = 0; int updatedCount_tMysqlOutput_4 = 0; int insertedCount_tMysqlOutput_4 = 0; int rejectedCount_tMysqlOutput_4 = 0; String tableName_tMysqlOutput_4 = "STATE_INFO"; boolean whetherReject_tMysqlOutput_4 = false; java.util.Calendar calendar_tMysqlOutput_4 = java.util.Calendar.getInstance(); calendar_tMysqlOutput_4.set(1, 0, 1, 0, 0, 0); long year1_tMysqlOutput_4 = calendar_tMysqlOutput_4.getTime().getTime(); calendar_tMysqlOutput_4.set(10000, 0, 1, 0, 0, 0); long year10000_tMysqlOutput_4 = calendar_tMysqlOutput_4.getTime().getTime(); long date_tMysqlOutput_4; java.sql.Connection conn_tMysqlOutput_4 = null; java.util.Map<String, routines.system.TalendDataSource> dataSources_tMysqlOutput_4 = (java.util.Map<String, routines.system.TalendDataSource>) globalMap .get(KEY_DB_DATASOURCES); if (null != dataSources_tMysqlOutput_4) { conn_tMysqlOutput_4 = dataSources_tMysqlOutput_4.get("").getConnection(); } else { String dbProperties_tMysqlOutput_4 = "noDatetimeStringSync=true"; String url_tMysqlOutput_4 = null; if (dbProperties_tMysqlOutput_4 == null || dbProperties_tMysqlOutput_4.trim().length() == 0) { url_tMysqlOutput_4 = "jdbc:mysql://" + "192.168.1.201" + ":" + "3306" + "/" + "TALONDB" + "?" + "rewriteBatchedStatements=true"; } else { String properties_tMysqlOutput_4 = "noDatetimeStringSync=true"; if (!properties_tMysqlOutput_4.contains("rewriteBatchedStatements")) { properties_tMysqlOutput_4 += "&rewriteBatchedStatements=true"; } url_tMysqlOutput_4 = "jdbc:mysql://" + "192.168.1.201" + ":" + "3306" + "/" + "TALONDB" + "?" + properties_tMysqlOutput_4; } String dbUser_tMysqlOutput_4 = "dbAdmin"; String dbPwd_tMysqlOutput_4 = "1nn0s2013"; java.lang.Class.forName("org.gjt.mm.mysql.Driver"); conn_tMysqlOutput_4 = java.sql.DriverManager.getConnection(url_tMysqlOutput_4, dbUser_tMysqlOutput_4, dbPwd_tMysqlOutput_4); } conn_tMysqlOutput_4.setAutoCommit(false); int commitEvery_tMysqlOutput_4 = 1; int commitCounter_tMysqlOutput_4 = 0; int count_tMysqlOutput_4 = 0; String insert_tMysqlOutput_4 = "INSERT INTO `" + "STATE_INFO" + "` (`ID`,`STATE`,`CITY`,`ZIP`) VALUES (?,?,?,?)"; int batchSize_tMysqlOutput_4 = 1; int batchSizeCounter_tMysqlOutput_4 = 0; java.sql.PreparedStatement pstmt_tMysqlOutput_4 = conn_tMysqlOutput_4 .prepareStatement(insert_tMysqlOutput_4); /** * [tMysqlOutput_4 begin ] stop */ /** * [tMap_3 begin ] start */ ok_Hash.put("tMap_3", false); start_Hash.put("tMap_3", System.currentTimeMillis()); currentComponent = "tMap_3"; int tos_count_tMap_3 = 0; // ############################### // # Lookup's keys initialization // ############################### // ############################### // # Vars initialization class Var__tMap_3__Struct { } Var__tMap_3__Struct Var__tMap_3 = new Var__tMap_3__Struct(); // ############################### // ############################### // # Outputs initialization loadNewStateInfoStruct loadNewStateInfo_tmp = new loadNewStateInfoStruct(); // ############################### /** * [tMap_3 begin ] stop */ /** * [tJoin_1 begin ] start */ ok_Hash.put("tJoin_1", false); start_Hash.put("tJoin_1", System.currentTimeMillis()); currentComponent = "tJoin_1"; int tos_count_tJoin_1 = 0; final java.util.Map<row4Struct, row4Struct> tHash_tJoin_1 = (java.util.Map<row4Struct, row4Struct>) globalMap .get("tHash_row4"); class Util_tJoin_1 { row4Struct lookupValue = null; row4Struct row4HashKey = new row4Struct(); public boolean isJoined(row3Struct mainRow) { row4HashKey.ZIP = mainRow.zip; row4HashKey.hashCodeDirty = true; lookupValue = tHash_tJoin_1.get(row4HashKey); if (lookupValue != null) { return true; } return false; } } Util_tJoin_1 util_tJoin_1 = new Util_tJoin_1(); int nb_line_tJoin_1 = 0; /** * [tJoin_1 begin ] stop */ /** * [tJavaRow_1 begin ] start */ ok_Hash.put("tJavaRow_1", false); start_Hash.put("tJavaRow_1", System.currentTimeMillis()); currentComponent = "tJavaRow_1"; int tos_count_tJavaRow_1 = 0; int nb_line_tJavaRow_1 = 0; /** * [tJavaRow_1 begin ] stop */ /** * [tFileInputJSON_1 begin ] start */ ok_Hash.put("tFileInputJSON_1", false); start_Hash.put("tFileInputJSON_1", System.currentTimeMillis()); currentComponent = "tFileInputJSON_1"; int tos_count_tFileInputJSON_1 = 0; class JSONUtil_tFileInputJSON_1 { public int getData(String query, javax.script.Invocable invocableEngine, java.util.List<org.json.simple.JSONArray> jsonResultList, int recordMaxSize) { try { // only 2 types: String/Boolean String resultObj = invocableEngine.invokeFunction("jsonPath", query) .toString(); if (!"false".equals(resultObj)) { org.json.simple.JSONArray resultArray = (org.json.simple.JSONArray) org.json.simple.JSONValue .parse(resultObj); jsonResultList.add(resultArray); if (recordMaxSize != -1 && recordMaxSize != resultArray.size()) { // just give an error, don't // stop System.err.println( "The Json resource datas maybe have some problems, please make sure the data structure with the same fields."); } recordMaxSize = Math.max(recordMaxSize, resultArray.size()); } else { System.err.println("Can't find any data with JSONPath " + query); // add null to take a place in // List(buffer) jsonResultList.add(null); } } catch (Exception e) { e.printStackTrace(); } return recordMaxSize; } void setRowValue_0(row2Struct row2, java.util.List<org.json.simple.JSONArray> JSONResultList_tFileInputJSON_1, int nbResultArray_tFileInputJSON_1) throws java.io.UnsupportedEncodingException { if (JSONResultList_tFileInputJSON_1.get(0) != null && nbResultArray_tFileInputJSON_1 < JSONResultList_tFileInputJSON_1 .get(0).size() && JSONResultList_tFileInputJSON_1.get(0) .get(nbResultArray_tFileInputJSON_1) != null) { row2.city = JSONResultList_tFileInputJSON_1.get(0) .get(nbResultArray_tFileInputJSON_1).toString(); } else { row2.city = null; } if (JSONResultList_tFileInputJSON_1.get(1) != null && nbResultArray_tFileInputJSON_1 < JSONResultList_tFileInputJSON_1 .get(1).size() && JSONResultList_tFileInputJSON_1.get(1) .get(nbResultArray_tFileInputJSON_1) != null) { row2.state = JSONResultList_tFileInputJSON_1.get(1) .get(nbResultArray_tFileInputJSON_1).toString(); } else { row2.state = null; } if (JSONResultList_tFileInputJSON_1.get(2) != null && nbResultArray_tFileInputJSON_1 < JSONResultList_tFileInputJSON_1 .get(2).size() && JSONResultList_tFileInputJSON_1.get(2) .get(nbResultArray_tFileInputJSON_1) != null) { row2.country = JSONResultList_tFileInputJSON_1.get(2) .get(nbResultArray_tFileInputJSON_1).toString(); } else { row2.country = null; } } } int nb_line_tFileInputJSON_1 = 0; javax.script.ScriptEngineManager scriptEngineMgr_tFileInputJSON_1 = new javax.script.ScriptEngineManager(); javax.script.ScriptEngine jsEngine_tFileInputJSON_1 = scriptEngineMgr_tFileInputJSON_1 .getEngineByName("JavaScript"); if (jsEngine_tFileInputJSON_1 == null) { System.err.println("No script engine found for JavaScript"); } java.io.InputStream jsonis_tFileInputJSON_1 = com.jsonpath.test.ReadJar.class .getResource("json.js").openStream(); jsEngine_tFileInputJSON_1.eval(new java.io.BufferedReader( new java.io.InputStreamReader(jsonis_tFileInputJSON_1))); java.io.InputStream jsonpathis_tFileInputJSON_1 = com.jsonpath.test.ReadJar.class .getResource("jsonpath.js").openStream(); jsEngine_tFileInputJSON_1.eval(new java.io.BufferedReader( new java.io.InputStreamReader(jsonpathis_tFileInputJSON_1))); java.net.URL url_tFileInputJSON_1 = new java.net.URL( "http://ziptasticapi.com/" + ((Integer) globalMap.get("zipCode"))); java.net.URLConnection urlConn_tFileInputJSON_1 = url_tFileInputJSON_1.openConnection(); java.io.InputStreamReader fr_tFileInputJSON_1 = new java.io.InputStreamReader( urlConn_tFileInputJSON_1.getInputStream(), "UTF-8"); java.lang.Object jsonText_tFileInputJSON_1 = org.json.simple.JSONValue .parse(fr_tFileInputJSON_1); jsEngine_tFileInputJSON_1.eval("var obj=" + jsonText_tFileInputJSON_1.toString()); java.util.List<org.json.simple.JSONArray> JSONResultList_tFileInputJSON_1 = new java.util.ArrayList<org.json.simple.JSONArray>(); int recordMaxSize_tFileInputJSON_1 = -1; javax.script.Invocable invocableEngine_tFileInputJSON_1 = (javax.script.Invocable) jsEngine_tFileInputJSON_1; JSONUtil_tFileInputJSON_1 jsonUtil_tFileInputJSON_1 = new JSONUtil_tFileInputJSON_1(); recordMaxSize_tFileInputJSON_1 = jsonUtil_tFileInputJSON_1.getData("city", invocableEngine_tFileInputJSON_1, JSONResultList_tFileInputJSON_1, recordMaxSize_tFileInputJSON_1); recordMaxSize_tFileInputJSON_1 = jsonUtil_tFileInputJSON_1.getData("state", invocableEngine_tFileInputJSON_1, JSONResultList_tFileInputJSON_1, recordMaxSize_tFileInputJSON_1); recordMaxSize_tFileInputJSON_1 = jsonUtil_tFileInputJSON_1.getData("country", invocableEngine_tFileInputJSON_1, JSONResultList_tFileInputJSON_1, recordMaxSize_tFileInputJSON_1); for (int nbResultArray_tFileInputJSON_1 = 0; nbResultArray_tFileInputJSON_1 < recordMaxSize_tFileInputJSON_1; nbResultArray_tFileInputJSON_1++) { nb_line_tFileInputJSON_1++; jsonUtil_tFileInputJSON_1.setRowValue_0(row2, JSONResultList_tFileInputJSON_1, nbResultArray_tFileInputJSON_1); /** * [tFileInputJSON_1 begin ] stop */ /** * [tFileInputJSON_1 main ] start */ currentComponent = "tFileInputJSON_1"; tos_count_tFileInputJSON_1++; /** * [tFileInputJSON_1 main ] stop */ /** * [tJavaRow_1 main ] start */ currentComponent = "tJavaRow_1"; // Code generated according to input schema and // output schema row3.city = row2.city; row3.state = row2.state; row3.country = row2.country; row3.zip = ((Integer) globalMap.get("zipCode")); nb_line_tJavaRow_1++; tos_count_tJavaRow_1++; /** * [tJavaRow_1 main ] stop */ /** * [tJoin_1 main ] start */ currentComponent = "tJoin_1"; row5 = null; row5 = new row5Struct(); row5.city = row3.city; row5.state = row3.state; row5.country = row3.country; row5.zip = row3.zip; if (util_tJoin_1.isJoined(row3)) { row5 = null; } else { } // ///////////////////// tos_count_tJoin_1++; /** * [tJoin_1 main ] stop */ // Start of branch "row5" if (row5 != null) { /** * [tMap_3 main ] start */ currentComponent = "tMap_3"; boolean hasCasePrimitiveKeyWithNull_tMap_3 = false; // ############################### // # Input tables (lookups) boolean rejectedInnerJoin_tMap_3 = false; boolean mainRowRejected_tMap_3 = false; // ############################### { // start of Var scope // ############################### // # Vars tables Var__tMap_3__Struct Var = Var__tMap_3;// ############################### // ############################### // # Output tables loadNewStateInfo = null; // # Output table : 'loadNewStateInfo' loadNewStateInfo_tmp.ID = 0; loadNewStateInfo_tmp.STATE = row5.state; loadNewStateInfo_tmp.CITY = row5.city; loadNewStateInfo_tmp.ZIP = row5.zip; loadNewStateInfo = loadNewStateInfo_tmp; // ############################### } // end of Var scope rejectedInnerJoin_tMap_3 = false; tos_count_tMap_3++; /** * [tMap_3 main ] stop */ // Start of branch "loadNewStateInfo" if (loadNewStateInfo != null) { /** * [tMysqlOutput_4 main ] start */ currentComponent = "tMysqlOutput_4"; whetherReject_tMysqlOutput_4 = false; pstmt_tMysqlOutput_4.setInt(1, loadNewStateInfo.ID); if (loadNewStateInfo.STATE == null) { pstmt_tMysqlOutput_4.setNull(2, java.sql.Types.VARCHAR); } else { pstmt_tMysqlOutput_4.setString(2, loadNewStateInfo.STATE); } if (loadNewStateInfo.CITY == null) { pstmt_tMysqlOutput_4.setNull(3, java.sql.Types.VARCHAR); } else { pstmt_tMysqlOutput_4.setString(3, loadNewStateInfo.CITY); } pstmt_tMysqlOutput_4.setInt(4, loadNewStateInfo.ZIP); pstmt_tMysqlOutput_4.addBatch(); nb_line_tMysqlOutput_4++; batchSizeCounter_tMysqlOutput_4++; if (batchSize_tMysqlOutput_4 <= batchSizeCounter_tMysqlOutput_4) { try { int countSum_tMysqlOutput_4 = 0; for (int countEach_tMysqlOutput_4 : pstmt_tMysqlOutput_4 .executeBatch()) { countSum_tMysqlOutput_4 += (countEach_tMysqlOutput_4 < 0 ? 0 : countEach_tMysqlOutput_4); } insertedCount_tMysqlOutput_4 += countSum_tMysqlOutput_4; } catch (java.sql.BatchUpdateException e) { int countSum_tMysqlOutput_4 = 0; for (int countEach_tMysqlOutput_4 : e.getUpdateCounts()) { countSum_tMysqlOutput_4 += (countEach_tMysqlOutput_4 < 0 ? 0 : countEach_tMysqlOutput_4); } insertedCount_tMysqlOutput_4 += countSum_tMysqlOutput_4; System.err.println(e.getMessage()); } batchSizeCounter_tMysqlOutput_4 = 0; } commitCounter_tMysqlOutput_4++; if (commitEvery_tMysqlOutput_4 <= commitCounter_tMysqlOutput_4) { try { int countSum_tMysqlOutput_4 = 0; for (int countEach_tMysqlOutput_4 : pstmt_tMysqlOutput_4 .executeBatch()) { countSum_tMysqlOutput_4 += (countEach_tMysqlOutput_4 < 0 ? 0 : countEach_tMysqlOutput_4); } insertedCount_tMysqlOutput_4 += countSum_tMysqlOutput_4; } catch (java.sql.BatchUpdateException e) { int countSum_tMysqlOutput_4 = 0; for (int countEach_tMysqlOutput_4 : e.getUpdateCounts()) { countSum_tMysqlOutput_4 += (countEach_tMysqlOutput_4 < 0 ? 0 : countEach_tMysqlOutput_4); } insertedCount_tMysqlOutput_4 += countSum_tMysqlOutput_4; System.out.println(e.getMessage()); } conn_tMysqlOutput_4.commit(); commitCounter_tMysqlOutput_4 = 0; } tos_count_tMysqlOutput_4++; /** * [tMysqlOutput_4 main ] stop */ } // End of branch "loadNewStateInfo" } // End of branch "row5" /** * [tFileInputJSON_1 end ] start */ currentComponent = "tFileInputJSON_1"; } globalMap.put("tFileInputJSON_1_NB_LINE", nb_line_tFileInputJSON_1); ok_Hash.put("tFileInputJSON_1", true); end_Hash.put("tFileInputJSON_1", System.currentTimeMillis()); /** * [tFileInputJSON_1 end ] stop */ /** * [tJavaRow_1 end ] start */ currentComponent = "tJavaRow_1"; globalMap.put("tJavaRow_1_NB_LINE", nb_line_tJavaRow_1); ok_Hash.put("tJavaRow_1", true); end_Hash.put("tJavaRow_1", System.currentTimeMillis()); /** * [tJavaRow_1 end ] stop */ /** * [tJoin_1 end ] start */ currentComponent = "tJoin_1"; ok_Hash.put("tJoin_1", true); end_Hash.put("tJoin_1", System.currentTimeMillis()); /** * [tJoin_1 end ] stop */ /** * [tMap_3 end ] start */ currentComponent = "tMap_3"; // ############################### // # Lookup hashes releasing // ############################### ok_Hash.put("tMap_3", true); end_Hash.put("tMap_3", System.currentTimeMillis()); /** * [tMap_3 end ] stop */ /** * [tMysqlOutput_4 end ] start */ currentComponent = "tMysqlOutput_4"; try { if (batchSizeCounter_tMysqlOutput_4 != 0) { int countSum_tMysqlOutput_4 = 0; for (int countEach_tMysqlOutput_4 : pstmt_tMysqlOutput_4.executeBatch()) { countSum_tMysqlOutput_4 += (countEach_tMysqlOutput_4 < 0 ? 0 : countEach_tMysqlOutput_4); } insertedCount_tMysqlOutput_4 += countSum_tMysqlOutput_4; } } catch (java.sql.BatchUpdateException e) { int countSum_tMysqlOutput_4 = 0; for (int countEach_tMysqlOutput_4 : e.getUpdateCounts()) { countSum_tMysqlOutput_4 += (countEach_tMysqlOutput_4 < 0 ? 0 : countEach_tMysqlOutput_4); } insertedCount_tMysqlOutput_4 += countSum_tMysqlOutput_4; System.err.println(e.getMessage()); } batchSizeCounter_tMysqlOutput_4 = 0; try { if (pstmt_tMysqlOutput_4 != null) { int countSum_tMysqlOutput_4 = 0; for (int countEach_tMysqlOutput_4 : pstmt_tMysqlOutput_4.executeBatch()) { countSum_tMysqlOutput_4 += (countEach_tMysqlOutput_4 < 0 ? 0 : countEach_tMysqlOutput_4); } insertedCount_tMysqlOutput_4 += countSum_tMysqlOutput_4; } } catch (java.sql.BatchUpdateException e) { int countSum_tMysqlOutput_4 = 0; for (int countEach_tMysqlOutput_4 : e.getUpdateCounts()) { countSum_tMysqlOutput_4 += (countEach_tMysqlOutput_4 < 0 ? 0 : countEach_tMysqlOutput_4); } insertedCount_tMysqlOutput_4 += countSum_tMysqlOutput_4; System.out.println(e.getMessage()); } if (pstmt_tMysqlOutput_4 != null) { pstmt_tMysqlOutput_4.close(); } conn_tMysqlOutput_4.commit(); conn_tMysqlOutput_4.close(); nb_line_deleted_tMysqlOutput_4 = nb_line_deleted_tMysqlOutput_4 + deletedCount_tMysqlOutput_4; nb_line_update_tMysqlOutput_4 = nb_line_update_tMysqlOutput_4 + updatedCount_tMysqlOutput_4; nb_line_inserted_tMysqlOutput_4 = nb_line_inserted_tMysqlOutput_4 + insertedCount_tMysqlOutput_4; nb_line_rejected_tMysqlOutput_4 = nb_line_rejected_tMysqlOutput_4 + rejectedCount_tMysqlOutput_4; globalMap.put("tMysqlOutput_4_NB_LINE", nb_line_tMysqlOutput_4); globalMap.put("tMysqlOutput_4_NB_LINE_UPDATED", nb_line_update_tMysqlOutput_4); globalMap.put("tMysqlOutput_4_NB_LINE_INSERTED", nb_line_inserted_tMysqlOutput_4); globalMap.put("tMysqlOutput_4_NB_LINE_DELETED", nb_line_deleted_tMysqlOutput_4); globalMap.put("tMysqlOutput_4_NB_LINE_REJECTED", nb_line_rejected_tMysqlOutput_4); ok_Hash.put("tMysqlOutput_4", true); end_Hash.put("tMysqlOutput_4", System.currentTimeMillis()); /** * [tMysqlOutput_4 end ] stop */ } // End of branch "stateInfo" // Start of branch "propertyData" if (propertyData != null) { row9 = null; /** * [tMap_1 main ] start */ currentComponent = "tMap_1"; boolean hasCasePrimitiveKeyWithNull_tMap_1 = false; // ############################### // # Input tables (lookups) boolean rejectedInnerJoin_tMap_1 = false; boolean mainRowRejected_tMap_1 = false; // ///////////////////////////////////////////// // Starting Lookup Table "row6" // ///////////////////////////////////////////// boolean forceLooprow6 = false; row6Struct row6ObjectFromLookup = null; if (!rejectedInnerJoin_tMap_1) { // G_TM_M_020 hasCasePrimitiveKeyWithNull_tMap_1 = false; Object exprKeyValue_row6__ZIP = propertyData.zipcode__c; if (exprKeyValue_row6__ZIP == null) { hasCasePrimitiveKeyWithNull_tMap_1 = true; } else { row6HashKey.ZIP = (int) (Integer) exprKeyValue_row6__ZIP; } row6HashKey.hashCodeDirty = true; if (!hasCasePrimitiveKeyWithNull_tMap_1) { // G_TM_M_091 tHash_Lookup_Cache_row6.lookup(row6HashKey); if (tHash_Lookup_Cache_row6.hasNext()) { // G_TM_M_835 tHash_Lookup_row6 = tHash_Lookup_Cache_row6; } // G_TM_M_834 else { // G_TM_M_835 tMysqlInput_2Process(globalMap); tHash_Lookup_row6 = (org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row6Struct>) ((org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row6Struct>) globalMap .get("tHash_Lookup_row6")); tHash_Lookup_row6.initGet(); tHash_Lookup_row6.lookup(row6HashKey); } // G_TM_M_835 } // G_TM_M_091 if (hasCasePrimitiveKeyWithNull_tMap_1 || !tHash_Lookup_row6.hasNext()) { // G_TM_M_090 rejectedInnerJoin_tMap_1 = true; } // G_TM_M_090 } // G_TM_M_020 if (tHash_Lookup_row6 != null && tHash_Lookup_row6.getCount(row6HashKey) > 1) { // G // 071 // System.out.println("WARNING: UNIQUE MATCH is configured for the lookup 'row6' and it contains more one result from keys : row6.ZIP = '" // + row6HashKey.ZIP + "'"); } // G 071 row6Struct row6 = null; row6Struct fromLookup_row6 = null; row6 = row6Default; if (tHash_Lookup_row6 != null && tHash_Lookup_row6.hasNext()) { // G 099 fromLookup_row6 = tHash_Lookup_row6.next(); } // G 099 if (fromLookup_row6 != null) { row6 = fromLookup_row6; } if (tHash_Lookup_Cache_row6 != tHash_Lookup_row6) { tHash_Lookup_Cache_row6.put(row6); } // ############################### { // start of Var scope // ############################### // # Vars tables Var__tMap_1__Struct Var = Var__tMap_1;// ############################### // ############################### // # Output tables mappedData = null; if (!rejectedInnerJoin_tMap_1) { // # Output table : 'mappedData' mappedData_tmp.PROP_NAME = propertyData.name; mappedData_tmp.PRICE = propertyData.price__c; mappedData_tmp.SQFT = "1500"; mappedData_tmp.DESCRIPTION = propertyData.pba__description_pb__c; mappedData_tmp.NUM_BEDS = propertyData.bedrooms__c; mappedData_tmp.NUM_BATHS = propertyData.bathrooms__c; mappedData_tmp.STATE_INFO_ID = row6.ID; mappedData_tmp.customer = context.cusomterName; mappedData_tmp.status = propertyData.pba__status__c; mappedData_tmp.type = propertyData.pba__propertytype__c; mappedData = mappedData_tmp; } // closing inner join bracket (2) // ############################### } // end of Var scope rejectedInnerJoin_tMap_1 = false; tos_count_tMap_1++; /** * [tMap_1 main ] stop */ // Start of branch "mappedData" if (mappedData != null) { row9 = null; /** * [tMap_4 main ] start */ currentComponent = "tMap_4"; boolean hasCasePrimitiveKeyWithNull_tMap_4 = false; // ############################### // # Input tables (lookups) boolean rejectedInnerJoin_tMap_4 = false; boolean mainRowRejected_tMap_4 = false; // ///////////////////////////////////////////// // Starting Lookup Table "custData" // ///////////////////////////////////////////// boolean forceLoopcustData = false; custDataStruct custDataObjectFromLookup = null; if (!rejectedInnerJoin_tMap_4) { // G_TM_M_020 hasCasePrimitiveKeyWithNull_tMap_4 = false; custDataHashKey.CUST_NAME = mappedData.customer; custDataHashKey.hashCodeDirty = true; tHash_Lookup_custData.lookup(custDataHashKey); if (!tHash_Lookup_custData.hasNext()) { // G_TM_M_090 rejectedInnerJoin_tMap_4 = true; } // G_TM_M_090 } // G_TM_M_020 if (tHash_Lookup_custData != null && tHash_Lookup_custData.getCount(custDataHashKey) > 1) { // G // 071 // System.out.println("WARNING: UNIQUE MATCH is configured for the lookup 'custData' and it contains more one result from keys : custData.CUST_NAME = '" // + custDataHashKey.CUST_NAME + "'"); } // G 071 custDataStruct custData = null; custDataStruct fromLookup_custData = null; custData = custDataDefault; if (tHash_Lookup_custData != null && tHash_Lookup_custData.hasNext()) { // G // 099 fromLookup_custData = tHash_Lookup_custData.next(); } // G 099 if (fromLookup_custData != null) { custData = fromLookup_custData; } // ############################### { // start of Var scope // ############################### // # Vars tables Var__tMap_4__Struct Var = Var__tMap_4;// ############################### // ############################### // # Output tables loadData = null; if (!rejectedInnerJoin_tMap_4) { // # Output table : 'loadData' loadData_tmp.PROP_NAME = mappedData.PROP_NAME; loadData_tmp.PRICE = mappedData.PRICE; loadData_tmp.SQFT = mappedData.SQFT; loadData_tmp.DESCRIPTION = mappedData.DESCRIPTION; loadData_tmp.NUM_BEDS = mappedData.NUM_BEDS; loadData_tmp.NUM_BATHS = mappedData.NUM_BATHS; loadData_tmp.TYPE = mappedData.type; loadData_tmp.STATUS = mappedData.status; loadData_tmp.STATE_INFO_ID = mappedData.STATE_INFO_ID; loadData_tmp.DATA_SOURCE_ID = custData.DATA_SOURCE_ID; loadData = loadData_tmp; } // closing inner join bracket (2) // ############################### } // end of Var scope rejectedInnerJoin_tMap_4 = false; tos_count_tMap_4++; /** * [tMap_4 main ] stop */ // Start of branch "loadData" if (loadData != null) { row9 = null; /** * [tJoin_3 main ] start */ currentComponent = "tJoin_3"; row9 = null; row9 = new row9Struct(); row9.PROP_NAME = loadData.PROP_NAME; row9.PRICE = loadData.PRICE; row9.SQFT = loadData.SQFT; row9.DESCRIPTION = loadData.DESCRIPTION; row9.NUM_BEDS = loadData.NUM_BEDS; row9.NUM_BATHS = loadData.NUM_BATHS; row9.TYPE = loadData.TYPE; row9.STATUS = loadData.STATUS; row9.STATE_INFO_ID = loadData.STATE_INFO_ID; row9.DATA_SOURCE_ID = loadData.DATA_SOURCE_ID; if (util_tJoin_3.isJoined(loadData)) { row9 = null; } else { } // ///////////////////// tos_count_tJoin_3++; /** * [tJoin_3 main ] stop */ // Start of branch "row9" if (row9 != null) { /** * [tJavaRow_3 main ] start */ currentComponent = "tJavaRow_3"; // Code generated according to input // schema and output schema System.out.println( "***** Loading New Property Data for:" + row9.PROP_NAME + " *****"); row14.PROP_NAME = row9.PROP_NAME; row14.PRICE = row9.PRICE; row14.SQFT = row9.SQFT; row14.DESCRIPTION = row9.DESCRIPTION; row14.NUM_BEDS = row9.NUM_BEDS; row14.NUM_BATHS = row9.NUM_BATHS; row14.TYPE = row9.TYPE; row14.STATUS = row9.STATUS; row14.STATE_INFO_ID = row9.STATE_INFO_ID; row14.DATA_SOURCE_ID = row9.DATA_SOURCE_ID; row14.PROP_UUID = UUID.randomUUID().toString(); nb_line_tJavaRow_3++; tos_count_tJavaRow_3++; /** * [tJavaRow_3 main ] stop */ /** * [tMap_8 main ] start */ currentComponent = "tMap_8"; boolean hasCasePrimitiveKeyWithNull_tMap_8 = false; // ############################### // # Input tables (lookups) boolean rejectedInnerJoin_tMap_8 = false; boolean mainRowRejected_tMap_8 = false; // ############################### { // start of Var scope // ############################### // # Vars tables Var__tMap_8__Struct Var = Var__tMap_8;// ############################### // ############################### // # Output tables mainPropertyDataLoad = null; // # Output table : // 'mainPropertyDataLoad' mainPropertyDataLoad_tmp.ID = 0; mainPropertyDataLoad_tmp.UUID = row14.PROP_UUID; mainPropertyDataLoad_tmp.PROP_NAME = row14.PROP_NAME; mainPropertyDataLoad_tmp.PRICE = row14.PRICE; mainPropertyDataLoad_tmp.SQFT = row14.SQFT; mainPropertyDataLoad_tmp.DESCRIPTION = row14.DESCRIPTION; mainPropertyDataLoad_tmp.NUM_BEDS = row14.NUM_BEDS; mainPropertyDataLoad_tmp.NUM_BATHS = row14.NUM_BATHS; mainPropertyDataLoad_tmp.TYPE = row14.TYPE; mainPropertyDataLoad_tmp.STATUS = row14.STATUS; mainPropertyDataLoad_tmp.STATE_INFO_ID = row14.STATE_INFO_ID; mainPropertyDataLoad_tmp.DATA_SOURCE_ID = row14.DATA_SOURCE_ID; mainPropertyDataLoad = mainPropertyDataLoad_tmp; // ############################### } // end of Var scope rejectedInnerJoin_tMap_8 = false; tos_count_tMap_8++; /** * [tMap_8 main ] stop */ // Start of branch // "mainPropertyDataLoad" if (mainPropertyDataLoad != null) { /** * [tMysqlOutput_1 main ] start */ currentComponent = "tMysqlOutput_1"; whetherReject_tMysqlOutput_1 = false; pstmt_tMysqlOutput_1.setInt(1, mainPropertyDataLoad.ID); if (mainPropertyDataLoad.UUID == null) { pstmt_tMysqlOutput_1.setNull(2, java.sql.Types.VARCHAR); } else { pstmt_tMysqlOutput_1.setString(2, mainPropertyDataLoad.UUID); } if (mainPropertyDataLoad.PROP_NAME == null) { pstmt_tMysqlOutput_1.setNull(3, java.sql.Types.VARCHAR); } else { pstmt_tMysqlOutput_1.setString(3, mainPropertyDataLoad.PROP_NAME); } pstmt_tMysqlOutput_1.setFloat(4, mainPropertyDataLoad.PRICE); if (mainPropertyDataLoad.SQFT == null) { pstmt_tMysqlOutput_1.setNull(5, java.sql.Types.VARCHAR); } else { pstmt_tMysqlOutput_1.setString(5, mainPropertyDataLoad.SQFT); } if (mainPropertyDataLoad.DESCRIPTION == null) { pstmt_tMysqlOutput_1.setNull(6, java.sql.Types.VARCHAR); } else { pstmt_tMysqlOutput_1.setString(6, mainPropertyDataLoad.DESCRIPTION); } pstmt_tMysqlOutput_1.setFloat(7, mainPropertyDataLoad.NUM_BEDS); pstmt_tMysqlOutput_1.setFloat(8, mainPropertyDataLoad.NUM_BATHS); if (mainPropertyDataLoad.TYPE == null) { pstmt_tMysqlOutput_1.setNull(9, java.sql.Types.VARCHAR); } else { pstmt_tMysqlOutput_1.setString(9, mainPropertyDataLoad.TYPE); } if (mainPropertyDataLoad.STATUS == null) { pstmt_tMysqlOutput_1.setNull(10, java.sql.Types.VARCHAR); } else { pstmt_tMysqlOutput_1.setString(10, mainPropertyDataLoad.STATUS); } pstmt_tMysqlOutput_1.setInt(11, mainPropertyDataLoad.STATE_INFO_ID); pstmt_tMysqlOutput_1.setInt(12, mainPropertyDataLoad.DATA_SOURCE_ID); pstmt_tMysqlOutput_1.addBatch(); nb_line_tMysqlOutput_1++; batchSizeCounter_tMysqlOutput_1++; if (batchSize_tMysqlOutput_1 <= batchSizeCounter_tMysqlOutput_1) { try { int countSum_tMysqlOutput_1 = 0; for (int countEach_tMysqlOutput_1 : pstmt_tMysqlOutput_1 .executeBatch()) { countSum_tMysqlOutput_1 += (countEach_tMysqlOutput_1 < 0 ? 0 : countEach_tMysqlOutput_1); } insertedCount_tMysqlOutput_1 += countSum_tMysqlOutput_1; } catch (java.sql.BatchUpdateException e) { int countSum_tMysqlOutput_1 = 0; for (int countEach_tMysqlOutput_1 : e.getUpdateCounts()) { countSum_tMysqlOutput_1 += (countEach_tMysqlOutput_1 < 0 ? 0 : countEach_tMysqlOutput_1); } insertedCount_tMysqlOutput_1 += countSum_tMysqlOutput_1; System.err.println(e.getMessage()); } batchSizeCounter_tMysqlOutput_1 = 0; } commitCounter_tMysqlOutput_1++; if (commitEvery_tMysqlOutput_1 <= commitCounter_tMysqlOutput_1) { try { int countSum_tMysqlOutput_1 = 0; for (int countEach_tMysqlOutput_1 : pstmt_tMysqlOutput_1 .executeBatch()) { countSum_tMysqlOutput_1 += (countEach_tMysqlOutput_1 < 0 ? 0 : countEach_tMysqlOutput_1); } insertedCount_tMysqlOutput_1 += countSum_tMysqlOutput_1; } catch (java.sql.BatchUpdateException e) { int countSum_tMysqlOutput_1 = 0; for (int countEach_tMysqlOutput_1 : e.getUpdateCounts()) { countSum_tMysqlOutput_1 += (countEach_tMysqlOutput_1 < 0 ? 0 : countEach_tMysqlOutput_1); } insertedCount_tMysqlOutput_1 += countSum_tMysqlOutput_1; System.out.println(e.getMessage()); } conn_tMysqlOutput_1.commit(); commitCounter_tMysqlOutput_1 = 0; } tos_count_tMysqlOutput_1++; /** * [tMysqlOutput_1 main ] stop */ } // End of branch // "mainPropertyDataLoad" } // End of branch "row9" } // End of branch "loadData" } // End of branch "mappedData" } // End of branch "propertyData" } // End of branch "row1" /** * [tFileInputXML_1 end ] start */ currentComponent = "tFileInputXML_1"; } try { looper_tFileInputXML_1.handleTaskResponse(); } catch (Exception e) { System.err.println(e.getMessage()); } globalMap.put("tFileInputXML_1_NB_LINE", nb_line_tFileInputXML_1); ok_Hash.put("tFileInputXML_1", true); end_Hash.put("tFileInputXML_1", System.currentTimeMillis()); /** * [tFileInputXML_1 end ] stop */ /** * [tMap_2 end ] start */ currentComponent = "tMap_2"; // ############################### // # Lookup hashes releasing // ############################### ok_Hash.put("tMap_2", true); end_Hash.put("tMap_2", System.currentTimeMillis()); /** * [tMap_2 end ] stop */ /** * [tMap_1 end ] start */ currentComponent = "tMap_1"; // ############################### // # Lookup hashes releasing if (tHash_Lookup_row6 != null) { tHash_Lookup_row6.endGet(); } globalMap.remove("tHash_Lookup_row6"); tHash_Lookup_Cache_row6.endGet(); tHash_Lookup_Cache_row6 = null; tHash_Lookup_Real_row6 = null; // ############################### ok_Hash.put("tMap_1", true); end_Hash.put("tMap_1", System.currentTimeMillis()); /** * [tMap_1 end ] stop */ /** * [tMap_4 end ] start */ currentComponent = "tMap_4"; // ############################### // # Lookup hashes releasing if (tHash_Lookup_custData != null) { tHash_Lookup_custData.endGet(); } globalMap.remove("tHash_Lookup_custData"); // ############################### ok_Hash.put("tMap_4", true); end_Hash.put("tMap_4", System.currentTimeMillis()); /** * [tMap_4 end ] stop */ /** * [tJoin_3 end ] start */ currentComponent = "tJoin_3"; ok_Hash.put("tJoin_3", true); end_Hash.put("tJoin_3", System.currentTimeMillis()); /** * [tJoin_3 end ] stop */ /** * [tJavaRow_3 end ] start */ currentComponent = "tJavaRow_3"; globalMap.put("tJavaRow_3_NB_LINE", nb_line_tJavaRow_3); ok_Hash.put("tJavaRow_3", true); end_Hash.put("tJavaRow_3", System.currentTimeMillis()); /** * [tJavaRow_3 end ] stop */ /** * [tMap_8 end ] start */ currentComponent = "tMap_8"; // ############################### // # Lookup hashes releasing // ############################### ok_Hash.put("tMap_8", true); end_Hash.put("tMap_8", System.currentTimeMillis()); /** * [tMap_8 end ] stop */ /** * [tMysqlOutput_1 end ] start */ currentComponent = "tMysqlOutput_1"; try { if (batchSizeCounter_tMysqlOutput_1 != 0) { int countSum_tMysqlOutput_1 = 0; for (int countEach_tMysqlOutput_1 : pstmt_tMysqlOutput_1.executeBatch()) { countSum_tMysqlOutput_1 += (countEach_tMysqlOutput_1 < 0 ? 0 : countEach_tMysqlOutput_1); } insertedCount_tMysqlOutput_1 += countSum_tMysqlOutput_1; } } catch (java.sql.BatchUpdateException e) { int countSum_tMysqlOutput_1 = 0; for (int countEach_tMysqlOutput_1 : e.getUpdateCounts()) { countSum_tMysqlOutput_1 += (countEach_tMysqlOutput_1 < 0 ? 0 : countEach_tMysqlOutput_1); } insertedCount_tMysqlOutput_1 += countSum_tMysqlOutput_1; System.err.println(e.getMessage()); } batchSizeCounter_tMysqlOutput_1 = 0; try { if (pstmt_tMysqlOutput_1 != null) { int countSum_tMysqlOutput_1 = 0; for (int countEach_tMysqlOutput_1 : pstmt_tMysqlOutput_1.executeBatch()) { countSum_tMysqlOutput_1 += (countEach_tMysqlOutput_1 < 0 ? 0 : countEach_tMysqlOutput_1); } insertedCount_tMysqlOutput_1 += countSum_tMysqlOutput_1; } } catch (java.sql.BatchUpdateException e) { int countSum_tMysqlOutput_1 = 0; for (int countEach_tMysqlOutput_1 : e.getUpdateCounts()) { countSum_tMysqlOutput_1 += (countEach_tMysqlOutput_1 < 0 ? 0 : countEach_tMysqlOutput_1); } insertedCount_tMysqlOutput_1 += countSum_tMysqlOutput_1; System.out.println(e.getMessage()); } if (pstmt_tMysqlOutput_1 != null) { pstmt_tMysqlOutput_1.close(); } conn_tMysqlOutput_1.commit(); conn_tMysqlOutput_1.close(); nb_line_deleted_tMysqlOutput_1 = nb_line_deleted_tMysqlOutput_1 + deletedCount_tMysqlOutput_1; nb_line_update_tMysqlOutput_1 = nb_line_update_tMysqlOutput_1 + updatedCount_tMysqlOutput_1; nb_line_inserted_tMysqlOutput_1 = nb_line_inserted_tMysqlOutput_1 + insertedCount_tMysqlOutput_1; nb_line_rejected_tMysqlOutput_1 = nb_line_rejected_tMysqlOutput_1 + rejectedCount_tMysqlOutput_1; globalMap.put("tMysqlOutput_1_NB_LINE", nb_line_tMysqlOutput_1); globalMap.put("tMysqlOutput_1_NB_LINE_UPDATED", nb_line_update_tMysqlOutput_1); globalMap.put("tMysqlOutput_1_NB_LINE_INSERTED", nb_line_inserted_tMysqlOutput_1); globalMap.put("tMysqlOutput_1_NB_LINE_DELETED", nb_line_deleted_tMysqlOutput_1); globalMap.put("tMysqlOutput_1_NB_LINE_REJECTED", nb_line_rejected_tMysqlOutput_1); ok_Hash.put("tMysqlOutput_1", true); end_Hash.put("tMysqlOutput_1", System.currentTimeMillis()); /** * [tMysqlOutput_1 end ] stop */ /** * [tFlowToIterate_1 end ] start */ currentComponent = "tFlowToIterate_1"; globalMap.put("tFlowToIterate_1_NB_LINE", nb_line_tFlowToIterate_1); ok_Hash.put("tFlowToIterate_1", true); end_Hash.put("tFlowToIterate_1", System.currentTimeMillis()); /** * [tFlowToIterate_1 end ] stop */ } // end the resume if (resumeEntryMethodName == null || globalResumeTicket) { resumeUtil.addLog("CHECKPOINT", "CONNECTION:SUBJOB_OK:tFileInputXML_1:OnSubjobOk", "", Thread.currentThread().getId() + "", "", "", "", "", ""); } tJava_1Process(globalMap); } catch (Exception e) { throw new TalendException(e, currentComponent, globalMap); } catch (java.lang.Error error) { throw new java.lang.Error(error); } finally { // free memory for "tJoin_1" globalMap.put("tHash_row4", null); // free memory for "tJoin_3" globalMap.put("tHash_getCurrentProperties", null); // free memory for "tMap_4" globalMap.put("tHash_Lookup_custData", null); // free memory for "tMap_1" globalMap.put("tHash_Lookup_row6", null); } globalMap.put("tFileInputXML_1_SUBPROCESS_STATE", 1); }
From source file:talonetl.getproperties_1_2.getProperties.java
public void tFileInputXML_1Process(final java.util.Map<String, Object> globalMap) throws TalendException { globalMap.put("tFileInputXML_1_SUBPROCESS_STATE", 0); final boolean execStat = this.execStat; String iterateId = ""; int iterateLoop = 0; String currentComponent = ""; try {/* w w w . j a v a 2 s .c om*/ String currentMethodName = new Exception().getStackTrace()[0].getMethodName(); boolean resumeIt = currentMethodName.equals(resumeEntryMethodName); if (resumeEntryMethodName == null || resumeIt || globalResumeTicket) {// start // the // resume globalResumeTicket = true; tMysqlInput_5Process(globalMap); tMysqlInput_3Process(globalMap); tMysqlInput_10Process(globalMap); tMysqlInput_7Process(globalMap); tMysqlInput_8Process(globalMap); row1Struct row1 = new row1Struct(); zipCodeStruct zipCode = new zipCodeStruct(); row2Struct row2 = new row2Struct(); row3Struct row3 = new row3Struct(); zipRowDataStruct zipRowData = new zipRowDataStruct(); out1Struct out1 = new out1Struct(); row10Struct row10 = new row10Struct(); loadZipStruct loadZip = new loadZipStruct(); stateInfoStruct stateInfo = new stateInfoStruct(); row13Struct row13 = new row13Struct(); loadStateStruct loadState = new loadStateStruct(); stateCityStruct stateCity = new stateCityStruct(); row5Struct row5 = new row5Struct(); loadCityStruct loadCity = new loadCityStruct(); propertyDataStruct propertyData = new propertyDataStruct(); loadDataStruct loadData = new loadDataStruct(); row9Struct row9 = new row9Struct(); row14Struct row14 = new row14Struct(); newDataStruct newData = new newDataStruct(); /** * [tFlowToIterate_1 begin ] start */ int NB_ITERATE_tFileInputJSON_1 = 0; // for statistics ok_Hash.put("tFlowToIterate_1", false); start_Hash.put("tFlowToIterate_1", System.currentTimeMillis()); currentComponent = "tFlowToIterate_1"; int tos_count_tFlowToIterate_1 = 0; int nb_line_tFlowToIterate_1 = 0; int counter_tFlowToIterate_1 = 0; /** * [tFlowToIterate_1 begin ] stop */ /** * [tMysqlOutput_1 begin ] start */ ok_Hash.put("tMysqlOutput_1", false); start_Hash.put("tMysqlOutput_1", System.currentTimeMillis()); currentComponent = "tMysqlOutput_1"; int tos_count_tMysqlOutput_1 = 0; int nb_line_tMysqlOutput_1 = 0; int nb_line_update_tMysqlOutput_1 = 0; int nb_line_inserted_tMysqlOutput_1 = 0; int nb_line_deleted_tMysqlOutput_1 = 0; int nb_line_rejected_tMysqlOutput_1 = 0; int deletedCount_tMysqlOutput_1 = 0; int updatedCount_tMysqlOutput_1 = 0; int insertedCount_tMysqlOutput_1 = 0; int rejectedCount_tMysqlOutput_1 = 0; String tableName_tMysqlOutput_1 = "PROPERTY_DATA"; boolean whetherReject_tMysqlOutput_1 = false; java.util.Calendar calendar_tMysqlOutput_1 = java.util.Calendar.getInstance(); calendar_tMysqlOutput_1.set(1, 0, 1, 0, 0, 0); long year1_tMysqlOutput_1 = calendar_tMysqlOutput_1.getTime().getTime(); calendar_tMysqlOutput_1.set(10000, 0, 1, 0, 0, 0); long year10000_tMysqlOutput_1 = calendar_tMysqlOutput_1.getTime().getTime(); long date_tMysqlOutput_1; java.sql.Connection conn_tMysqlOutput_1 = null; java.util.Map<String, routines.system.TalendDataSource> dataSources_tMysqlOutput_1 = (java.util.Map<String, routines.system.TalendDataSource>) globalMap .get(KEY_DB_DATASOURCES); if (null != dataSources_tMysqlOutput_1) { conn_tMysqlOutput_1 = dataSources_tMysqlOutput_1.get("").getConnection(); } else { String dbProperties_tMysqlOutput_1 = context.talon_AdditionalParams; String url_tMysqlOutput_1 = null; if (dbProperties_tMysqlOutput_1 == null || dbProperties_tMysqlOutput_1.trim().length() == 0) { url_tMysqlOutput_1 = "jdbc:mysql://" + context.talon_Server + ":" + context.talon_Port + "/" + context.talon_Database + "?" + "rewriteBatchedStatements=true"; } else { String properties_tMysqlOutput_1 = context.talon_AdditionalParams; if (!properties_tMysqlOutput_1.contains("rewriteBatchedStatements")) { properties_tMysqlOutput_1 += "&rewriteBatchedStatements=true"; } url_tMysqlOutput_1 = "jdbc:mysql://" + context.talon_Server + ":" + context.talon_Port + "/" + context.talon_Database + "?" + properties_tMysqlOutput_1; } String dbUser_tMysqlOutput_1 = context.talon_Login; String dbPwd_tMysqlOutput_1 = context.talon_Password; java.lang.Class.forName("org.gjt.mm.mysql.Driver"); conn_tMysqlOutput_1 = java.sql.DriverManager.getConnection(url_tMysqlOutput_1, dbUser_tMysqlOutput_1, dbPwd_tMysqlOutput_1); } conn_tMysqlOutput_1.setAutoCommit(false); int commitEvery_tMysqlOutput_1 = 1; int commitCounter_tMysqlOutput_1 = 0; int count_tMysqlOutput_1 = 0; String insert_tMysqlOutput_1 = "INSERT INTO `" + "PROPERTY_DATA" + "` (`ID`,`UUID`,`PROP_NAME`,`PRICE`,`SQFT`,`DESCRIPTION`,`NUM_BEDS`,`NUM_BATHS`,`TYPE`,`STATUS`,`DATA_SOURCE_ID`,`ZIP_CODE`) VALUES (?,?,?,?,?,?,?,?,?,?,?,?)"; java.sql.PreparedStatement pstmt_tMysqlOutput_1 = conn_tMysqlOutput_1 .prepareStatement(insert_tMysqlOutput_1); /** * [tMysqlOutput_1 begin ] stop */ /** * [tMap_8 begin ] start */ ok_Hash.put("tMap_8", false); start_Hash.put("tMap_8", System.currentTimeMillis()); currentComponent = "tMap_8"; int tos_count_tMap_8 = 0; // ############################### // # Lookup's keys initialization // ############################### // ############################### // # Vars initialization class Var__tMap_8__Struct { } Var__tMap_8__Struct Var__tMap_8 = new Var__tMap_8__Struct(); // ############################### // ############################### // # Outputs initialization newDataStruct newData_tmp = new newDataStruct(); // ############################### /** * [tMap_8 begin ] stop */ /** * [tJavaRow_3 begin ] start */ ok_Hash.put("tJavaRow_3", false); start_Hash.put("tJavaRow_3", System.currentTimeMillis()); currentComponent = "tJavaRow_3"; int tos_count_tJavaRow_3 = 0; int nb_line_tJavaRow_3 = 0; /** * [tJavaRow_3 begin ] stop */ /** * [tJoin_3 begin ] start */ ok_Hash.put("tJoin_3", false); start_Hash.put("tJoin_3", System.currentTimeMillis()); currentComponent = "tJoin_3"; int tos_count_tJoin_3 = 0; final java.util.Map<getCurrentPropertiesStruct, getCurrentPropertiesStruct> tHash_tJoin_3 = (java.util.Map<getCurrentPropertiesStruct, getCurrentPropertiesStruct>) globalMap .get("tHash_getCurrentProperties"); class Util_tJoin_3 { getCurrentPropertiesStruct lookupValue = null; getCurrentPropertiesStruct getCurrentPropertiesHashKey = new getCurrentPropertiesStruct(); public boolean isJoined(loadDataStruct mainRow) { getCurrentPropertiesHashKey.PROP_NAME = mainRow.PROP_NAME; getCurrentPropertiesHashKey.hashCodeDirty = true; lookupValue = tHash_tJoin_3.get(getCurrentPropertiesHashKey); if (lookupValue != null) { return true; } return false; } } Util_tJoin_3 util_tJoin_3 = new Util_tJoin_3(); int nb_line_tJoin_3 = 0; /** * [tJoin_3 begin ] stop */ /** * [tMap_4 begin ] start */ ok_Hash.put("tMap_4", false); start_Hash.put("tMap_4", System.currentTimeMillis()); currentComponent = "tMap_4"; int tos_count_tMap_4 = 0; // ############################### // # Lookup's keys initialization org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<custDataStruct> tHash_Lookup_custData = (org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<custDataStruct>) ((org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<custDataStruct>) globalMap .get("tHash_Lookup_custData")); custDataStruct custDataHashKey = new custDataStruct(); custDataStruct custDataDefault = new custDataStruct(); // ############################### // ############################### // # Vars initialization class Var__tMap_4__Struct { } Var__tMap_4__Struct Var__tMap_4 = new Var__tMap_4__Struct(); // ############################### // ############################### // # Outputs initialization loadDataStruct loadData_tmp = new loadDataStruct(); // ############################### /** * [tMap_4 begin ] stop */ /** * [tMap_2 begin ] start */ ok_Hash.put("tMap_2", false); start_Hash.put("tMap_2", System.currentTimeMillis()); currentComponent = "tMap_2"; int tos_count_tMap_2 = 0; // ############################### // # Lookup's keys initialization // ############################### // ############################### // # Vars initialization class Var__tMap_2__Struct { } Var__tMap_2__Struct Var__tMap_2 = new Var__tMap_2__Struct(); // ############################### // ############################### // # Outputs initialization zipCodeStruct zipCode_tmp = new zipCodeStruct(); propertyDataStruct propertyData_tmp = new propertyDataStruct(); // ############################### /** * [tMap_2 begin ] stop */ /** * [tFileInputXML_1 begin ] start */ ok_Hash.put("tFileInputXML_1", false); start_Hash.put("tFileInputXML_1", System.currentTimeMillis()); currentComponent = "tFileInputXML_1"; int tos_count_tFileInputXML_1 = 0; int nb_line_tFileInputXML_1 = 0; String os_tFileInputXML_1 = System.getProperty("os.name").toLowerCase(); boolean isWindows_tFileInputXML_1 = false; if (os_tFileInputXML_1.indexOf("windows") > -1 || os_tFileInputXML_1.indexOf("nt") > -1) { isWindows_tFileInputXML_1 = true; } class XML_API_tFileInputXML_1 { public boolean isDefNull(String[] node) throws javax.xml.transform.TransformerException { if (node[0] != null && node[1] != null && ("true").equals(node[1])) { return true; } return false; } public boolean isMissing(String[] node) throws javax.xml.transform.TransformerException { return node[0] == null ? true : false; } public boolean isEmpty(String[] node) throws javax.xml.transform.TransformerException { if (node[0] != null) { return node[0].length() == 0; } return false; } } XML_API_tFileInputXML_1 xml_api_tFileInputXML_1 = new XML_API_tFileInputXML_1(); String[] queryPaths_tFileInputXML_1 = new String[] { "name", "name" + "/@xsi:nil", "../media/images/image/url", "../media/images/image/url" + "/@xsi:nil", "../media/images/image/title", "../media/images/image/title" + "/@xsi:nil", "pba__propertytype__c", "pba__propertytype__c" + "/@xsi:nil", "rented_status__c", "rented_status__c" + "/@xsi:nil", "zipcode__c", "zipcode__c" + "/@xsi:nil", "pba__city_pb__c", "pba__city_pb__c" + "/@xsi:nil", "pba__description_pb__c", "pba__description_pb__c" + "/@xsi:nil", "term_2__c", "term_2__c" + "/@xsi:nil", "term_1__c", "term_1__c" + "/@xsi:nil", "pba__status__c", "pba__status__c" + "/@xsi:nil", "year_built__c", "year_built__c" + "/@xsi:nil", "pba__address_pb__c", "pba__address_pb__c" + "/@xsi:nil", "financed_net_yield_1__c", "financed_net_yield_1__c" + "/@xsi:nil", "monthly_cash_flow_with_financing_2__c", "monthly_cash_flow_with_financing_2__c" + "/@xsi:nil", "financed_net_yield_2__c", "financed_net_yield_2__c" + "/@xsi:nil", "monthly_cash_flow_with_financing_1__c", "monthly_cash_flow_with_financing_1__c" + "/@xsi:nil", "interest_rate_2__c", "interest_rate_2__c" + "/@xsi:nil", "interest_rate_1__c", "interest_rate_1__c" + "/@xsi:nil", "monthly_cash_flow__c", "monthly_cash_flow__c" + "/@xsi:nil", "noi__c", "noi__c" + "/@xsi:nil", "noi_with_financing_2__c", "noi_with_financing_2__c" + "/@xsi:nil", "noi_with_financing_1__c", "noi_with_financing_1__c" + "/@xsi:nil", "price_per_ft__c", "price_per_ft__c" + "/@xsi:nil", "price__c", "price__c" + "/@xsi:nil", "yearly_interest_payment_1__c", "yearly_interest_payment_1__c" + "/@xsi:nil", "monthly_interest_payment_2__c", "monthly_interest_payment_2__c" + "/@xsi:nil", "interest_payment_1__c", "interest_payment_1__c" + "/@xsi:nil", "down_payment_2__c", "down_payment_2__c" + "/@xsi:nil", "down_payment_1__c", "down_payment_1__c" + "/@xsi:nil", "cash_net_yield__c", "cash_net_yield__c" + "/@xsi:nil", "monthly_management__c", "monthly_management__c" + "/@xsi:nil", "management__c", "management__c" + "/@xsi:nil", "monthly_insurance__c", "monthly_insurance__c" + "/@xsi:nil", "insurance__c", "insurance__c" + "/@xsi:nil", "taxes__c", "taxes__c" + "/@xsi:nil", "monthly_taxes__c", "monthly_taxes__c" + "/@xsi:nil", "monthlyrent__c", "monthlyrent__c" + "/@xsi:nil", "annual_rents__c", "annual_rents__c" + "/@xsi:nil", "est_of_market_value__c", "est_of_market_value__c" + "/@xsi:nil", "est_value_per_rent_multiplier__c", "est_value_per_rent_multiplier__c" + "/@xsi:nil", "estimated_value__c", "estimated_value__c" + "/@xsi:nil", "est_replacement_cost_per_sq_ft__c", "est_replacement_cost_per_sq_ft__c" + "/@xsi:nil", "est_replacement_cost__c", "est_replacement_cost__c" + "/@xsi:nil", "pba__totalarea_pb__c", "pba__totalarea_pb__c" + "/@xsi:nil", "bedrooms__c", "bedrooms__c" + "/@xsi:nil", "bathrooms__c", "bathrooms__c" + "/@xsi:nil" }; boolean[] asXMLs_tFileInputXML_1 = new boolean[] { false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false }; String str_tFileInputXML_1 = ""; String[] node_tFileInputXML_1 = null; org.talend.xml.sax.SAXLooper looper_tFileInputXML_1 = new org.talend.xml.sax.SAXLooper( "/result/listings/listing/data", queryPaths_tFileInputXML_1, asXMLs_tFileInputXML_1); looper_tFileInputXML_1.setEncoding("UTF-8"); Object filename_tFileInputXML_1 = null; try { filename_tFileInputXML_1 = ((java.io.InputStream) globalMap.get("tFileFetch_1_INPUT_STREAM")); } catch (Exception e) { System.err.println(e.getMessage()); } if (filename_tFileInputXML_1 != null && filename_tFileInputXML_1 instanceof String && filename_tFileInputXML_1.toString().startsWith("//")) { if (!isWindows_tFileInputXML_1) { filename_tFileInputXML_1 = filename_tFileInputXML_1.toString().replaceFirst("//", "/"); } } if (filename_tFileInputXML_1 instanceof java.io.InputStream) { looper_tFileInputXML_1.parse((java.io.InputStream) filename_tFileInputXML_1); } else { looper_tFileInputXML_1.parse(String.valueOf(filename_tFileInputXML_1)); } java.util.Iterator<java.util.Map<String, String>> it_tFileInputXML_1 = looper_tFileInputXML_1 .iterator(); while (it_tFileInputXML_1.hasNext()) { java.util.Map<String, String> row_tFileInputXML_1 = it_tFileInputXML_1.next(); nb_line_tFileInputXML_1++; row1 = null; boolean whetherReject_tFileInputXML_1 = false; row1 = new row1Struct(); try { str_tFileInputXML_1 = row_tFileInputXML_1.get("name"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("name" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.name = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1)) { row1.name = ""; } else if (xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.name = null; } else { row1.name = str_tFileInputXML_1; } str_tFileInputXML_1 = row_tFileInputXML_1.get("../media/images/image/url"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("../media/images/image/url" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.image_url = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1)) { row1.image_url = ""; } else if (xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.image_url = null; } else { row1.image_url = str_tFileInputXML_1; } str_tFileInputXML_1 = row_tFileInputXML_1.get("../media/images/image/title"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("../media/images/image/title" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.image_title = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1)) { row1.image_title = ""; } else if (xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.image_title = null; } else { row1.image_title = str_tFileInputXML_1; } str_tFileInputXML_1 = row_tFileInputXML_1.get("pba__propertytype__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("pba__propertytype__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.pba__propertytype__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1)) { row1.pba__propertytype__c = ""; } else if (xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.pba__propertytype__c = null; } else { row1.pba__propertytype__c = str_tFileInputXML_1; } str_tFileInputXML_1 = row_tFileInputXML_1.get("rented_status__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("rented_status__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.rented_status__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1)) { row1.rented_status__c = ""; } else if (xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.rented_status__c = null; } else { row1.rented_status__c = str_tFileInputXML_1; } str_tFileInputXML_1 = row_tFileInputXML_1.get("zipcode__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("zipcode__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.zipcode__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.zipcode__c = null; } else { row1.zipcode__c = ParserUtils.parseTo_Integer(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("pba__city_pb__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("pba__city_pb__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.pba__city_pb__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1)) { row1.pba__city_pb__c = ""; } else if (xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.pba__city_pb__c = null; } else { row1.pba__city_pb__c = str_tFileInputXML_1; } str_tFileInputXML_1 = row_tFileInputXML_1.get("pba__description_pb__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("pba__description_pb__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.pba__description_pb__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1)) { row1.pba__description_pb__c = ""; } else if (xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.pba__description_pb__c = null; } else { row1.pba__description_pb__c = str_tFileInputXML_1; } str_tFileInputXML_1 = row_tFileInputXML_1.get("term_2__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("term_2__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.term_2__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1)) { row1.term_2__c = ""; } else if (xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.term_2__c = null; } else { row1.term_2__c = str_tFileInputXML_1; } str_tFileInputXML_1 = row_tFileInputXML_1.get("term_1__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("term_1__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.term_1__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1)) { row1.term_1__c = ""; } else if (xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.term_1__c = null; } else { row1.term_1__c = str_tFileInputXML_1; } str_tFileInputXML_1 = row_tFileInputXML_1.get("pba__status__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("pba__status__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.pba__status__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1)) { row1.pba__status__c = ""; } else if (xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.pba__status__c = null; } else { row1.pba__status__c = str_tFileInputXML_1; } str_tFileInputXML_1 = row_tFileInputXML_1.get("year_built__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("year_built__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.year_built__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.year_built__c = null; } else { row1.year_built__c = ParserUtils.parseTo_Integer(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("pba__address_pb__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("pba__address_pb__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.pba__address_pb__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1)) { row1.pba__address_pb__c = ""; } else if (xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.pba__address_pb__c = null; } else { row1.pba__address_pb__c = str_tFileInputXML_1; } str_tFileInputXML_1 = row_tFileInputXML_1.get("financed_net_yield_1__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("financed_net_yield_1__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.financed_net_yield_1__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.financed_net_yield_1__c = null; } else { row1.financed_net_yield_1__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("monthly_cash_flow_with_financing_2__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("monthly_cash_flow_with_financing_2__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.monthly_cash_flow_with_financing_2__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.monthly_cash_flow_with_financing_2__c = null; } else { row1.monthly_cash_flow_with_financing_2__c = ParserUtils .parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("financed_net_yield_2__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("financed_net_yield_2__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.financed_net_yield_2__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.financed_net_yield_2__c = null; } else { row1.financed_net_yield_2__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("monthly_cash_flow_with_financing_1__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("monthly_cash_flow_with_financing_1__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.monthly_cash_flow_with_financing_1__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.monthly_cash_flow_with_financing_1__c = null; } else { row1.monthly_cash_flow_with_financing_1__c = ParserUtils .parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("interest_rate_2__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("interest_rate_2__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.interest_rate_2__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.interest_rate_2__c = null; } else { row1.interest_rate_2__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("interest_rate_1__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("interest_rate_1__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.interest_rate_1__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.interest_rate_1__c = null; } else { row1.interest_rate_1__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("monthly_cash_flow__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("monthly_cash_flow__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.monthly_cash_flow__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.monthly_cash_flow__c = null; } else { row1.monthly_cash_flow__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("noi__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("noi__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.noi__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.noi__c = null; } else { row1.noi__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("noi_with_financing_2__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("noi_with_financing_2__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.noi_with_financing_2__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.noi_with_financing_2__c = null; } else { row1.noi_with_financing_2__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("noi_with_financing_1__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("noi_with_financing_1__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.noi_with_financing_1__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.noi_with_financing_1__c = null; } else { row1.noi_with_financing_1__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("price_per_ft__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("price_per_ft__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.price_per_ft__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.price_per_ft__c = null; } else { row1.price_per_ft__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("price__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("price__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.price__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.price__c = null; } else { row1.price__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("yearly_interest_payment_1__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("yearly_interest_payment_1__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.yearly_interest_payment_1__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.yearly_interest_payment_1__c = null; } else { row1.yearly_interest_payment_1__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("monthly_interest_payment_2__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("monthly_interest_payment_2__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.monthly_interest_payment_2__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.monthly_interest_payment_2__c = null; } else { row1.monthly_interest_payment_2__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("interest_payment_1__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("interest_payment_1__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.interest_payment_1__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.interest_payment_1__c = null; } else { row1.interest_payment_1__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("down_payment_2__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("down_payment_2__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.down_payment_2__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.down_payment_2__c = null; } else { row1.down_payment_2__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("down_payment_1__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("down_payment_1__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.down_payment_1__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.down_payment_1__c = null; } else { row1.down_payment_1__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("cash_net_yield__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("cash_net_yield__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.cash_net_yield__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.cash_net_yield__c = null; } else { row1.cash_net_yield__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("monthly_management__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("monthly_management__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.monthly_management__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.monthly_management__c = null; } else { row1.monthly_management__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("management__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("management__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.management__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.management__c = null; } else { row1.management__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("monthly_insurance__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("monthly_insurance__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.monthly_insurance__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.monthly_insurance__c = null; } else { row1.monthly_insurance__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("insurance__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("insurance__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.insurance__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.insurance__c = null; } else { row1.insurance__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("taxes__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("taxes__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.taxes__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.taxes__c = null; } else { row1.taxes__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("monthly_taxes__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("monthly_taxes__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.monthly_taxes__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.monthly_taxes__c = null; } else { row1.monthly_taxes__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("monthlyrent__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("monthlyrent__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.monthlyrent__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.monthlyrent__c = null; } else { row1.monthlyrent__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("annual_rents__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("annual_rents__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.annual_rents__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.annual_rents__c = null; } else { row1.annual_rents__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("est_of_market_value__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("est_of_market_value__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.est_of_market_value__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.est_of_market_value__c = null; } else { row1.est_of_market_value__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("est_value_per_rent_multiplier__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("est_value_per_rent_multiplier__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.est_value_per_rent_multiplier__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.est_value_per_rent_multiplier__c = null; } else { row1.est_value_per_rent_multiplier__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("estimated_value__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("estimated_value__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.estimated_value__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1)) { row1.estimated_value__c = ""; } else if (xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.estimated_value__c = null; } else { row1.estimated_value__c = str_tFileInputXML_1; } str_tFileInputXML_1 = row_tFileInputXML_1.get("est_replacement_cost_per_sq_ft__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("est_replacement_cost_per_sq_ft__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.est_replacement_cost_per_sq_ft__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.est_replacement_cost_per_sq_ft__c = null; } else { row1.est_replacement_cost_per_sq_ft__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("est_replacement_cost__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("est_replacement_cost__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.est_replacement_cost__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.est_replacement_cost__c = null; } else { row1.est_replacement_cost__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("pba__totalarea_pb__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("pba__totalarea_pb__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.pba__totalarea_pb__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.pba__totalarea_pb__c = null; } else { row1.pba__totalarea_pb__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("bedrooms__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("bedrooms__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.bedrooms__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.bedrooms__c = null; } else { row1.bedrooms__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("bathrooms__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("bathrooms__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.bathrooms__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.bathrooms__c = null; } else { row1.bathrooms__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } } catch (Exception e) { whetherReject_tFileInputXML_1 = true; System.err.println(e.getMessage()); row1 = null; } /** * [tFileInputXML_1 begin ] stop */ /** * [tFileInputXML_1 main ] start */ currentComponent = "tFileInputXML_1"; tos_count_tFileInputXML_1++; /** * [tFileInputXML_1 main ] stop */ // Start of branch "row1" if (row1 != null) { /** * [tMap_2 main ] start */ currentComponent = "tMap_2"; boolean hasCasePrimitiveKeyWithNull_tMap_2 = false; // ############################### // # Input tables (lookups) boolean rejectedInnerJoin_tMap_2 = false; boolean mainRowRejected_tMap_2 = false; // ############################### { // start of Var scope // ############################### // # Vars tables Var__tMap_2__Struct Var = Var__tMap_2;// ############################### // ############################### // # Output tables zipCode = null; propertyData = null; // # Output table : 'zipCode' zipCode_tmp.zipcode__c = row1.zipcode__c; zipCode = zipCode_tmp; // # Output table : 'propertyData' propertyData_tmp.name = row1.name; propertyData_tmp.image_url = row1.image_url; propertyData_tmp.image_title = row1.image_title; propertyData_tmp.pba__propertytype__c = row1.pba__propertytype__c; propertyData_tmp.rented_status__c = row1.rented_status__c; propertyData_tmp.zipcode__c = row1.zipcode__c; propertyData_tmp.pba__city_pb__c = row1.pba__city_pb__c; propertyData_tmp.pba__description_pb__c = row1.pba__description_pb__c; propertyData_tmp.term_2__c = row1.term_2__c; propertyData_tmp.term_1__c = row1.term_1__c; propertyData_tmp.pba__status__c = row1.pba__status__c; propertyData_tmp.year_built__c = row1.year_built__c; propertyData_tmp.pba__address_pb__c = row1.pba__address_pb__c; propertyData_tmp.financed_net_yield_1__c = row1.financed_net_yield_1__c; propertyData_tmp.monthly_cash_flow_with_financing_2__c = row1.monthly_cash_flow_with_financing_2__c; propertyData_tmp.financed_net_yield_2__c = row1.financed_net_yield_2__c; propertyData_tmp.monthly_cash_flow_with_financing_1__c = row1.monthly_cash_flow_with_financing_1__c; propertyData_tmp.interest_rate_2__c = row1.interest_rate_2__c; propertyData_tmp.interest_rate_1__c = row1.interest_rate_1__c; propertyData_tmp.monthly_cash_flow__c = row1.monthly_cash_flow__c; propertyData_tmp.noi__c = row1.noi__c; propertyData_tmp.noi_with_financing_2__c = row1.noi_with_financing_2__c; propertyData_tmp.noi_with_financing_1__c = row1.noi_with_financing_1__c; propertyData_tmp.price_per_ft__c = row1.price_per_ft__c; propertyData_tmp.price__c = row1.price__c; propertyData_tmp.yearly_interest_payment_1__c = row1.yearly_interest_payment_1__c; propertyData_tmp.monthly_interest_payment_2__c = row1.monthly_interest_payment_2__c; propertyData_tmp.interest_payment_1__c = row1.interest_payment_1__c; propertyData_tmp.down_payment_2__c = row1.down_payment_2__c; propertyData_tmp.down_payment_1__c = row1.down_payment_1__c; propertyData_tmp.cash_net_yield__c = row1.cash_net_yield__c; propertyData_tmp.monthly_management__c = row1.monthly_management__c; propertyData_tmp.management__c = row1.management__c; propertyData_tmp.monthly_insurance__c = row1.monthly_insurance__c; propertyData_tmp.insurance__c = row1.insurance__c; propertyData_tmp.taxes__c = row1.taxes__c; propertyData_tmp.monthly_taxes__c = row1.monthly_taxes__c; propertyData_tmp.monthlyrent__c = row1.monthlyrent__c; propertyData_tmp.annual_rents__c = row1.annual_rents__c; propertyData_tmp.est_of_market_value__c = row1.est_of_market_value__c; propertyData_tmp.est_value_per_rent_multiplier__c = row1.est_value_per_rent_multiplier__c; propertyData_tmp.estimated_value__c = row1.estimated_value__c; propertyData_tmp.est_replacement_cost_per_sq_ft__c = row1.est_replacement_cost_per_sq_ft__c; propertyData_tmp.est_replacement_cost__c = row1.est_replacement_cost__c; propertyData_tmp.pba__totalarea_pb__c = row1.pba__totalarea_pb__c; propertyData_tmp.bedrooms__c = row1.bedrooms__c; propertyData_tmp.bathrooms__c = row1.bathrooms__c; propertyData_tmp.customer = context.cusomterName; propertyData = propertyData_tmp; // ############################### } // end of Var scope rejectedInnerJoin_tMap_2 = false; tos_count_tMap_2++; /** * [tMap_2 main ] stop */ // Start of branch "zipCode" if (zipCode != null) { /** * [tFlowToIterate_1 main ] start */ currentComponent = "tFlowToIterate_1"; globalMap.put("zipCode", zipCode.zipcode__c); nb_line_tFlowToIterate_1++; counter_tFlowToIterate_1++; globalMap.put("tFlowToIterate_1_CURRENT_ITERATION", counter_tFlowToIterate_1); tos_count_tFlowToIterate_1++; /** * [tFlowToIterate_1 main ] stop */ NB_ITERATE_tFileInputJSON_1++; iterateLoop++; /** * [tMysqlOutput_5 begin ] start */ ok_Hash.put("tMysqlOutput_5", false); start_Hash.put("tMysqlOutput_5", System.currentTimeMillis()); currentComponent = "tMysqlOutput_5"; int tos_count_tMysqlOutput_5 = 0; int nb_line_tMysqlOutput_5 = 0; int nb_line_update_tMysqlOutput_5 = 0; int nb_line_inserted_tMysqlOutput_5 = 0; int nb_line_deleted_tMysqlOutput_5 = 0; int nb_line_rejected_tMysqlOutput_5 = 0; int deletedCount_tMysqlOutput_5 = 0; int updatedCount_tMysqlOutput_5 = 0; int insertedCount_tMysqlOutput_5 = 0; int rejectedCount_tMysqlOutput_5 = 0; String tableName_tMysqlOutput_5 = "ZIP_CODES"; boolean whetherReject_tMysqlOutput_5 = false; java.util.Calendar calendar_tMysqlOutput_5 = java.util.Calendar.getInstance(); calendar_tMysqlOutput_5.set(1, 0, 1, 0, 0, 0); long year1_tMysqlOutput_5 = calendar_tMysqlOutput_5.getTime().getTime(); calendar_tMysqlOutput_5.set(10000, 0, 1, 0, 0, 0); long year10000_tMysqlOutput_5 = calendar_tMysqlOutput_5.getTime().getTime(); long date_tMysqlOutput_5; java.sql.Connection conn_tMysqlOutput_5 = null; java.util.Map<String, routines.system.TalendDataSource> dataSources_tMysqlOutput_5 = (java.util.Map<String, routines.system.TalendDataSource>) globalMap .get(KEY_DB_DATASOURCES); if (null != dataSources_tMysqlOutput_5) { conn_tMysqlOutput_5 = dataSources_tMysqlOutput_5.get("").getConnection(); } else { String dbProperties_tMysqlOutput_5 = context.talon_AdditionalParams; String url_tMysqlOutput_5 = null; if (dbProperties_tMysqlOutput_5 == null || dbProperties_tMysqlOutput_5.trim().length() == 0) { url_tMysqlOutput_5 = "jdbc:mysql://" + context.talon_Server + ":" + context.talon_Port + "/" + context.talon_Database + "?" + "rewriteBatchedStatements=true"; } else { String properties_tMysqlOutput_5 = context.talon_AdditionalParams; if (!properties_tMysqlOutput_5.contains("rewriteBatchedStatements")) { properties_tMysqlOutput_5 += "&rewriteBatchedStatements=true"; } url_tMysqlOutput_5 = "jdbc:mysql://" + context.talon_Server + ":" + context.talon_Port + "/" + context.talon_Database + "?" + properties_tMysqlOutput_5; } String dbUser_tMysqlOutput_5 = context.talon_Login; String dbPwd_tMysqlOutput_5 = context.talon_Password; java.lang.Class.forName("org.gjt.mm.mysql.Driver"); conn_tMysqlOutput_5 = java.sql.DriverManager.getConnection(url_tMysqlOutput_5, dbUser_tMysqlOutput_5, dbPwd_tMysqlOutput_5); } conn_tMysqlOutput_5.setAutoCommit(false); int commitEvery_tMysqlOutput_5 = 10000; int commitCounter_tMysqlOutput_5 = 0; int count_tMysqlOutput_5 = 0; String insert_tMysqlOutput_5 = "INSERT INTO `" + "ZIP_CODES" + "` (`ZIP_CODE`,`CITY_ID`) VALUES (?,?)"; int batchSize_tMysqlOutput_5 = 100; int batchSizeCounter_tMysqlOutput_5 = 0; java.sql.PreparedStatement pstmt_tMysqlOutput_5 = conn_tMysqlOutput_5 .prepareStatement(insert_tMysqlOutput_5); /** * [tMysqlOutput_5 begin ] stop */ /** * [tMap_13 begin ] start */ ok_Hash.put("tMap_13", false); start_Hash.put("tMap_13", System.currentTimeMillis()); currentComponent = "tMap_13"; int tos_count_tMap_13 = 0; // ############################### // # Lookup's keys initialization // ############################### // ############################### // # Vars initialization class Var__tMap_13__Struct { } Var__tMap_13__Struct Var__tMap_13 = new Var__tMap_13__Struct(); // ############################### // ############################### // # Outputs initialization loadZipStruct loadZip_tmp = new loadZipStruct(); // ############################### /** * [tMap_13 begin ] stop */ /** * [tJoin_4 begin ] start */ ok_Hash.put("tJoin_4", false); start_Hash.put("tJoin_4", System.currentTimeMillis()); currentComponent = "tJoin_4"; int tos_count_tJoin_4 = 0; final java.util.Map<row6Struct, row6Struct> tHash_tJoin_4 = (java.util.Map<row6Struct, row6Struct>) globalMap .get("tHash_row6"); class Util_tJoin_4 { row6Struct lookupValue = null; row6Struct row6HashKey = new row6Struct(); public boolean isJoined(out1Struct mainRow) { row6HashKey.ZIP_CODE = mainRow.zip; row6HashKey.hashCodeDirty = true; lookupValue = tHash_tJoin_4.get(row6HashKey); if (lookupValue != null) { return true; } return false; } } Util_tJoin_4 util_tJoin_4 = new Util_tJoin_4(); int nb_line_tJoin_4 = 0; /** * [tJoin_4 begin ] stop */ /** * [tMap_12 begin ] start */ ok_Hash.put("tMap_12", false); start_Hash.put("tMap_12", System.currentTimeMillis()); currentComponent = "tMap_12"; int tos_count_tMap_12 = 0; // ############################### // # Lookup's keys initialization org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row12Struct> tHash_Lookup_row12 = null; org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row12Struct> tHash_Lookup_Cache_row12 = org.talend.designer.components.lookup.memory.AdvancedMemoryLookup .<row12Struct>getLookup( org.talend.designer.components.lookup.common.ICommonLookup.MATCHING_MODE.UNIQUE_MATCH); org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row12Struct> tHash_Lookup_Real_row12 = null; row12Struct row12HashKey = new row12Struct(); row12Struct row12Default = new row12Struct(); // ############################### // ############################### // # Vars initialization class Var__tMap_12__Struct { } Var__tMap_12__Struct Var__tMap_12 = new Var__tMap_12__Struct(); // ############################### // ############################### // # Outputs initialization out1Struct out1_tmp = new out1Struct(); // ############################### /** * [tMap_12 begin ] stop */ /** * [tMysqlOutput_7 begin ] start */ ok_Hash.put("tMysqlOutput_7", false); start_Hash.put("tMysqlOutput_7", System.currentTimeMillis()); currentComponent = "tMysqlOutput_7"; int tos_count_tMysqlOutput_7 = 0; int nb_line_tMysqlOutput_7 = 0; int nb_line_update_tMysqlOutput_7 = 0; int nb_line_inserted_tMysqlOutput_7 = 0; int nb_line_deleted_tMysqlOutput_7 = 0; int nb_line_rejected_tMysqlOutput_7 = 0; int deletedCount_tMysqlOutput_7 = 0; int updatedCount_tMysqlOutput_7 = 0; int insertedCount_tMysqlOutput_7 = 0; int rejectedCount_tMysqlOutput_7 = 0; String tableName_tMysqlOutput_7 = "STATE"; boolean whetherReject_tMysqlOutput_7 = false; java.util.Calendar calendar_tMysqlOutput_7 = java.util.Calendar.getInstance(); calendar_tMysqlOutput_7.set(1, 0, 1, 0, 0, 0); long year1_tMysqlOutput_7 = calendar_tMysqlOutput_7.getTime().getTime(); calendar_tMysqlOutput_7.set(10000, 0, 1, 0, 0, 0); long year10000_tMysqlOutput_7 = calendar_tMysqlOutput_7.getTime().getTime(); long date_tMysqlOutput_7; java.sql.Connection conn_tMysqlOutput_7 = null; java.util.Map<String, routines.system.TalendDataSource> dataSources_tMysqlOutput_7 = (java.util.Map<String, routines.system.TalendDataSource>) globalMap .get(KEY_DB_DATASOURCES); if (null != dataSources_tMysqlOutput_7) { conn_tMysqlOutput_7 = dataSources_tMysqlOutput_7.get("").getConnection(); } else { String dbProperties_tMysqlOutput_7 = context.talon_AdditionalParams; String url_tMysqlOutput_7 = null; if (dbProperties_tMysqlOutput_7 == null || dbProperties_tMysqlOutput_7.trim().length() == 0) { url_tMysqlOutput_7 = "jdbc:mysql://" + context.talon_Server + ":" + context.talon_Port + "/" + context.talon_Database + "?" + "rewriteBatchedStatements=true"; } else { String properties_tMysqlOutput_7 = context.talon_AdditionalParams; if (!properties_tMysqlOutput_7.contains("rewriteBatchedStatements")) { properties_tMysqlOutput_7 += "&rewriteBatchedStatements=true"; } url_tMysqlOutput_7 = "jdbc:mysql://" + context.talon_Server + ":" + context.talon_Port + "/" + context.talon_Database + "?" + properties_tMysqlOutput_7; } String dbUser_tMysqlOutput_7 = context.talon_Login; String dbPwd_tMysqlOutput_7 = context.talon_Password; java.lang.Class.forName("org.gjt.mm.mysql.Driver"); conn_tMysqlOutput_7 = java.sql.DriverManager.getConnection(url_tMysqlOutput_7, dbUser_tMysqlOutput_7, dbPwd_tMysqlOutput_7); } conn_tMysqlOutput_7.setAutoCommit(false); int commitEvery_tMysqlOutput_7 = 10000; int commitCounter_tMysqlOutput_7 = 0; int count_tMysqlOutput_7 = 0; String insert_tMysqlOutput_7 = "INSERT INTO `" + "STATE" + "` (`ID`,`STATE`,`FULL_NAME`) VALUES (?,?,?)"; int batchSize_tMysqlOutput_7 = 100; int batchSizeCounter_tMysqlOutput_7 = 0; java.sql.PreparedStatement pstmt_tMysqlOutput_7 = conn_tMysqlOutput_7 .prepareStatement(insert_tMysqlOutput_7); /** * [tMysqlOutput_7 begin ] stop */ /** * [tMap_9 begin ] start */ ok_Hash.put("tMap_9", false); start_Hash.put("tMap_9", System.currentTimeMillis()); currentComponent = "tMap_9"; int tos_count_tMap_9 = 0; // ############################### // # Lookup's keys initialization // ############################### // ############################### // # Vars initialization class Var__tMap_9__Struct { } Var__tMap_9__Struct Var__tMap_9 = new Var__tMap_9__Struct(); // ############################### // ############################### // # Outputs initialization loadStateStruct loadState_tmp = new loadStateStruct(); // ############################### /** * [tMap_9 begin ] stop */ /** * [tJoin_6 begin ] start */ ok_Hash.put("tJoin_6", false); start_Hash.put("tJoin_6", System.currentTimeMillis()); currentComponent = "tJoin_6"; int tos_count_tJoin_6 = 0; final java.util.Map<row11Struct, row11Struct> tHash_tJoin_6 = (java.util.Map<row11Struct, row11Struct>) globalMap .get("tHash_row11"); class Util_tJoin_6 { row11Struct lookupValue = null; row11Struct row11HashKey = new row11Struct(); public boolean isJoined(stateInfoStruct mainRow) { row11HashKey.STATE = mainRow.state; row11HashKey.hashCodeDirty = true; lookupValue = tHash_tJoin_6.get(row11HashKey); if (lookupValue != null) { return true; } return false; } } Util_tJoin_6 util_tJoin_6 = new Util_tJoin_6(); int nb_line_tJoin_6 = 0; /** * [tJoin_6 begin ] stop */ /** * [tMysqlOutput_3 begin ] start */ ok_Hash.put("tMysqlOutput_3", false); start_Hash.put("tMysqlOutput_3", System.currentTimeMillis()); currentComponent = "tMysqlOutput_3"; int tos_count_tMysqlOutput_3 = 0; int nb_line_tMysqlOutput_3 = 0; int nb_line_update_tMysqlOutput_3 = 0; int nb_line_inserted_tMysqlOutput_3 = 0; int nb_line_deleted_tMysqlOutput_3 = 0; int nb_line_rejected_tMysqlOutput_3 = 0; int deletedCount_tMysqlOutput_3 = 0; int updatedCount_tMysqlOutput_3 = 0; int insertedCount_tMysqlOutput_3 = 0; int rejectedCount_tMysqlOutput_3 = 0; String tableName_tMysqlOutput_3 = "CITY"; boolean whetherReject_tMysqlOutput_3 = false; java.util.Calendar calendar_tMysqlOutput_3 = java.util.Calendar.getInstance(); calendar_tMysqlOutput_3.set(1, 0, 1, 0, 0, 0); long year1_tMysqlOutput_3 = calendar_tMysqlOutput_3.getTime().getTime(); calendar_tMysqlOutput_3.set(10000, 0, 1, 0, 0, 0); long year10000_tMysqlOutput_3 = calendar_tMysqlOutput_3.getTime().getTime(); long date_tMysqlOutput_3; java.sql.Connection conn_tMysqlOutput_3 = null; java.util.Map<String, routines.system.TalendDataSource> dataSources_tMysqlOutput_3 = (java.util.Map<String, routines.system.TalendDataSource>) globalMap .get(KEY_DB_DATASOURCES); if (null != dataSources_tMysqlOutput_3) { conn_tMysqlOutput_3 = dataSources_tMysqlOutput_3.get("").getConnection(); } else { String dbProperties_tMysqlOutput_3 = context.talon_AdditionalParams; String url_tMysqlOutput_3 = null; if (dbProperties_tMysqlOutput_3 == null || dbProperties_tMysqlOutput_3.trim().length() == 0) { url_tMysqlOutput_3 = "jdbc:mysql://" + context.talon_Server + ":" + context.talon_Port + "/" + context.talon_Database + "?" + "rewriteBatchedStatements=true"; } else { String properties_tMysqlOutput_3 = context.talon_AdditionalParams; if (!properties_tMysqlOutput_3.contains("rewriteBatchedStatements")) { properties_tMysqlOutput_3 += "&rewriteBatchedStatements=true"; } url_tMysqlOutput_3 = "jdbc:mysql://" + context.talon_Server + ":" + context.talon_Port + "/" + context.talon_Database + "?" + properties_tMysqlOutput_3; } String dbUser_tMysqlOutput_3 = context.talon_Login; String dbPwd_tMysqlOutput_3 = context.talon_Password; java.lang.Class.forName("org.gjt.mm.mysql.Driver"); conn_tMysqlOutput_3 = java.sql.DriverManager.getConnection(url_tMysqlOutput_3, dbUser_tMysqlOutput_3, dbPwd_tMysqlOutput_3); } conn_tMysqlOutput_3.setAutoCommit(false); int commitEvery_tMysqlOutput_3 = 10000; int commitCounter_tMysqlOutput_3 = 0; int count_tMysqlOutput_3 = 0; String insert_tMysqlOutput_3 = "INSERT INTO `" + "CITY" + "` (`ID`,`CITY`,`SUMMARY`,`IMAGE_URL`,`STATE_ID`) VALUES (?,?,?,?,?)"; int batchSize_tMysqlOutput_3 = 100; int batchSizeCounter_tMysqlOutput_3 = 0; java.sql.PreparedStatement pstmt_tMysqlOutput_3 = conn_tMysqlOutput_3 .prepareStatement(insert_tMysqlOutput_3); /** * [tMysqlOutput_3 begin ] stop */ /** * [tMap_3 begin ] start */ ok_Hash.put("tMap_3", false); start_Hash.put("tMap_3", System.currentTimeMillis()); currentComponent = "tMap_3"; int tos_count_tMap_3 = 0; // ############################### // # Lookup's keys initialization org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row15Struct> tHash_Lookup_row15 = null; org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row15Struct> tHash_Lookup_Cache_row15 = org.talend.designer.components.lookup.memory.AdvancedMemoryLookup .<row15Struct>getLookup( org.talend.designer.components.lookup.common.ICommonLookup.MATCHING_MODE.UNIQUE_MATCH); org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row15Struct> tHash_Lookup_Real_row15 = null; row15Struct row15HashKey = new row15Struct(); row15Struct row15Default = new row15Struct(); // ############################### // ############################### // # Vars initialization class Var__tMap_3__Struct { } Var__tMap_3__Struct Var__tMap_3 = new Var__tMap_3__Struct(); // ############################### // ############################### // # Outputs initialization loadCityStruct loadCity_tmp = new loadCityStruct(); // ############################### /** * [tMap_3 begin ] stop */ /** * [tJoin_5 begin ] start */ ok_Hash.put("tJoin_5", false); start_Hash.put("tJoin_5", System.currentTimeMillis()); currentComponent = "tJoin_5"; int tos_count_tJoin_5 = 0; final java.util.Map<row4Struct, row4Struct> tHash_tJoin_5 = (java.util.Map<row4Struct, row4Struct>) globalMap .get("tHash_row4"); class Util_tJoin_5 { row4Struct lookupValue = null; row4Struct row4HashKey = new row4Struct(); public boolean isJoined(stateCityStruct mainRow) { row4HashKey.CITY = mainRow.city; row4HashKey.hashCodeDirty = true; lookupValue = tHash_tJoin_5.get(row4HashKey); if (lookupValue != null) { return true; } return false; } } Util_tJoin_5 util_tJoin_5 = new Util_tJoin_5(); int nb_line_tJoin_5 = 0; /** * [tJoin_5 begin ] stop */ /** * [tMap_10 begin ] start */ ok_Hash.put("tMap_10", false); start_Hash.put("tMap_10", System.currentTimeMillis()); currentComponent = "tMap_10"; int tos_count_tMap_10 = 0; // ############################### // # Lookup's keys initialization // ############################### // ############################### // # Vars initialization class Var__tMap_10__Struct { } Var__tMap_10__Struct Var__tMap_10 = new Var__tMap_10__Struct(); // ############################### // ############################### // # Outputs initialization zipRowDataStruct zipRowData_tmp = new zipRowDataStruct(); stateInfoStruct stateInfo_tmp = new stateInfoStruct(); stateCityStruct stateCity_tmp = new stateCityStruct(); // ############################### /** * [tMap_10 begin ] stop */ /** * [tJavaRow_1 begin ] start */ ok_Hash.put("tJavaRow_1", false); start_Hash.put("tJavaRow_1", System.currentTimeMillis()); currentComponent = "tJavaRow_1"; int tos_count_tJavaRow_1 = 0; int nb_line_tJavaRow_1 = 0; /** * [tJavaRow_1 begin ] stop */ /** * [tFileInputJSON_1 begin ] start */ ok_Hash.put("tFileInputJSON_1", false); start_Hash.put("tFileInputJSON_1", System.currentTimeMillis()); currentComponent = "tFileInputJSON_1"; int tos_count_tFileInputJSON_1 = 0; class JSONUtil_tFileInputJSON_1 { public int getData(String query, javax.script.Invocable invocableEngine, java.util.List<org.json.simple.JSONArray> jsonResultList, int recordMaxSize) { try { // only 2 types: String/Boolean String resultObj = invocableEngine.invokeFunction("jsonPath", query) .toString(); if (!"false".equals(resultObj)) { org.json.simple.JSONArray resultArray = (org.json.simple.JSONArray) org.json.simple.JSONValue .parse(resultObj); jsonResultList.add(resultArray); if (recordMaxSize != -1 && recordMaxSize != resultArray.size()) { // just give an error, don't // stop System.err.println( "The Json resource datas maybe have some problems, please make sure the data structure with the same fields."); } recordMaxSize = Math.max(recordMaxSize, resultArray.size()); } else { System.err.println("Can't find any data with JSONPath " + query); // add null to take a place in // List(buffer) jsonResultList.add(null); } } catch (Exception e) { e.printStackTrace(); } return recordMaxSize; } void setRowValue_0(row2Struct row2, java.util.List<org.json.simple.JSONArray> JSONResultList_tFileInputJSON_1, int nbResultArray_tFileInputJSON_1) throws java.io.UnsupportedEncodingException { if (JSONResultList_tFileInputJSON_1.get(0) != null && nbResultArray_tFileInputJSON_1 < JSONResultList_tFileInputJSON_1 .get(0).size() && JSONResultList_tFileInputJSON_1.get(0) .get(nbResultArray_tFileInputJSON_1) != null) { row2.city = JSONResultList_tFileInputJSON_1.get(0) .get(nbResultArray_tFileInputJSON_1).toString(); } else { row2.city = null; } if (JSONResultList_tFileInputJSON_1.get(1) != null && nbResultArray_tFileInputJSON_1 < JSONResultList_tFileInputJSON_1 .get(1).size() && JSONResultList_tFileInputJSON_1.get(1) .get(nbResultArray_tFileInputJSON_1) != null) { row2.state = JSONResultList_tFileInputJSON_1.get(1) .get(nbResultArray_tFileInputJSON_1).toString(); } else { row2.state = null; } if (JSONResultList_tFileInputJSON_1.get(2) != null && nbResultArray_tFileInputJSON_1 < JSONResultList_tFileInputJSON_1 .get(2).size() && JSONResultList_tFileInputJSON_1.get(2) .get(nbResultArray_tFileInputJSON_1) != null) { row2.country = JSONResultList_tFileInputJSON_1.get(2) .get(nbResultArray_tFileInputJSON_1).toString(); } else { row2.country = null; } } } int nb_line_tFileInputJSON_1 = 0; javax.script.ScriptEngineManager scriptEngineMgr_tFileInputJSON_1 = new javax.script.ScriptEngineManager(); javax.script.ScriptEngine jsEngine_tFileInputJSON_1 = scriptEngineMgr_tFileInputJSON_1 .getEngineByName("JavaScript"); if (jsEngine_tFileInputJSON_1 == null) { System.err.println("No script engine found for JavaScript"); } java.io.InputStream jsonis_tFileInputJSON_1 = com.jsonpath.test.ReadJar.class .getResource("json.js").openStream(); jsEngine_tFileInputJSON_1.eval(new java.io.BufferedReader( new java.io.InputStreamReader(jsonis_tFileInputJSON_1))); java.io.InputStream jsonpathis_tFileInputJSON_1 = com.jsonpath.test.ReadJar.class .getResource("jsonpath.js").openStream(); jsEngine_tFileInputJSON_1.eval(new java.io.BufferedReader( new java.io.InputStreamReader(jsonpathis_tFileInputJSON_1))); java.net.URL url_tFileInputJSON_1 = new java.net.URL( "http://ziptasticapi.com/" + ((Integer) globalMap.get("zipCode"))); java.net.URLConnection urlConn_tFileInputJSON_1 = url_tFileInputJSON_1.openConnection(); java.io.InputStreamReader fr_tFileInputJSON_1 = new java.io.InputStreamReader( urlConn_tFileInputJSON_1.getInputStream(), "UTF-8"); java.lang.Object jsonText_tFileInputJSON_1 = org.json.simple.JSONValue .parse(fr_tFileInputJSON_1); jsEngine_tFileInputJSON_1.eval("var obj=" + jsonText_tFileInputJSON_1.toString()); java.util.List<org.json.simple.JSONArray> JSONResultList_tFileInputJSON_1 = new java.util.ArrayList<org.json.simple.JSONArray>(); int recordMaxSize_tFileInputJSON_1 = -1; javax.script.Invocable invocableEngine_tFileInputJSON_1 = (javax.script.Invocable) jsEngine_tFileInputJSON_1; JSONUtil_tFileInputJSON_1 jsonUtil_tFileInputJSON_1 = new JSONUtil_tFileInputJSON_1(); recordMaxSize_tFileInputJSON_1 = jsonUtil_tFileInputJSON_1.getData("city", invocableEngine_tFileInputJSON_1, JSONResultList_tFileInputJSON_1, recordMaxSize_tFileInputJSON_1); recordMaxSize_tFileInputJSON_1 = jsonUtil_tFileInputJSON_1.getData("state", invocableEngine_tFileInputJSON_1, JSONResultList_tFileInputJSON_1, recordMaxSize_tFileInputJSON_1); recordMaxSize_tFileInputJSON_1 = jsonUtil_tFileInputJSON_1.getData("country", invocableEngine_tFileInputJSON_1, JSONResultList_tFileInputJSON_1, recordMaxSize_tFileInputJSON_1); for (int nbResultArray_tFileInputJSON_1 = 0; nbResultArray_tFileInputJSON_1 < recordMaxSize_tFileInputJSON_1; nbResultArray_tFileInputJSON_1++) { nb_line_tFileInputJSON_1++; jsonUtil_tFileInputJSON_1.setRowValue_0(row2, JSONResultList_tFileInputJSON_1, nbResultArray_tFileInputJSON_1); /** * [tFileInputJSON_1 begin ] stop */ /** * [tFileInputJSON_1 main ] start */ currentComponent = "tFileInputJSON_1"; tos_count_tFileInputJSON_1++; /** * [tFileInputJSON_1 main ] stop */ /** * [tJavaRow_1 main ] start */ currentComponent = "tJavaRow_1"; // Code generated according to input schema and // output schema row3.city = row2.city; row3.state = row2.state; row3.country = row2.country; row3.zip = ((Integer) globalMap.get("zipCode")); nb_line_tJavaRow_1++; tos_count_tJavaRow_1++; /** * [tJavaRow_1 main ] stop */ /** * [tMap_10 main ] start */ currentComponent = "tMap_10"; boolean hasCasePrimitiveKeyWithNull_tMap_10 = false; // ############################### // # Input tables (lookups) boolean rejectedInnerJoin_tMap_10 = false; boolean mainRowRejected_tMap_10 = false; // ############################### { // start of Var scope // ############################### // # Vars tables Var__tMap_10__Struct Var = Var__tMap_10;// ############################### // ############################### // # Output tables zipRowData = null; stateInfo = null; stateCity = null; // # Output table : 'zipRowData' zipRowData_tmp.city = row3.city; zipRowData_tmp.zip = row3.zip; zipRowData = zipRowData_tmp; // # Output table : 'stateInfo' stateInfo_tmp.state = row3.state; stateInfo = stateInfo_tmp; // # Output table : 'stateCity' stateCity_tmp.city = row3.city; stateCity_tmp.state = row3.state; stateCity_tmp.zip = row3.zip; stateCity = stateCity_tmp; // ############################### } // end of Var scope rejectedInnerJoin_tMap_10 = false; tos_count_tMap_10++; /** * [tMap_10 main ] stop */ // Start of branch "zipRowData" if (zipRowData != null) { row10 = null; /** * [tMap_12 main ] start */ currentComponent = "tMap_12"; boolean hasCasePrimitiveKeyWithNull_tMap_12 = false; // ############################### // # Input tables (lookups) boolean rejectedInnerJoin_tMap_12 = false; boolean mainRowRejected_tMap_12 = false; // ///////////////////////////////////////////// // Starting Lookup Table "row12" // ///////////////////////////////////////////// boolean forceLooprow12 = false; row12Struct row12ObjectFromLookup = null; if (!rejectedInnerJoin_tMap_12) { // G_TM_M_020 hasCasePrimitiveKeyWithNull_tMap_12 = false; row12HashKey.CITY = zipRowData.city; row12HashKey.hashCodeDirty = true; tHash_Lookup_Cache_row12.lookup(row12HashKey); if (tHash_Lookup_Cache_row12.hasNext()) { // G_TM_M_835 tHash_Lookup_row12 = tHash_Lookup_Cache_row12; } // G_TM_M_834 else { // G_TM_M_835 tMysqlInput_1Process(globalMap); tHash_Lookup_row12 = (org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row12Struct>) ((org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row12Struct>) globalMap .get("tHash_Lookup_row12")); tHash_Lookup_row12.initGet(); tHash_Lookup_row12.lookup(row12HashKey); } // G_TM_M_835 if (!tHash_Lookup_row12.hasNext()) { // G_TM_M_090 rejectedInnerJoin_tMap_12 = true; } // G_TM_M_090 } // G_TM_M_020 if (tHash_Lookup_row12 != null && tHash_Lookup_row12.getCount(row12HashKey) > 1) { // G // 071 // System.out.println("WARNING: UNIQUE MATCH is configured for the lookup 'row12' and it contains more one result from keys : row12.CITY = '" // + row12HashKey.CITY + "'"); } // G 071 row12Struct row12 = null; row12Struct fromLookup_row12 = null; row12 = row12Default; if (tHash_Lookup_row12 != null && tHash_Lookup_row12.hasNext()) { // G // 099 fromLookup_row12 = tHash_Lookup_row12.next(); } // G 099 if (fromLookup_row12 != null) { row12 = fromLookup_row12; } if (tHash_Lookup_Cache_row12 != tHash_Lookup_row12) { tHash_Lookup_Cache_row12.put(row12); } // ############################### { // start of Var scope // ############################### // # Vars tables Var__tMap_12__Struct Var = Var__tMap_12;// ############################### // ############################### // # Output tables out1 = null; if (!rejectedInnerJoin_tMap_12) { // # Output table : 'out1' out1_tmp.CITY_ID = row12.ID; out1_tmp.zip = zipRowData.zip; out1 = out1_tmp; } // closing inner join bracket (2) // ############################### } // end of Var scope rejectedInnerJoin_tMap_12 = false; tos_count_tMap_12++; /** * [tMap_12 main ] stop */ // Start of branch "out1" if (out1 != null) { row10 = null; /** * [tJoin_4 main ] start */ currentComponent = "tJoin_4"; row10 = null; row10 = new row10Struct(); row10.CITY_ID = out1.CITY_ID; row10.zip = out1.zip; if (util_tJoin_4.isJoined(out1)) { row10 = null; } else { } // ///////////////////// tos_count_tJoin_4++; /** * [tJoin_4 main ] stop */ // Start of branch "row10" if (row10 != null) { /** * [tMap_13 main ] start */ currentComponent = "tMap_13"; boolean hasCasePrimitiveKeyWithNull_tMap_13 = false; // ############################### // # Input tables (lookups) boolean rejectedInnerJoin_tMap_13 = false; boolean mainRowRejected_tMap_13 = false; // ############################### { // start of Var scope // ############################### // # Vars tables Var__tMap_13__Struct Var = Var__tMap_13;// ############################### // ############################### // # Output tables loadZip = null; // # Output table : 'loadZip' loadZip_tmp.ZIP_CODE = row10.zip; loadZip_tmp.CITY_ID = row10.CITY_ID; loadZip = loadZip_tmp; // ############################### } // end of Var scope rejectedInnerJoin_tMap_13 = false; tos_count_tMap_13++; /** * [tMap_13 main ] stop */ // Start of branch "loadZip" if (loadZip != null) { /** * [tMysqlOutput_5 main ] start */ currentComponent = "tMysqlOutput_5"; whetherReject_tMysqlOutput_5 = false; pstmt_tMysqlOutput_5.setInt(1, loadZip.ZIP_CODE); pstmt_tMysqlOutput_5.setInt(2, loadZip.CITY_ID); pstmt_tMysqlOutput_5.addBatch(); nb_line_tMysqlOutput_5++; batchSizeCounter_tMysqlOutput_5++; if (batchSize_tMysqlOutput_5 <= batchSizeCounter_tMysqlOutput_5) { try { int countSum_tMysqlOutput_5 = 0; for (int countEach_tMysqlOutput_5 : pstmt_tMysqlOutput_5 .executeBatch()) { countSum_tMysqlOutput_5 += (countEach_tMysqlOutput_5 < 0 ? 0 : countEach_tMysqlOutput_5); } insertedCount_tMysqlOutput_5 += countSum_tMysqlOutput_5; } catch (java.sql.BatchUpdateException e) { int countSum_tMysqlOutput_5 = 0; for (int countEach_tMysqlOutput_5 : e.getUpdateCounts()) { countSum_tMysqlOutput_5 += (countEach_tMysqlOutput_5 < 0 ? 0 : countEach_tMysqlOutput_5); } insertedCount_tMysqlOutput_5 += countSum_tMysqlOutput_5; System.err.println(e.getMessage()); } batchSizeCounter_tMysqlOutput_5 = 0; } commitCounter_tMysqlOutput_5++; if (commitEvery_tMysqlOutput_5 <= commitCounter_tMysqlOutput_5) { try { int countSum_tMysqlOutput_5 = 0; for (int countEach_tMysqlOutput_5 : pstmt_tMysqlOutput_5 .executeBatch()) { countSum_tMysqlOutput_5 += (countEach_tMysqlOutput_5 < 0 ? 0 : countEach_tMysqlOutput_5); } insertedCount_tMysqlOutput_5 += countSum_tMysqlOutput_5; } catch (java.sql.BatchUpdateException e) { int countSum_tMysqlOutput_5 = 0; for (int countEach_tMysqlOutput_5 : e.getUpdateCounts()) { countSum_tMysqlOutput_5 += (countEach_tMysqlOutput_5 < 0 ? 0 : countEach_tMysqlOutput_5); } insertedCount_tMysqlOutput_5 += countSum_tMysqlOutput_5; System.out.println(e.getMessage()); } conn_tMysqlOutput_5.commit(); commitCounter_tMysqlOutput_5 = 0; } tos_count_tMysqlOutput_5++; /** * [tMysqlOutput_5 main ] stop */ } // End of branch "loadZip" } // End of branch "row10" } // End of branch "out1" } // End of branch "zipRowData" // Start of branch "stateInfo" if (stateInfo != null) { row13 = null; /** * [tJoin_6 main ] start */ currentComponent = "tJoin_6"; row13 = null; row13 = new row13Struct(); row13.state = stateInfo.state; if (util_tJoin_6.isJoined(stateInfo)) { row13 = null; } else { } // ///////////////////// tos_count_tJoin_6++; /** * [tJoin_6 main ] stop */ // Start of branch "row13" if (row13 != null) { /** * [tMap_9 main ] start */ currentComponent = "tMap_9"; boolean hasCasePrimitiveKeyWithNull_tMap_9 = false; // ############################### // # Input tables (lookups) boolean rejectedInnerJoin_tMap_9 = false; boolean mainRowRejected_tMap_9 = false; // ############################### { // start of Var scope // ############################### // # Vars tables Var__tMap_9__Struct Var = Var__tMap_9;// ############################### // ############################### // # Output tables loadState = null; // # Output table : 'loadState' loadState_tmp.ID = 0; loadState_tmp.STATE = row13.state; loadState_tmp.FULL_NAME = null; loadState = loadState_tmp; // ############################### } // end of Var scope rejectedInnerJoin_tMap_9 = false; tos_count_tMap_9++; /** * [tMap_9 main ] stop */ // Start of branch "loadState" if (loadState != null) { /** * [tMysqlOutput_7 main ] start */ currentComponent = "tMysqlOutput_7"; whetherReject_tMysqlOutput_7 = false; pstmt_tMysqlOutput_7.setInt(1, loadState.ID); if (loadState.STATE == null) { pstmt_tMysqlOutput_7.setNull(2, java.sql.Types.VARCHAR); } else { pstmt_tMysqlOutput_7.setString(2, loadState.STATE); } if (loadState.FULL_NAME == null) { pstmt_tMysqlOutput_7.setNull(3, java.sql.Types.VARCHAR); } else { pstmt_tMysqlOutput_7.setString(3, loadState.FULL_NAME); } pstmt_tMysqlOutput_7.addBatch(); nb_line_tMysqlOutput_7++; batchSizeCounter_tMysqlOutput_7++; if (batchSize_tMysqlOutput_7 <= batchSizeCounter_tMysqlOutput_7) { try { int countSum_tMysqlOutput_7 = 0; for (int countEach_tMysqlOutput_7 : pstmt_tMysqlOutput_7 .executeBatch()) { countSum_tMysqlOutput_7 += (countEach_tMysqlOutput_7 < 0 ? 0 : countEach_tMysqlOutput_7); } insertedCount_tMysqlOutput_7 += countSum_tMysqlOutput_7; } catch (java.sql.BatchUpdateException e) { int countSum_tMysqlOutput_7 = 0; for (int countEach_tMysqlOutput_7 : e.getUpdateCounts()) { countSum_tMysqlOutput_7 += (countEach_tMysqlOutput_7 < 0 ? 0 : countEach_tMysqlOutput_7); } insertedCount_tMysqlOutput_7 += countSum_tMysqlOutput_7; System.err.println(e.getMessage()); } batchSizeCounter_tMysqlOutput_7 = 0; } commitCounter_tMysqlOutput_7++; if (commitEvery_tMysqlOutput_7 <= commitCounter_tMysqlOutput_7) { try { int countSum_tMysqlOutput_7 = 0; for (int countEach_tMysqlOutput_7 : pstmt_tMysqlOutput_7 .executeBatch()) { countSum_tMysqlOutput_7 += (countEach_tMysqlOutput_7 < 0 ? 0 : countEach_tMysqlOutput_7); } insertedCount_tMysqlOutput_7 += countSum_tMysqlOutput_7; } catch (java.sql.BatchUpdateException e) { int countSum_tMysqlOutput_7 = 0; for (int countEach_tMysqlOutput_7 : e.getUpdateCounts()) { countSum_tMysqlOutput_7 += (countEach_tMysqlOutput_7 < 0 ? 0 : countEach_tMysqlOutput_7); } insertedCount_tMysqlOutput_7 += countSum_tMysqlOutput_7; System.out.println(e.getMessage()); } conn_tMysqlOutput_7.commit(); commitCounter_tMysqlOutput_7 = 0; } tos_count_tMysqlOutput_7++; /** * [tMysqlOutput_7 main ] stop */ } // End of branch "loadState" } // End of branch "row13" } // End of branch "stateInfo" // Start of branch "stateCity" if (stateCity != null) { row5 = null; /** * [tJoin_5 main ] start */ currentComponent = "tJoin_5"; row5 = null; row5 = new row5Struct(); row5.city = stateCity.city; row5.state = stateCity.state; row5.zip = stateCity.zip; if (util_tJoin_5.isJoined(stateCity)) { row5 = null; } else { } // ///////////////////// tos_count_tJoin_5++; /** * [tJoin_5 main ] stop */ // Start of branch "row5" if (row5 != null) { /** * [tMap_3 main ] start */ currentComponent = "tMap_3"; boolean hasCasePrimitiveKeyWithNull_tMap_3 = false; // ############################### // # Input tables (lookups) boolean rejectedInnerJoin_tMap_3 = false; boolean mainRowRejected_tMap_3 = false; // ///////////////////////////////////////////// // Starting Lookup Table "row15" // ///////////////////////////////////////////// boolean forceLooprow15 = false; row15Struct row15ObjectFromLookup = null; if (!rejectedInnerJoin_tMap_3) { // G_TM_M_020 hasCasePrimitiveKeyWithNull_tMap_3 = false; row15HashKey.STATE = row5.state; row15HashKey.hashCodeDirty = true; tHash_Lookup_Cache_row15.lookup(row15HashKey); if (tHash_Lookup_Cache_row15.hasNext()) { // G_TM_M_835 tHash_Lookup_row15 = tHash_Lookup_Cache_row15; } // G_TM_M_834 else { // G_TM_M_835 tMysqlInput_11Process(globalMap); tHash_Lookup_row15 = (org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row15Struct>) ((org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row15Struct>) globalMap .get("tHash_Lookup_row15")); tHash_Lookup_row15.initGet(); tHash_Lookup_row15.lookup(row15HashKey); } // G_TM_M_835 if (!tHash_Lookup_row15.hasNext()) { // G_TM_M_090 rejectedInnerJoin_tMap_3 = true; } // G_TM_M_090 } // G_TM_M_020 if (tHash_Lookup_row15 != null && tHash_Lookup_row15.getCount(row15HashKey) > 1) { // G // 071 // System.out.println("WARNING: UNIQUE MATCH is configured for the lookup 'row15' and it contains more one result from keys : row15.STATE = '" // + row15HashKey.STATE + "'"); } // G 071 row15Struct row15 = null; row15Struct fromLookup_row15 = null; row15 = row15Default; if (tHash_Lookup_row15 != null && tHash_Lookup_row15.hasNext()) { // G // 099 fromLookup_row15 = tHash_Lookup_row15.next(); } // G 099 if (fromLookup_row15 != null) { row15 = fromLookup_row15; } if (tHash_Lookup_Cache_row15 != tHash_Lookup_row15) { tHash_Lookup_Cache_row15.put(row15); } // ############################### { // start of Var scope // ############################### // # Vars tables Var__tMap_3__Struct Var = Var__tMap_3;// ############################### // ############################### // # Output tables loadCity = null; if (!rejectedInnerJoin_tMap_3) { // # Output table : 'loadCity' loadCity_tmp.ID = 0; loadCity_tmp.CITY = row5.city; loadCity_tmp.SUMMARY = "na"; loadCity_tmp.IMAGE_URL = "na"; loadCity_tmp.STATE_ID = row15.ID; loadCity = loadCity_tmp; } // closing inner join bracket (2) // ############################### } // end of Var scope rejectedInnerJoin_tMap_3 = false; tos_count_tMap_3++; /** * [tMap_3 main ] stop */ // Start of branch "loadCity" if (loadCity != null) { /** * [tMysqlOutput_3 main ] start */ currentComponent = "tMysqlOutput_3"; whetherReject_tMysqlOutput_3 = false; pstmt_tMysqlOutput_3.setInt(1, loadCity.ID); if (loadCity.CITY == null) { pstmt_tMysqlOutput_3.setNull(2, java.sql.Types.VARCHAR); } else { pstmt_tMysqlOutput_3.setString(2, loadCity.CITY); } if (loadCity.SUMMARY == null) { pstmt_tMysqlOutput_3.setNull(3, java.sql.Types.VARCHAR); } else { pstmt_tMysqlOutput_3.setString(3, loadCity.SUMMARY); } if (loadCity.IMAGE_URL == null) { pstmt_tMysqlOutput_3.setNull(4, java.sql.Types.VARCHAR); } else { pstmt_tMysqlOutput_3.setString(4, loadCity.IMAGE_URL); } pstmt_tMysqlOutput_3.setInt(5, loadCity.STATE_ID); pstmt_tMysqlOutput_3.addBatch(); nb_line_tMysqlOutput_3++; batchSizeCounter_tMysqlOutput_3++; if (batchSize_tMysqlOutput_3 <= batchSizeCounter_tMysqlOutput_3) { try { int countSum_tMysqlOutput_3 = 0; for (int countEach_tMysqlOutput_3 : pstmt_tMysqlOutput_3 .executeBatch()) { countSum_tMysqlOutput_3 += (countEach_tMysqlOutput_3 < 0 ? 0 : countEach_tMysqlOutput_3); } insertedCount_tMysqlOutput_3 += countSum_tMysqlOutput_3; } catch (java.sql.BatchUpdateException e) { int countSum_tMysqlOutput_3 = 0; for (int countEach_tMysqlOutput_3 : e.getUpdateCounts()) { countSum_tMysqlOutput_3 += (countEach_tMysqlOutput_3 < 0 ? 0 : countEach_tMysqlOutput_3); } insertedCount_tMysqlOutput_3 += countSum_tMysqlOutput_3; System.err.println(e.getMessage()); } batchSizeCounter_tMysqlOutput_3 = 0; } commitCounter_tMysqlOutput_3++; if (commitEvery_tMysqlOutput_3 <= commitCounter_tMysqlOutput_3) { try { int countSum_tMysqlOutput_3 = 0; for (int countEach_tMysqlOutput_3 : pstmt_tMysqlOutput_3 .executeBatch()) { countSum_tMysqlOutput_3 += (countEach_tMysqlOutput_3 < 0 ? 0 : countEach_tMysqlOutput_3); } insertedCount_tMysqlOutput_3 += countSum_tMysqlOutput_3; } catch (java.sql.BatchUpdateException e) { int countSum_tMysqlOutput_3 = 0; for (int countEach_tMysqlOutput_3 : e.getUpdateCounts()) { countSum_tMysqlOutput_3 += (countEach_tMysqlOutput_3 < 0 ? 0 : countEach_tMysqlOutput_3); } insertedCount_tMysqlOutput_3 += countSum_tMysqlOutput_3; System.out.println(e.getMessage()); } conn_tMysqlOutput_3.commit(); commitCounter_tMysqlOutput_3 = 0; } tos_count_tMysqlOutput_3++; /** * [tMysqlOutput_3 main ] stop */ } // End of branch "loadCity" } // End of branch "row5" } // End of branch "stateCity" /** * [tFileInputJSON_1 end ] start */ currentComponent = "tFileInputJSON_1"; } globalMap.put("tFileInputJSON_1_NB_LINE", nb_line_tFileInputJSON_1); ok_Hash.put("tFileInputJSON_1", true); end_Hash.put("tFileInputJSON_1", System.currentTimeMillis()); /** * [tFileInputJSON_1 end ] stop */ /** * [tJavaRow_1 end ] start */ currentComponent = "tJavaRow_1"; globalMap.put("tJavaRow_1_NB_LINE", nb_line_tJavaRow_1); ok_Hash.put("tJavaRow_1", true); end_Hash.put("tJavaRow_1", System.currentTimeMillis()); /** * [tJavaRow_1 end ] stop */ /** * [tMap_10 end ] start */ currentComponent = "tMap_10"; // ############################### // # Lookup hashes releasing // ############################### ok_Hash.put("tMap_10", true); end_Hash.put("tMap_10", System.currentTimeMillis()); /** * [tMap_10 end ] stop */ /** * [tJoin_5 end ] start */ currentComponent = "tJoin_5"; ok_Hash.put("tJoin_5", true); end_Hash.put("tJoin_5", System.currentTimeMillis()); /** * [tJoin_5 end ] stop */ /** * [tMap_3 end ] start */ currentComponent = "tMap_3"; // ############################### // # Lookup hashes releasing // ############################### ok_Hash.put("tMap_3", true); end_Hash.put("tMap_3", System.currentTimeMillis()); /** * [tMap_3 end ] stop */ /** * [tMysqlOutput_3 end ] start */ currentComponent = "tMysqlOutput_3"; try { if (batchSizeCounter_tMysqlOutput_3 != 0) { int countSum_tMysqlOutput_3 = 0; for (int countEach_tMysqlOutput_3 : pstmt_tMysqlOutput_3.executeBatch()) { countSum_tMysqlOutput_3 += (countEach_tMysqlOutput_3 < 0 ? 0 : countEach_tMysqlOutput_3); } insertedCount_tMysqlOutput_3 += countSum_tMysqlOutput_3; } } catch (java.sql.BatchUpdateException e) { int countSum_tMysqlOutput_3 = 0; for (int countEach_tMysqlOutput_3 : e.getUpdateCounts()) { countSum_tMysqlOutput_3 += (countEach_tMysqlOutput_3 < 0 ? 0 : countEach_tMysqlOutput_3); } insertedCount_tMysqlOutput_3 += countSum_tMysqlOutput_3; System.err.println(e.getMessage()); } batchSizeCounter_tMysqlOutput_3 = 0; try { if (pstmt_tMysqlOutput_3 != null) { int countSum_tMysqlOutput_3 = 0; for (int countEach_tMysqlOutput_3 : pstmt_tMysqlOutput_3.executeBatch()) { countSum_tMysqlOutput_3 += (countEach_tMysqlOutput_3 < 0 ? 0 : countEach_tMysqlOutput_3); } insertedCount_tMysqlOutput_3 += countSum_tMysqlOutput_3; } } catch (java.sql.BatchUpdateException e) { int countSum_tMysqlOutput_3 = 0; for (int countEach_tMysqlOutput_3 : e.getUpdateCounts()) { countSum_tMysqlOutput_3 += (countEach_tMysqlOutput_3 < 0 ? 0 : countEach_tMysqlOutput_3); } insertedCount_tMysqlOutput_3 += countSum_tMysqlOutput_3; System.out.println(e.getMessage()); } if (pstmt_tMysqlOutput_3 != null) { pstmt_tMysqlOutput_3.close(); } conn_tMysqlOutput_3.commit(); conn_tMysqlOutput_3.close(); nb_line_deleted_tMysqlOutput_3 = nb_line_deleted_tMysqlOutput_3 + deletedCount_tMysqlOutput_3; nb_line_update_tMysqlOutput_3 = nb_line_update_tMysqlOutput_3 + updatedCount_tMysqlOutput_3; nb_line_inserted_tMysqlOutput_3 = nb_line_inserted_tMysqlOutput_3 + insertedCount_tMysqlOutput_3; nb_line_rejected_tMysqlOutput_3 = nb_line_rejected_tMysqlOutput_3 + rejectedCount_tMysqlOutput_3; globalMap.put("tMysqlOutput_3_NB_LINE", nb_line_tMysqlOutput_3); globalMap.put("tMysqlOutput_3_NB_LINE_UPDATED", nb_line_update_tMysqlOutput_3); globalMap.put("tMysqlOutput_3_NB_LINE_INSERTED", nb_line_inserted_tMysqlOutput_3); globalMap.put("tMysqlOutput_3_NB_LINE_DELETED", nb_line_deleted_tMysqlOutput_3); globalMap.put("tMysqlOutput_3_NB_LINE_REJECTED", nb_line_rejected_tMysqlOutput_3); ok_Hash.put("tMysqlOutput_3", true); end_Hash.put("tMysqlOutput_3", System.currentTimeMillis()); /** * [tMysqlOutput_3 end ] stop */ /** * [tJoin_6 end ] start */ currentComponent = "tJoin_6"; ok_Hash.put("tJoin_6", true); end_Hash.put("tJoin_6", System.currentTimeMillis()); /** * [tJoin_6 end ] stop */ /** * [tMap_9 end ] start */ currentComponent = "tMap_9"; // ############################### // # Lookup hashes releasing // ############################### ok_Hash.put("tMap_9", true); end_Hash.put("tMap_9", System.currentTimeMillis()); /** * [tMap_9 end ] stop */ /** * [tMysqlOutput_7 end ] start */ currentComponent = "tMysqlOutput_7"; try { if (batchSizeCounter_tMysqlOutput_7 != 0) { int countSum_tMysqlOutput_7 = 0; for (int countEach_tMysqlOutput_7 : pstmt_tMysqlOutput_7.executeBatch()) { countSum_tMysqlOutput_7 += (countEach_tMysqlOutput_7 < 0 ? 0 : countEach_tMysqlOutput_7); } insertedCount_tMysqlOutput_7 += countSum_tMysqlOutput_7; } } catch (java.sql.BatchUpdateException e) { int countSum_tMysqlOutput_7 = 0; for (int countEach_tMysqlOutput_7 : e.getUpdateCounts()) { countSum_tMysqlOutput_7 += (countEach_tMysqlOutput_7 < 0 ? 0 : countEach_tMysqlOutput_7); } insertedCount_tMysqlOutput_7 += countSum_tMysqlOutput_7; System.err.println(e.getMessage()); } batchSizeCounter_tMysqlOutput_7 = 0; try { if (pstmt_tMysqlOutput_7 != null) { int countSum_tMysqlOutput_7 = 0; for (int countEach_tMysqlOutput_7 : pstmt_tMysqlOutput_7.executeBatch()) { countSum_tMysqlOutput_7 += (countEach_tMysqlOutput_7 < 0 ? 0 : countEach_tMysqlOutput_7); } insertedCount_tMysqlOutput_7 += countSum_tMysqlOutput_7; } } catch (java.sql.BatchUpdateException e) { int countSum_tMysqlOutput_7 = 0; for (int countEach_tMysqlOutput_7 : e.getUpdateCounts()) { countSum_tMysqlOutput_7 += (countEach_tMysqlOutput_7 < 0 ? 0 : countEach_tMysqlOutput_7); } insertedCount_tMysqlOutput_7 += countSum_tMysqlOutput_7; System.out.println(e.getMessage()); } if (pstmt_tMysqlOutput_7 != null) { pstmt_tMysqlOutput_7.close(); } conn_tMysqlOutput_7.commit(); conn_tMysqlOutput_7.close(); nb_line_deleted_tMysqlOutput_7 = nb_line_deleted_tMysqlOutput_7 + deletedCount_tMysqlOutput_7; nb_line_update_tMysqlOutput_7 = nb_line_update_tMysqlOutput_7 + updatedCount_tMysqlOutput_7; nb_line_inserted_tMysqlOutput_7 = nb_line_inserted_tMysqlOutput_7 + insertedCount_tMysqlOutput_7; nb_line_rejected_tMysqlOutput_7 = nb_line_rejected_tMysqlOutput_7 + rejectedCount_tMysqlOutput_7; globalMap.put("tMysqlOutput_7_NB_LINE", nb_line_tMysqlOutput_7); globalMap.put("tMysqlOutput_7_NB_LINE_UPDATED", nb_line_update_tMysqlOutput_7); globalMap.put("tMysqlOutput_7_NB_LINE_INSERTED", nb_line_inserted_tMysqlOutput_7); globalMap.put("tMysqlOutput_7_NB_LINE_DELETED", nb_line_deleted_tMysqlOutput_7); globalMap.put("tMysqlOutput_7_NB_LINE_REJECTED", nb_line_rejected_tMysqlOutput_7); ok_Hash.put("tMysqlOutput_7", true); end_Hash.put("tMysqlOutput_7", System.currentTimeMillis()); /** * [tMysqlOutput_7 end ] stop */ /** * [tMap_12 end ] start */ currentComponent = "tMap_12"; // ############################### // # Lookup hashes releasing // ############################### ok_Hash.put("tMap_12", true); end_Hash.put("tMap_12", System.currentTimeMillis()); /** * [tMap_12 end ] stop */ /** * [tJoin_4 end ] start */ currentComponent = "tJoin_4"; ok_Hash.put("tJoin_4", true); end_Hash.put("tJoin_4", System.currentTimeMillis()); /** * [tJoin_4 end ] stop */ /** * [tMap_13 end ] start */ currentComponent = "tMap_13"; // ############################### // # Lookup hashes releasing // ############################### ok_Hash.put("tMap_13", true); end_Hash.put("tMap_13", System.currentTimeMillis()); /** * [tMap_13 end ] stop */ /** * [tMysqlOutput_5 end ] start */ currentComponent = "tMysqlOutput_5"; try { if (batchSizeCounter_tMysqlOutput_5 != 0) { int countSum_tMysqlOutput_5 = 0; for (int countEach_tMysqlOutput_5 : pstmt_tMysqlOutput_5.executeBatch()) { countSum_tMysqlOutput_5 += (countEach_tMysqlOutput_5 < 0 ? 0 : countEach_tMysqlOutput_5); } insertedCount_tMysqlOutput_5 += countSum_tMysqlOutput_5; } } catch (java.sql.BatchUpdateException e) { int countSum_tMysqlOutput_5 = 0; for (int countEach_tMysqlOutput_5 : e.getUpdateCounts()) { countSum_tMysqlOutput_5 += (countEach_tMysqlOutput_5 < 0 ? 0 : countEach_tMysqlOutput_5); } insertedCount_tMysqlOutput_5 += countSum_tMysqlOutput_5; System.err.println(e.getMessage()); } batchSizeCounter_tMysqlOutput_5 = 0; try { if (pstmt_tMysqlOutput_5 != null) { int countSum_tMysqlOutput_5 = 0; for (int countEach_tMysqlOutput_5 : pstmt_tMysqlOutput_5.executeBatch()) { countSum_tMysqlOutput_5 += (countEach_tMysqlOutput_5 < 0 ? 0 : countEach_tMysqlOutput_5); } insertedCount_tMysqlOutput_5 += countSum_tMysqlOutput_5; } } catch (java.sql.BatchUpdateException e) { int countSum_tMysqlOutput_5 = 0; for (int countEach_tMysqlOutput_5 : e.getUpdateCounts()) { countSum_tMysqlOutput_5 += (countEach_tMysqlOutput_5 < 0 ? 0 : countEach_tMysqlOutput_5); } insertedCount_tMysqlOutput_5 += countSum_tMysqlOutput_5; System.out.println(e.getMessage()); } if (pstmt_tMysqlOutput_5 != null) { pstmt_tMysqlOutput_5.close(); } conn_tMysqlOutput_5.commit(); conn_tMysqlOutput_5.close(); nb_line_deleted_tMysqlOutput_5 = nb_line_deleted_tMysqlOutput_5 + deletedCount_tMysqlOutput_5; nb_line_update_tMysqlOutput_5 = nb_line_update_tMysqlOutput_5 + updatedCount_tMysqlOutput_5; nb_line_inserted_tMysqlOutput_5 = nb_line_inserted_tMysqlOutput_5 + insertedCount_tMysqlOutput_5; nb_line_rejected_tMysqlOutput_5 = nb_line_rejected_tMysqlOutput_5 + rejectedCount_tMysqlOutput_5; globalMap.put("tMysqlOutput_5_NB_LINE", nb_line_tMysqlOutput_5); globalMap.put("tMysqlOutput_5_NB_LINE_UPDATED", nb_line_update_tMysqlOutput_5); globalMap.put("tMysqlOutput_5_NB_LINE_INSERTED", nb_line_inserted_tMysqlOutput_5); globalMap.put("tMysqlOutput_5_NB_LINE_DELETED", nb_line_deleted_tMysqlOutput_5); globalMap.put("tMysqlOutput_5_NB_LINE_REJECTED", nb_line_rejected_tMysqlOutput_5); ok_Hash.put("tMysqlOutput_5", true); end_Hash.put("tMysqlOutput_5", System.currentTimeMillis()); /** * [tMysqlOutput_5 end ] stop */ } // End of branch "zipCode" // Start of branch "propertyData" if (propertyData != null) { row9 = null; /** * [tMap_4 main ] start */ currentComponent = "tMap_4"; boolean hasCasePrimitiveKeyWithNull_tMap_4 = false; // ############################### // # Input tables (lookups) boolean rejectedInnerJoin_tMap_4 = false; boolean mainRowRejected_tMap_4 = false; // ///////////////////////////////////////////// // Starting Lookup Table "custData" // ///////////////////////////////////////////// boolean forceLoopcustData = false; custDataStruct custDataObjectFromLookup = null; if (!rejectedInnerJoin_tMap_4) { // G_TM_M_020 hasCasePrimitiveKeyWithNull_tMap_4 = false; custDataHashKey.CUST_NAME = propertyData.customer; custDataHashKey.hashCodeDirty = true; tHash_Lookup_custData.lookup(custDataHashKey); if (!tHash_Lookup_custData.hasNext()) { // G_TM_M_090 rejectedInnerJoin_tMap_4 = true; } // G_TM_M_090 } // G_TM_M_020 if (tHash_Lookup_custData != null && tHash_Lookup_custData.getCount(custDataHashKey) > 1) { // G // 071 // System.out.println("WARNING: UNIQUE MATCH is configured for the lookup 'custData' and it contains more one result from keys : custData.CUST_NAME = '" // + custDataHashKey.CUST_NAME + "'"); } // G 071 custDataStruct custData = null; custDataStruct fromLookup_custData = null; custData = custDataDefault; if (tHash_Lookup_custData != null && tHash_Lookup_custData.hasNext()) { // G // 099 fromLookup_custData = tHash_Lookup_custData.next(); } // G 099 if (fromLookup_custData != null) { custData = fromLookup_custData; } // ############################### { // start of Var scope // ############################### // # Vars tables Var__tMap_4__Struct Var = Var__tMap_4;// ############################### // ############################### // # Output tables loadData = null; if (!rejectedInnerJoin_tMap_4) { // # Output table : 'loadData' loadData_tmp.PROP_NAME = propertyData.name; loadData_tmp.PRICE = propertyData.price__c; loadData_tmp.SQFT = "0"; loadData_tmp.DESCRIPTION = propertyData.pba__description_pb__c; loadData_tmp.NUM_BEDS = propertyData.bedrooms__c; loadData_tmp.NUM_BATHS = propertyData.bathrooms__c; loadData_tmp.TYPE = propertyData.pba__propertytype__c; loadData_tmp.STATUS = propertyData.pba__status__c; loadData_tmp.DATA_SOURCE_ID = custData.DATA_SOURCE_ID; loadData_tmp.ZIP_CODE = propertyData.zipcode__c; loadData = loadData_tmp; } // closing inner join bracket (2) // ############################### } // end of Var scope rejectedInnerJoin_tMap_4 = false; tos_count_tMap_4++; /** * [tMap_4 main ] stop */ // Start of branch "loadData" if (loadData != null) { row9 = null; /** * [tJoin_3 main ] start */ currentComponent = "tJoin_3"; row9 = null; row9 = new row9Struct(); row9.PROP_NAME = loadData.PROP_NAME; row9.PRICE = loadData.PRICE; row9.SQFT = loadData.SQFT; row9.DESCRIPTION = loadData.DESCRIPTION; row9.NUM_BEDS = loadData.NUM_BEDS; row9.NUM_BATHS = loadData.NUM_BATHS; row9.TYPE = loadData.TYPE; row9.STATUS = loadData.STATUS; row9.DATA_SOURCE_ID = loadData.DATA_SOURCE_ID; row9.ZIP_CODE = loadData.ZIP_CODE; if (util_tJoin_3.isJoined(loadData)) { row9 = null; } else { } // ///////////////////// tos_count_tJoin_3++; /** * [tJoin_3 main ] stop */ // Start of branch "row9" if (row9 != null) { /** * [tJavaRow_3 main ] start */ currentComponent = "tJavaRow_3"; // Code generated according to input schema // and output schema System.out.println( "***** Loading New Property Data for:" + row9.PROP_NAME + " *****"); row14.PROP_NAME = row9.PROP_NAME; row14.PRICE = row9.PRICE; row14.SQFT = row9.SQFT; row14.DESCRIPTION = row9.DESCRIPTION; row14.NUM_BEDS = row9.NUM_BEDS; row14.NUM_BATHS = row9.NUM_BATHS; row14.TYPE = row9.TYPE; row14.STATUS = row9.STATUS; row14.ZIP_CODE = row9.ZIP_CODE; row14.DATA_SOURCE_ID = row9.DATA_SOURCE_ID; row14.PROP_UUID = UUID.randomUUID().toString(); nb_line_tJavaRow_3++; tos_count_tJavaRow_3++; /** * [tJavaRow_3 main ] stop */ /** * [tMap_8 main ] start */ currentComponent = "tMap_8"; boolean hasCasePrimitiveKeyWithNull_tMap_8 = false; // ############################### // # Input tables (lookups) boolean rejectedInnerJoin_tMap_8 = false; boolean mainRowRejected_tMap_8 = false; // ############################### { // start of Var scope // ############################### // # Vars tables Var__tMap_8__Struct Var = Var__tMap_8;// ############################### // ############################### // # Output tables newData = null; // # Output table : 'newData' newData_tmp.ID = 0; newData_tmp.UUID = row14.PROP_UUID; newData_tmp.PROP_NAME = row14.PROP_NAME; newData_tmp.PRICE = row14.PRICE; newData_tmp.SQFT = row14.SQFT; newData_tmp.DESCRIPTION = row14.DESCRIPTION; newData_tmp.NUM_BEDS = row14.NUM_BEDS; newData_tmp.NUM_BATHS = row14.NUM_BATHS; newData_tmp.TYPE = row14.TYPE; newData_tmp.STATUS = row14.STATUS; newData_tmp.DATA_SOURCE_ID = row14.DATA_SOURCE_ID; newData_tmp.ZIP_CODE = row14.ZIP_CODE; newData = newData_tmp; // ############################### } // end of Var scope rejectedInnerJoin_tMap_8 = false; tos_count_tMap_8++; /** * [tMap_8 main ] stop */ // Start of branch "newData" if (newData != null) { /** * [tMysqlOutput_1 main ] start */ currentComponent = "tMysqlOutput_1"; whetherReject_tMysqlOutput_1 = false; pstmt_tMysqlOutput_1.setInt(1, newData.ID); if (newData.UUID == null) { pstmt_tMysqlOutput_1.setNull(2, java.sql.Types.VARCHAR); } else { pstmt_tMysqlOutput_1.setString(2, newData.UUID); } if (newData.PROP_NAME == null) { pstmt_tMysqlOutput_1.setNull(3, java.sql.Types.VARCHAR); } else { pstmt_tMysqlOutput_1.setString(3, newData.PROP_NAME); } pstmt_tMysqlOutput_1.setFloat(4, newData.PRICE); if (newData.SQFT == null) { pstmt_tMysqlOutput_1.setNull(5, java.sql.Types.VARCHAR); } else { pstmt_tMysqlOutput_1.setString(5, newData.SQFT); } if (newData.DESCRIPTION == null) { pstmt_tMysqlOutput_1.setNull(6, java.sql.Types.VARCHAR); } else { pstmt_tMysqlOutput_1.setString(6, newData.DESCRIPTION); } pstmt_tMysqlOutput_1.setFloat(7, newData.NUM_BEDS); pstmt_tMysqlOutput_1.setFloat(8, newData.NUM_BATHS); if (newData.TYPE == null) { pstmt_tMysqlOutput_1.setNull(9, java.sql.Types.VARCHAR); } else { pstmt_tMysqlOutput_1.setString(9, newData.TYPE); } if (newData.STATUS == null) { pstmt_tMysqlOutput_1.setNull(10, java.sql.Types.VARCHAR); } else { pstmt_tMysqlOutput_1.setString(10, newData.STATUS); } pstmt_tMysqlOutput_1.setInt(11, newData.DATA_SOURCE_ID); pstmt_tMysqlOutput_1.setInt(12, newData.ZIP_CODE); try { insertedCount_tMysqlOutput_1 = insertedCount_tMysqlOutput_1 + pstmt_tMysqlOutput_1.executeUpdate(); nb_line_tMysqlOutput_1++; } catch (Exception e) { whetherReject_tMysqlOutput_1 = true; System.err.print(e.getMessage()); } commitCounter_tMysqlOutput_1++; if (commitEvery_tMysqlOutput_1 <= commitCounter_tMysqlOutput_1) { try { int countSum_tMysqlOutput_1 = 0; for (int countEach_tMysqlOutput_1 : pstmt_tMysqlOutput_1 .executeBatch()) { countSum_tMysqlOutput_1 += (countEach_tMysqlOutput_1 < 0 ? 0 : countEach_tMysqlOutput_1); } insertedCount_tMysqlOutput_1 += countSum_tMysqlOutput_1; } catch (java.sql.BatchUpdateException e) { int countSum_tMysqlOutput_1 = 0; for (int countEach_tMysqlOutput_1 : e.getUpdateCounts()) { countSum_tMysqlOutput_1 += (countEach_tMysqlOutput_1 < 0 ? 0 : countEach_tMysqlOutput_1); } insertedCount_tMysqlOutput_1 += countSum_tMysqlOutput_1; System.out.println(e.getMessage()); } conn_tMysqlOutput_1.commit(); commitCounter_tMysqlOutput_1 = 0; } tos_count_tMysqlOutput_1++; /** * [tMysqlOutput_1 main ] stop */ } // End of branch "newData" } // End of branch "row9" } // End of branch "loadData" } // End of branch "propertyData" } // End of branch "row1" /** * [tFileInputXML_1 end ] start */ currentComponent = "tFileInputXML_1"; } try { looper_tFileInputXML_1.handleTaskResponse(); } catch (Exception e) { System.err.println(e.getMessage()); } globalMap.put("tFileInputXML_1_NB_LINE", nb_line_tFileInputXML_1); ok_Hash.put("tFileInputXML_1", true); end_Hash.put("tFileInputXML_1", System.currentTimeMillis()); /** * [tFileInputXML_1 end ] stop */ /** * [tMap_2 end ] start */ currentComponent = "tMap_2"; // ############################### // # Lookup hashes releasing // ############################### ok_Hash.put("tMap_2", true); end_Hash.put("tMap_2", System.currentTimeMillis()); /** * [tMap_2 end ] stop */ /** * [tMap_4 end ] start */ currentComponent = "tMap_4"; // ############################### // # Lookup hashes releasing if (tHash_Lookup_custData != null) { tHash_Lookup_custData.endGet(); } globalMap.remove("tHash_Lookup_custData"); // ############################### ok_Hash.put("tMap_4", true); end_Hash.put("tMap_4", System.currentTimeMillis()); /** * [tMap_4 end ] stop */ /** * [tJoin_3 end ] start */ currentComponent = "tJoin_3"; ok_Hash.put("tJoin_3", true); end_Hash.put("tJoin_3", System.currentTimeMillis()); /** * [tJoin_3 end ] stop */ /** * [tJavaRow_3 end ] start */ currentComponent = "tJavaRow_3"; globalMap.put("tJavaRow_3_NB_LINE", nb_line_tJavaRow_3); ok_Hash.put("tJavaRow_3", true); end_Hash.put("tJavaRow_3", System.currentTimeMillis()); /** * [tJavaRow_3 end ] stop */ /** * [tMap_8 end ] start */ currentComponent = "tMap_8"; // ############################### // # Lookup hashes releasing // ############################### ok_Hash.put("tMap_8", true); end_Hash.put("tMap_8", System.currentTimeMillis()); /** * [tMap_8 end ] stop */ /** * [tMysqlOutput_1 end ] start */ currentComponent = "tMysqlOutput_1"; try { if (pstmt_tMysqlOutput_1 != null) { int countSum_tMysqlOutput_1 = 0; for (int countEach_tMysqlOutput_1 : pstmt_tMysqlOutput_1.executeBatch()) { countSum_tMysqlOutput_1 += (countEach_tMysqlOutput_1 < 0 ? 0 : countEach_tMysqlOutput_1); } insertedCount_tMysqlOutput_1 += countSum_tMysqlOutput_1; } } catch (java.sql.BatchUpdateException e) { int countSum_tMysqlOutput_1 = 0; for (int countEach_tMysqlOutput_1 : e.getUpdateCounts()) { countSum_tMysqlOutput_1 += (countEach_tMysqlOutput_1 < 0 ? 0 : countEach_tMysqlOutput_1); } insertedCount_tMysqlOutput_1 += countSum_tMysqlOutput_1; System.out.println(e.getMessage()); } if (pstmt_tMysqlOutput_1 != null) { pstmt_tMysqlOutput_1.close(); } conn_tMysqlOutput_1.commit(); conn_tMysqlOutput_1.close(); nb_line_deleted_tMysqlOutput_1 = nb_line_deleted_tMysqlOutput_1 + deletedCount_tMysqlOutput_1; nb_line_update_tMysqlOutput_1 = nb_line_update_tMysqlOutput_1 + updatedCount_tMysqlOutput_1; nb_line_inserted_tMysqlOutput_1 = nb_line_inserted_tMysqlOutput_1 + insertedCount_tMysqlOutput_1; nb_line_rejected_tMysqlOutput_1 = nb_line_rejected_tMysqlOutput_1 + rejectedCount_tMysqlOutput_1; globalMap.put("tMysqlOutput_1_NB_LINE", nb_line_tMysqlOutput_1); globalMap.put("tMysqlOutput_1_NB_LINE_UPDATED", nb_line_update_tMysqlOutput_1); globalMap.put("tMysqlOutput_1_NB_LINE_INSERTED", nb_line_inserted_tMysqlOutput_1); globalMap.put("tMysqlOutput_1_NB_LINE_DELETED", nb_line_deleted_tMysqlOutput_1); globalMap.put("tMysqlOutput_1_NB_LINE_REJECTED", nb_line_rejected_tMysqlOutput_1); ok_Hash.put("tMysqlOutput_1", true); end_Hash.put("tMysqlOutput_1", System.currentTimeMillis()); /** * [tMysqlOutput_1 end ] stop */ /** * [tFlowToIterate_1 end ] start */ currentComponent = "tFlowToIterate_1"; globalMap.put("tFlowToIterate_1_NB_LINE", nb_line_tFlowToIterate_1); ok_Hash.put("tFlowToIterate_1", true); end_Hash.put("tFlowToIterate_1", System.currentTimeMillis()); /** * [tFlowToIterate_1 end ] stop */ } // end the resume if (resumeEntryMethodName == null || globalResumeTicket) { resumeUtil.addLog("CHECKPOINT", "CONNECTION:SUBJOB_OK:tFileInputXML_1:OnSubjobOk", "", Thread.currentThread().getId() + "", "", "", "", "", ""); } tJava_1Process(globalMap); } catch (Exception e) { throw new TalendException(e, currentComponent, globalMap); } catch (java.lang.Error error) { throw new java.lang.Error(error); } finally { // free memory for "tJoin_4" globalMap.put("tHash_row6", null); // free memory for "tMap_12" globalMap.put("tHash_Lookup_row12", null); // free memory for "tJoin_6" globalMap.put("tHash_row11", null); // free memory for "tMap_3" globalMap.put("tHash_Lookup_row15", null); // free memory for "tJoin_5" globalMap.put("tHash_row4", null); // free memory for "tJoin_3" globalMap.put("tHash_getCurrentProperties", null); // free memory for "tMap_4" globalMap.put("tHash_Lookup_custData", null); } globalMap.put("tFileInputXML_1_SUBPROCESS_STATE", 1); }
From source file:talonetl.getproperties_1_3.getProperties.java
public void tFileInputXML_1Process(final java.util.Map<String, Object> globalMap) throws TalendException { globalMap.put("tFileInputXML_1_SUBPROCESS_STATE", 0); final boolean execStat = this.execStat; String iterateId = ""; int iterateLoop = 0; String currentComponent = ""; try {/*from w w w.j a v a 2 s. c o m*/ String currentMethodName = new Exception().getStackTrace()[0].getMethodName(); boolean resumeIt = currentMethodName.equals(resumeEntryMethodName); if (resumeEntryMethodName == null || resumeIt || globalResumeTicket) {// start // the // resume globalResumeTicket = true; tMysqlInput_5Process(globalMap); tMysqlInput_3Process(globalMap); tMysqlInput_10Process(globalMap); tMysqlInput_7Process(globalMap); tMysqlInput_8Process(globalMap); row1Struct row1 = new row1Struct(); zipCodeStruct zipCode = new zipCodeStruct(); row2Struct row2 = new row2Struct(); row3Struct row3 = new row3Struct(); zipRowDataStruct zipRowData = new zipRowDataStruct(); out1Struct out1 = new out1Struct(); row10Struct row10 = new row10Struct(); loadZipStruct loadZip = new loadZipStruct(); stateInfoStruct stateInfo = new stateInfoStruct(); row13Struct row13 = new row13Struct(); loadStateStruct loadState = new loadStateStruct(); stateCityStruct stateCity = new stateCityStruct(); row5Struct row5 = new row5Struct(); loadCityDataStruct loadCityData = new loadCityDataStruct(); propertyDataStruct propertyData = new propertyDataStruct(); loadDataStruct loadData = new loadDataStruct(); row9Struct row9 = new row9Struct(); row14Struct row14 = new row14Struct(); loadPropertyDataStruct loadPropertyData = new loadPropertyDataStruct(); /** * [tFlowToIterate_1 begin ] start */ int NB_ITERATE_tFileInputJSON_1 = 0; // for statistics ok_Hash.put("tFlowToIterate_1", false); start_Hash.put("tFlowToIterate_1", System.currentTimeMillis()); currentComponent = "tFlowToIterate_1"; int tos_count_tFlowToIterate_1 = 0; int nb_line_tFlowToIterate_1 = 0; int counter_tFlowToIterate_1 = 0; /** * [tFlowToIterate_1 begin ] stop */ /** * [tMysqlOutput_1 begin ] start */ ok_Hash.put("tMysqlOutput_1", false); start_Hash.put("tMysqlOutput_1", System.currentTimeMillis()); currentComponent = "tMysqlOutput_1"; int tos_count_tMysqlOutput_1 = 0; int nb_line_tMysqlOutput_1 = 0; int nb_line_update_tMysqlOutput_1 = 0; int nb_line_inserted_tMysqlOutput_1 = 0; int nb_line_deleted_tMysqlOutput_1 = 0; int nb_line_rejected_tMysqlOutput_1 = 0; int deletedCount_tMysqlOutput_1 = 0; int updatedCount_tMysqlOutput_1 = 0; int insertedCount_tMysqlOutput_1 = 0; int rejectedCount_tMysqlOutput_1 = 0; String tableName_tMysqlOutput_1 = "PROPERTY_DATA"; boolean whetherReject_tMysqlOutput_1 = false; java.util.Calendar calendar_tMysqlOutput_1 = java.util.Calendar.getInstance(); calendar_tMysqlOutput_1.set(1, 0, 1, 0, 0, 0); long year1_tMysqlOutput_1 = calendar_tMysqlOutput_1.getTime().getTime(); calendar_tMysqlOutput_1.set(10000, 0, 1, 0, 0, 0); long year10000_tMysqlOutput_1 = calendar_tMysqlOutput_1.getTime().getTime(); long date_tMysqlOutput_1; java.sql.Connection conn_tMysqlOutput_1 = null; java.util.Map<String, routines.system.TalendDataSource> dataSources_tMysqlOutput_1 = (java.util.Map<String, routines.system.TalendDataSource>) globalMap .get(KEY_DB_DATASOURCES); if (null != dataSources_tMysqlOutput_1) { conn_tMysqlOutput_1 = dataSources_tMysqlOutput_1.get("").getConnection(); } else { String dbProperties_tMysqlOutput_1 = context.talon_AdditionalParams; String url_tMysqlOutput_1 = null; if (dbProperties_tMysqlOutput_1 == null || dbProperties_tMysqlOutput_1.trim().length() == 0) { url_tMysqlOutput_1 = "jdbc:mysql://" + context.talon_Server + ":" + context.talon_Port + "/" + context.talon_Database + "?" + "rewriteBatchedStatements=true"; } else { String properties_tMysqlOutput_1 = context.talon_AdditionalParams; if (!properties_tMysqlOutput_1.contains("rewriteBatchedStatements")) { properties_tMysqlOutput_1 += "&rewriteBatchedStatements=true"; } url_tMysqlOutput_1 = "jdbc:mysql://" + context.talon_Server + ":" + context.talon_Port + "/" + context.talon_Database + "?" + properties_tMysqlOutput_1; } String dbUser_tMysqlOutput_1 = context.talon_Login; String dbPwd_tMysqlOutput_1 = context.talon_Password; java.lang.Class.forName("org.gjt.mm.mysql.Driver"); conn_tMysqlOutput_1 = java.sql.DriverManager.getConnection(url_tMysqlOutput_1, dbUser_tMysqlOutput_1, dbPwd_tMysqlOutput_1); } conn_tMysqlOutput_1.setAutoCommit(false); int commitEvery_tMysqlOutput_1 = 1; int commitCounter_tMysqlOutput_1 = 0; int count_tMysqlOutput_1 = 0; String insert_tMysqlOutput_1 = "INSERT INTO `" + "PROPERTY_DATA" + "` (`ID`,`UUID`,`PROP_NAME`,`PRICE`,`SQFT`,`DESCRIPTION`,`NUM_BEDS`,`NUM_BATHS`,`TYPE`,`STATUS`,`DATA_SOURCE_ID`,`ZIP_CODE`) VALUES (?,?,?,?,?,?,?,?,?,?,?,?)"; java.sql.PreparedStatement pstmt_tMysqlOutput_1 = conn_tMysqlOutput_1 .prepareStatement(insert_tMysqlOutput_1); /** * [tMysqlOutput_1 begin ] stop */ /** * [tMap_8 begin ] start */ ok_Hash.put("tMap_8", false); start_Hash.put("tMap_8", System.currentTimeMillis()); currentComponent = "tMap_8"; int tos_count_tMap_8 = 0; // ############################### // # Lookup's keys initialization // ############################### // ############################### // # Vars initialization class Var__tMap_8__Struct { } Var__tMap_8__Struct Var__tMap_8 = new Var__tMap_8__Struct(); // ############################### // ############################### // # Outputs initialization loadPropertyDataStruct loadPropertyData_tmp = new loadPropertyDataStruct(); // ############################### /** * [tMap_8 begin ] stop */ /** * [tJavaRow_3 begin ] start */ ok_Hash.put("tJavaRow_3", false); start_Hash.put("tJavaRow_3", System.currentTimeMillis()); currentComponent = "tJavaRow_3"; int tos_count_tJavaRow_3 = 0; int nb_line_tJavaRow_3 = 0; /** * [tJavaRow_3 begin ] stop */ /** * [tJoin_3 begin ] start */ ok_Hash.put("tJoin_3", false); start_Hash.put("tJoin_3", System.currentTimeMillis()); currentComponent = "tJoin_3"; int tos_count_tJoin_3 = 0; final java.util.Map<getCurrentPropertiesStruct, getCurrentPropertiesStruct> tHash_tJoin_3 = (java.util.Map<getCurrentPropertiesStruct, getCurrentPropertiesStruct>) globalMap .get("tHash_getCurrentProperties"); class Util_tJoin_3 { getCurrentPropertiesStruct lookupValue = null; getCurrentPropertiesStruct getCurrentPropertiesHashKey = new getCurrentPropertiesStruct(); public boolean isJoined(loadDataStruct mainRow) { getCurrentPropertiesHashKey.PROP_NAME = mainRow.PROP_NAME; getCurrentPropertiesHashKey.hashCodeDirty = true; lookupValue = tHash_tJoin_3.get(getCurrentPropertiesHashKey); if (lookupValue != null) { return true; } return false; } } Util_tJoin_3 util_tJoin_3 = new Util_tJoin_3(); int nb_line_tJoin_3 = 0; /** * [tJoin_3 begin ] stop */ /** * [tMap_4 begin ] start */ ok_Hash.put("tMap_4", false); start_Hash.put("tMap_4", System.currentTimeMillis()); currentComponent = "tMap_4"; int tos_count_tMap_4 = 0; // ############################### // # Lookup's keys initialization org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<custDataStruct> tHash_Lookup_custData = (org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<custDataStruct>) ((org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<custDataStruct>) globalMap .get("tHash_Lookup_custData")); custDataStruct custDataHashKey = new custDataStruct(); custDataStruct custDataDefault = new custDataStruct(); // ############################### // ############################### // # Vars initialization class Var__tMap_4__Struct { } Var__tMap_4__Struct Var__tMap_4 = new Var__tMap_4__Struct(); // ############################### // ############################### // # Outputs initialization loadDataStruct loadData_tmp = new loadDataStruct(); // ############################### /** * [tMap_4 begin ] stop */ /** * [tMap_2 begin ] start */ ok_Hash.put("tMap_2", false); start_Hash.put("tMap_2", System.currentTimeMillis()); currentComponent = "tMap_2"; int tos_count_tMap_2 = 0; // ############################### // # Lookup's keys initialization // ############################### // ############################### // # Vars initialization class Var__tMap_2__Struct { } Var__tMap_2__Struct Var__tMap_2 = new Var__tMap_2__Struct(); // ############################### // ############################### // # Outputs initialization zipCodeStruct zipCode_tmp = new zipCodeStruct(); propertyDataStruct propertyData_tmp = new propertyDataStruct(); // ############################### /** * [tMap_2 begin ] stop */ /** * [tFileInputXML_1 begin ] start */ ok_Hash.put("tFileInputXML_1", false); start_Hash.put("tFileInputXML_1", System.currentTimeMillis()); currentComponent = "tFileInputXML_1"; int tos_count_tFileInputXML_1 = 0; int nb_line_tFileInputXML_1 = 0; String os_tFileInputXML_1 = System.getProperty("os.name").toLowerCase(); boolean isWindows_tFileInputXML_1 = false; if (os_tFileInputXML_1.indexOf("windows") > -1 || os_tFileInputXML_1.indexOf("nt") > -1) { isWindows_tFileInputXML_1 = true; } class XML_API_tFileInputXML_1 { public boolean isDefNull(String[] node) throws javax.xml.transform.TransformerException { if (node[0] != null && node[1] != null && ("true").equals(node[1])) { return true; } return false; } public boolean isMissing(String[] node) throws javax.xml.transform.TransformerException { return node[0] == null ? true : false; } public boolean isEmpty(String[] node) throws javax.xml.transform.TransformerException { if (node[0] != null) { return node[0].length() == 0; } return false; } } XML_API_tFileInputXML_1 xml_api_tFileInputXML_1 = new XML_API_tFileInputXML_1(); String[] queryPaths_tFileInputXML_1 = new String[] { "name", "name" + "/@xsi:nil", "../media/images/image/url", "../media/images/image/url" + "/@xsi:nil", "../media/images/image/title", "../media/images/image/title" + "/@xsi:nil", "pba__propertytype__c", "pba__propertytype__c" + "/@xsi:nil", "rented_status__c", "rented_status__c" + "/@xsi:nil", "zipcode__c", "zipcode__c" + "/@xsi:nil", "pba__city_pb__c", "pba__city_pb__c" + "/@xsi:nil", "pba__description_pb__c", "pba__description_pb__c" + "/@xsi:nil", "term_2__c", "term_2__c" + "/@xsi:nil", "term_1__c", "term_1__c" + "/@xsi:nil", "pba__status__c", "pba__status__c" + "/@xsi:nil", "year_built__c", "year_built__c" + "/@xsi:nil", "pba__address_pb__c", "pba__address_pb__c" + "/@xsi:nil", "financed_net_yield_1__c", "financed_net_yield_1__c" + "/@xsi:nil", "monthly_cash_flow_with_financing_2__c", "monthly_cash_flow_with_financing_2__c" + "/@xsi:nil", "financed_net_yield_2__c", "financed_net_yield_2__c" + "/@xsi:nil", "monthly_cash_flow_with_financing_1__c", "monthly_cash_flow_with_financing_1__c" + "/@xsi:nil", "interest_rate_2__c", "interest_rate_2__c" + "/@xsi:nil", "interest_rate_1__c", "interest_rate_1__c" + "/@xsi:nil", "monthly_cash_flow__c", "monthly_cash_flow__c" + "/@xsi:nil", "noi__c", "noi__c" + "/@xsi:nil", "noi_with_financing_2__c", "noi_with_financing_2__c" + "/@xsi:nil", "noi_with_financing_1__c", "noi_with_financing_1__c" + "/@xsi:nil", "price_per_ft__c", "price_per_ft__c" + "/@xsi:nil", "price__c", "price__c" + "/@xsi:nil", "yearly_interest_payment_1__c", "yearly_interest_payment_1__c" + "/@xsi:nil", "monthly_interest_payment_2__c", "monthly_interest_payment_2__c" + "/@xsi:nil", "interest_payment_1__c", "interest_payment_1__c" + "/@xsi:nil", "down_payment_2__c", "down_payment_2__c" + "/@xsi:nil", "down_payment_1__c", "down_payment_1__c" + "/@xsi:nil", "cash_net_yield__c", "cash_net_yield__c" + "/@xsi:nil", "monthly_management__c", "monthly_management__c" + "/@xsi:nil", "management__c", "management__c" + "/@xsi:nil", "monthly_insurance__c", "monthly_insurance__c" + "/@xsi:nil", "insurance__c", "insurance__c" + "/@xsi:nil", "taxes__c", "taxes__c" + "/@xsi:nil", "monthly_taxes__c", "monthly_taxes__c" + "/@xsi:nil", "monthlyrent__c", "monthlyrent__c" + "/@xsi:nil", "annual_rents__c", "annual_rents__c" + "/@xsi:nil", "est_of_market_value__c", "est_of_market_value__c" + "/@xsi:nil", "est_value_per_rent_multiplier__c", "est_value_per_rent_multiplier__c" + "/@xsi:nil", "estimated_value__c", "estimated_value__c" + "/@xsi:nil", "est_replacement_cost_per_sq_ft__c", "est_replacement_cost_per_sq_ft__c" + "/@xsi:nil", "est_replacement_cost__c", "est_replacement_cost__c" + "/@xsi:nil", "pba__totalarea_pb__c", "pba__totalarea_pb__c" + "/@xsi:nil", "bedrooms__c", "bedrooms__c" + "/@xsi:nil", "bathrooms__c", "bathrooms__c" + "/@xsi:nil" }; boolean[] asXMLs_tFileInputXML_1 = new boolean[] { false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false }; String str_tFileInputXML_1 = ""; String[] node_tFileInputXML_1 = null; org.talend.xml.sax.SAXLooper looper_tFileInputXML_1 = new org.talend.xml.sax.SAXLooper( "/result/listings/listing/data", queryPaths_tFileInputXML_1, asXMLs_tFileInputXML_1); looper_tFileInputXML_1.setEncoding("UTF-8"); Object filename_tFileInputXML_1 = null; try { filename_tFileInputXML_1 = ((java.io.InputStream) globalMap.get("tFileFetch_1_INPUT_STREAM")); } catch (Exception e) { System.err.println(e.getMessage()); } if (filename_tFileInputXML_1 != null && filename_tFileInputXML_1 instanceof String && filename_tFileInputXML_1.toString().startsWith("//")) { if (!isWindows_tFileInputXML_1) { filename_tFileInputXML_1 = filename_tFileInputXML_1.toString().replaceFirst("//", "/"); } } if (filename_tFileInputXML_1 instanceof java.io.InputStream) { looper_tFileInputXML_1.parse((java.io.InputStream) filename_tFileInputXML_1); } else { looper_tFileInputXML_1.parse(String.valueOf(filename_tFileInputXML_1)); } java.util.Iterator<java.util.Map<String, String>> it_tFileInputXML_1 = looper_tFileInputXML_1 .iterator(); while (it_tFileInputXML_1.hasNext()) { java.util.Map<String, String> row_tFileInputXML_1 = it_tFileInputXML_1.next(); nb_line_tFileInputXML_1++; row1 = null; boolean whetherReject_tFileInputXML_1 = false; row1 = new row1Struct(); try { str_tFileInputXML_1 = row_tFileInputXML_1.get("name"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("name" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.name = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1)) { row1.name = ""; } else if (xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.name = null; } else { row1.name = str_tFileInputXML_1; } str_tFileInputXML_1 = row_tFileInputXML_1.get("../media/images/image/url"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("../media/images/image/url" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.image_url = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1)) { row1.image_url = ""; } else if (xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.image_url = null; } else { row1.image_url = str_tFileInputXML_1; } str_tFileInputXML_1 = row_tFileInputXML_1.get("../media/images/image/title"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("../media/images/image/title" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.image_title = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1)) { row1.image_title = ""; } else if (xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.image_title = null; } else { row1.image_title = str_tFileInputXML_1; } str_tFileInputXML_1 = row_tFileInputXML_1.get("pba__propertytype__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("pba__propertytype__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.pba__propertytype__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1)) { row1.pba__propertytype__c = ""; } else if (xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.pba__propertytype__c = null; } else { row1.pba__propertytype__c = str_tFileInputXML_1; } str_tFileInputXML_1 = row_tFileInputXML_1.get("rented_status__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("rented_status__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.rented_status__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1)) { row1.rented_status__c = ""; } else if (xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.rented_status__c = null; } else { row1.rented_status__c = str_tFileInputXML_1; } str_tFileInputXML_1 = row_tFileInputXML_1.get("zipcode__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("zipcode__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.zipcode__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.zipcode__c = null; } else { row1.zipcode__c = ParserUtils.parseTo_Integer(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("pba__city_pb__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("pba__city_pb__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.pba__city_pb__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1)) { row1.pba__city_pb__c = ""; } else if (xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.pba__city_pb__c = null; } else { row1.pba__city_pb__c = str_tFileInputXML_1; } str_tFileInputXML_1 = row_tFileInputXML_1.get("pba__description_pb__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("pba__description_pb__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.pba__description_pb__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1)) { row1.pba__description_pb__c = ""; } else if (xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.pba__description_pb__c = null; } else { row1.pba__description_pb__c = str_tFileInputXML_1; } str_tFileInputXML_1 = row_tFileInputXML_1.get("term_2__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("term_2__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.term_2__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1)) { row1.term_2__c = ""; } else if (xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.term_2__c = null; } else { row1.term_2__c = str_tFileInputXML_1; } str_tFileInputXML_1 = row_tFileInputXML_1.get("term_1__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("term_1__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.term_1__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1)) { row1.term_1__c = ""; } else if (xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.term_1__c = null; } else { row1.term_1__c = str_tFileInputXML_1; } str_tFileInputXML_1 = row_tFileInputXML_1.get("pba__status__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("pba__status__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.pba__status__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1)) { row1.pba__status__c = ""; } else if (xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.pba__status__c = null; } else { row1.pba__status__c = str_tFileInputXML_1; } str_tFileInputXML_1 = row_tFileInputXML_1.get("year_built__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("year_built__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.year_built__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.year_built__c = null; } else { row1.year_built__c = ParserUtils.parseTo_Integer(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("pba__address_pb__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("pba__address_pb__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.pba__address_pb__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1)) { row1.pba__address_pb__c = ""; } else if (xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.pba__address_pb__c = null; } else { row1.pba__address_pb__c = str_tFileInputXML_1; } str_tFileInputXML_1 = row_tFileInputXML_1.get("financed_net_yield_1__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("financed_net_yield_1__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.financed_net_yield_1__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.financed_net_yield_1__c = null; } else { row1.financed_net_yield_1__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("monthly_cash_flow_with_financing_2__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("monthly_cash_flow_with_financing_2__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.monthly_cash_flow_with_financing_2__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.monthly_cash_flow_with_financing_2__c = null; } else { row1.monthly_cash_flow_with_financing_2__c = ParserUtils .parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("financed_net_yield_2__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("financed_net_yield_2__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.financed_net_yield_2__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.financed_net_yield_2__c = null; } else { row1.financed_net_yield_2__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("monthly_cash_flow_with_financing_1__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("monthly_cash_flow_with_financing_1__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.monthly_cash_flow_with_financing_1__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.monthly_cash_flow_with_financing_1__c = null; } else { row1.monthly_cash_flow_with_financing_1__c = ParserUtils .parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("interest_rate_2__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("interest_rate_2__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.interest_rate_2__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.interest_rate_2__c = null; } else { row1.interest_rate_2__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("interest_rate_1__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("interest_rate_1__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.interest_rate_1__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.interest_rate_1__c = null; } else { row1.interest_rate_1__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("monthly_cash_flow__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("monthly_cash_flow__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.monthly_cash_flow__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.monthly_cash_flow__c = null; } else { row1.monthly_cash_flow__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("noi__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("noi__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.noi__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.noi__c = null; } else { row1.noi__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("noi_with_financing_2__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("noi_with_financing_2__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.noi_with_financing_2__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.noi_with_financing_2__c = null; } else { row1.noi_with_financing_2__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("noi_with_financing_1__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("noi_with_financing_1__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.noi_with_financing_1__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.noi_with_financing_1__c = null; } else { row1.noi_with_financing_1__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("price_per_ft__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("price_per_ft__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.price_per_ft__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.price_per_ft__c = null; } else { row1.price_per_ft__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("price__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("price__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.price__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.price__c = null; } else { row1.price__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("yearly_interest_payment_1__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("yearly_interest_payment_1__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.yearly_interest_payment_1__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.yearly_interest_payment_1__c = null; } else { row1.yearly_interest_payment_1__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("monthly_interest_payment_2__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("monthly_interest_payment_2__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.monthly_interest_payment_2__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.monthly_interest_payment_2__c = null; } else { row1.monthly_interest_payment_2__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("interest_payment_1__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("interest_payment_1__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.interest_payment_1__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.interest_payment_1__c = null; } else { row1.interest_payment_1__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("down_payment_2__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("down_payment_2__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.down_payment_2__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.down_payment_2__c = null; } else { row1.down_payment_2__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("down_payment_1__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("down_payment_1__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.down_payment_1__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.down_payment_1__c = null; } else { row1.down_payment_1__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("cash_net_yield__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("cash_net_yield__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.cash_net_yield__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.cash_net_yield__c = null; } else { row1.cash_net_yield__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("monthly_management__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("monthly_management__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.monthly_management__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.monthly_management__c = null; } else { row1.monthly_management__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("management__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("management__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.management__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.management__c = null; } else { row1.management__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("monthly_insurance__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("monthly_insurance__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.monthly_insurance__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.monthly_insurance__c = null; } else { row1.monthly_insurance__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("insurance__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("insurance__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.insurance__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.insurance__c = null; } else { row1.insurance__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("taxes__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("taxes__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.taxes__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.taxes__c = null; } else { row1.taxes__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("monthly_taxes__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("monthly_taxes__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.monthly_taxes__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.monthly_taxes__c = null; } else { row1.monthly_taxes__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("monthlyrent__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("monthlyrent__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.monthlyrent__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.monthlyrent__c = null; } else { row1.monthlyrent__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("annual_rents__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("annual_rents__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.annual_rents__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.annual_rents__c = null; } else { row1.annual_rents__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("est_of_market_value__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("est_of_market_value__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.est_of_market_value__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.est_of_market_value__c = null; } else { row1.est_of_market_value__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("est_value_per_rent_multiplier__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("est_value_per_rent_multiplier__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.est_value_per_rent_multiplier__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.est_value_per_rent_multiplier__c = null; } else { row1.est_value_per_rent_multiplier__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("estimated_value__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("estimated_value__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.estimated_value__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1)) { row1.estimated_value__c = ""; } else if (xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.estimated_value__c = null; } else { row1.estimated_value__c = str_tFileInputXML_1; } str_tFileInputXML_1 = row_tFileInputXML_1.get("est_replacement_cost_per_sq_ft__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("est_replacement_cost_per_sq_ft__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.est_replacement_cost_per_sq_ft__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.est_replacement_cost_per_sq_ft__c = null; } else { row1.est_replacement_cost_per_sq_ft__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("est_replacement_cost__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("est_replacement_cost__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.est_replacement_cost__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.est_replacement_cost__c = null; } else { row1.est_replacement_cost__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("pba__totalarea_pb__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("pba__totalarea_pb__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.pba__totalarea_pb__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.pba__totalarea_pb__c = null; } else { row1.pba__totalarea_pb__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("bedrooms__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("bedrooms__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.bedrooms__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.bedrooms__c = null; } else { row1.bedrooms__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } str_tFileInputXML_1 = row_tFileInputXML_1.get("bathrooms__c"); node_tFileInputXML_1 = new String[] { str_tFileInputXML_1, row_tFileInputXML_1.get("bathrooms__c" + "/@xsi:nil") }; if (xml_api_tFileInputXML_1.isDefNull(node_tFileInputXML_1)) { row1.bathrooms__c = null; } else if (xml_api_tFileInputXML_1.isEmpty(node_tFileInputXML_1) || xml_api_tFileInputXML_1.isMissing(node_tFileInputXML_1)) { row1.bathrooms__c = null; } else { row1.bathrooms__c = ParserUtils.parseTo_Float(str_tFileInputXML_1); } } catch (Exception e) { whetherReject_tFileInputXML_1 = true; System.err.println(e.getMessage()); row1 = null; } /** * [tFileInputXML_1 begin ] stop */ /** * [tFileInputXML_1 main ] start */ currentComponent = "tFileInputXML_1"; tos_count_tFileInputXML_1++; /** * [tFileInputXML_1 main ] stop */ // Start of branch "row1" if (row1 != null) { /** * [tMap_2 main ] start */ currentComponent = "tMap_2"; boolean hasCasePrimitiveKeyWithNull_tMap_2 = false; // ############################### // # Input tables (lookups) boolean rejectedInnerJoin_tMap_2 = false; boolean mainRowRejected_tMap_2 = false; // ############################### { // start of Var scope // ############################### // # Vars tables Var__tMap_2__Struct Var = Var__tMap_2;// ############################### // ############################### // # Output tables zipCode = null; propertyData = null; // # Output table : 'zipCode' zipCode_tmp.zipcode__c = row1.zipcode__c; zipCode = zipCode_tmp; // # Output table : 'propertyData' propertyData_tmp.name = row1.name; propertyData_tmp.image_url = row1.image_url; propertyData_tmp.image_title = row1.image_title; propertyData_tmp.pba__propertytype__c = row1.pba__propertytype__c; propertyData_tmp.rented_status__c = row1.rented_status__c; propertyData_tmp.zipcode__c = row1.zipcode__c; propertyData_tmp.pba__city_pb__c = row1.pba__city_pb__c; propertyData_tmp.pba__description_pb__c = row1.pba__description_pb__c; propertyData_tmp.term_2__c = row1.term_2__c; propertyData_tmp.term_1__c = row1.term_1__c; propertyData_tmp.pba__status__c = row1.pba__status__c; propertyData_tmp.year_built__c = row1.year_built__c; propertyData_tmp.pba__address_pb__c = row1.pba__address_pb__c; propertyData_tmp.financed_net_yield_1__c = row1.financed_net_yield_1__c; propertyData_tmp.monthly_cash_flow_with_financing_2__c = row1.monthly_cash_flow_with_financing_2__c; propertyData_tmp.financed_net_yield_2__c = row1.financed_net_yield_2__c; propertyData_tmp.monthly_cash_flow_with_financing_1__c = row1.monthly_cash_flow_with_financing_1__c; propertyData_tmp.interest_rate_2__c = row1.interest_rate_2__c; propertyData_tmp.interest_rate_1__c = row1.interest_rate_1__c; propertyData_tmp.monthly_cash_flow__c = row1.monthly_cash_flow__c; propertyData_tmp.noi__c = row1.noi__c; propertyData_tmp.noi_with_financing_2__c = row1.noi_with_financing_2__c; propertyData_tmp.noi_with_financing_1__c = row1.noi_with_financing_1__c; propertyData_tmp.price_per_ft__c = row1.price_per_ft__c; propertyData_tmp.price__c = row1.price__c; propertyData_tmp.yearly_interest_payment_1__c = row1.yearly_interest_payment_1__c; propertyData_tmp.monthly_interest_payment_2__c = row1.monthly_interest_payment_2__c; propertyData_tmp.interest_payment_1__c = row1.interest_payment_1__c; propertyData_tmp.down_payment_2__c = row1.down_payment_2__c; propertyData_tmp.down_payment_1__c = row1.down_payment_1__c; propertyData_tmp.cash_net_yield__c = row1.cash_net_yield__c; propertyData_tmp.monthly_management__c = row1.monthly_management__c; propertyData_tmp.management__c = row1.management__c; propertyData_tmp.monthly_insurance__c = row1.monthly_insurance__c; propertyData_tmp.insurance__c = row1.insurance__c; propertyData_tmp.taxes__c = row1.taxes__c; propertyData_tmp.monthly_taxes__c = row1.monthly_taxes__c; propertyData_tmp.monthlyrent__c = row1.monthlyrent__c; propertyData_tmp.annual_rents__c = row1.annual_rents__c; propertyData_tmp.est_of_market_value__c = row1.est_of_market_value__c; propertyData_tmp.est_value_per_rent_multiplier__c = row1.est_value_per_rent_multiplier__c; propertyData_tmp.estimated_value__c = row1.estimated_value__c; propertyData_tmp.est_replacement_cost_per_sq_ft__c = row1.est_replacement_cost_per_sq_ft__c; propertyData_tmp.est_replacement_cost__c = row1.est_replacement_cost__c; propertyData_tmp.pba__totalarea_pb__c = row1.pba__totalarea_pb__c; propertyData_tmp.bedrooms__c = row1.bedrooms__c; propertyData_tmp.bathrooms__c = row1.bathrooms__c; propertyData_tmp.customerUUId = context.customerUUid; propertyData = propertyData_tmp; // ############################### } // end of Var scope rejectedInnerJoin_tMap_2 = false; tos_count_tMap_2++; /** * [tMap_2 main ] stop */ // Start of branch "zipCode" if (zipCode != null) { /** * [tFlowToIterate_1 main ] start */ currentComponent = "tFlowToIterate_1"; globalMap.put("zipCode", zipCode.zipcode__c); nb_line_tFlowToIterate_1++; counter_tFlowToIterate_1++; globalMap.put("tFlowToIterate_1_CURRENT_ITERATION", counter_tFlowToIterate_1); tos_count_tFlowToIterate_1++; /** * [tFlowToIterate_1 main ] stop */ NB_ITERATE_tFileInputJSON_1++; iterateLoop++; /** * [tMysqlOutput_5 begin ] start */ ok_Hash.put("tMysqlOutput_5", false); start_Hash.put("tMysqlOutput_5", System.currentTimeMillis()); currentComponent = "tMysqlOutput_5"; int tos_count_tMysqlOutput_5 = 0; int nb_line_tMysqlOutput_5 = 0; int nb_line_update_tMysqlOutput_5 = 0; int nb_line_inserted_tMysqlOutput_5 = 0; int nb_line_deleted_tMysqlOutput_5 = 0; int nb_line_rejected_tMysqlOutput_5 = 0; int deletedCount_tMysqlOutput_5 = 0; int updatedCount_tMysqlOutput_5 = 0; int insertedCount_tMysqlOutput_5 = 0; int rejectedCount_tMysqlOutput_5 = 0; String tableName_tMysqlOutput_5 = "ZIP_CODES"; boolean whetherReject_tMysqlOutput_5 = false; java.util.Calendar calendar_tMysqlOutput_5 = java.util.Calendar.getInstance(); calendar_tMysqlOutput_5.set(1, 0, 1, 0, 0, 0); long year1_tMysqlOutput_5 = calendar_tMysqlOutput_5.getTime().getTime(); calendar_tMysqlOutput_5.set(10000, 0, 1, 0, 0, 0); long year10000_tMysqlOutput_5 = calendar_tMysqlOutput_5.getTime().getTime(); long date_tMysqlOutput_5; java.sql.Connection conn_tMysqlOutput_5 = null; java.util.Map<String, routines.system.TalendDataSource> dataSources_tMysqlOutput_5 = (java.util.Map<String, routines.system.TalendDataSource>) globalMap .get(KEY_DB_DATASOURCES); if (null != dataSources_tMysqlOutput_5) { conn_tMysqlOutput_5 = dataSources_tMysqlOutput_5.get("").getConnection(); } else { String dbProperties_tMysqlOutput_5 = context.talon_AdditionalParams; String url_tMysqlOutput_5 = null; if (dbProperties_tMysqlOutput_5 == null || dbProperties_tMysqlOutput_5.trim().length() == 0) { url_tMysqlOutput_5 = "jdbc:mysql://" + context.talon_Server + ":" + context.talon_Port + "/" + context.talon_Database + "?" + "rewriteBatchedStatements=true"; } else { String properties_tMysqlOutput_5 = context.talon_AdditionalParams; if (!properties_tMysqlOutput_5.contains("rewriteBatchedStatements")) { properties_tMysqlOutput_5 += "&rewriteBatchedStatements=true"; } url_tMysqlOutput_5 = "jdbc:mysql://" + context.talon_Server + ":" + context.talon_Port + "/" + context.talon_Database + "?" + properties_tMysqlOutput_5; } String dbUser_tMysqlOutput_5 = context.talon_Login; String dbPwd_tMysqlOutput_5 = context.talon_Password; java.lang.Class.forName("org.gjt.mm.mysql.Driver"); conn_tMysqlOutput_5 = java.sql.DriverManager.getConnection(url_tMysqlOutput_5, dbUser_tMysqlOutput_5, dbPwd_tMysqlOutput_5); } conn_tMysqlOutput_5.setAutoCommit(false); int commitEvery_tMysqlOutput_5 = 10000; int commitCounter_tMysqlOutput_5 = 0; int count_tMysqlOutput_5 = 0; String insert_tMysqlOutput_5 = "INSERT INTO `" + "ZIP_CODES" + "` (`ZIP_CODE`,`CITY_ID`) VALUES (?,?)"; int batchSize_tMysqlOutput_5 = 100; int batchSizeCounter_tMysqlOutput_5 = 0; java.sql.PreparedStatement pstmt_tMysqlOutput_5 = conn_tMysqlOutput_5 .prepareStatement(insert_tMysqlOutput_5); /** * [tMysqlOutput_5 begin ] stop */ /** * [tMap_13 begin ] start */ ok_Hash.put("tMap_13", false); start_Hash.put("tMap_13", System.currentTimeMillis()); currentComponent = "tMap_13"; int tos_count_tMap_13 = 0; // ############################### // # Lookup's keys initialization // ############################### // ############################### // # Vars initialization class Var__tMap_13__Struct { } Var__tMap_13__Struct Var__tMap_13 = new Var__tMap_13__Struct(); // ############################### // ############################### // # Outputs initialization loadZipStruct loadZip_tmp = new loadZipStruct(); // ############################### /** * [tMap_13 begin ] stop */ /** * [tJoin_4 begin ] start */ ok_Hash.put("tJoin_4", false); start_Hash.put("tJoin_4", System.currentTimeMillis()); currentComponent = "tJoin_4"; int tos_count_tJoin_4 = 0; final java.util.Map<row6Struct, row6Struct> tHash_tJoin_4 = (java.util.Map<row6Struct, row6Struct>) globalMap .get("tHash_row6"); class Util_tJoin_4 { row6Struct lookupValue = null; row6Struct row6HashKey = new row6Struct(); public boolean isJoined(out1Struct mainRow) { row6HashKey.ZIP_CODE = mainRow.zip; row6HashKey.hashCodeDirty = true; lookupValue = tHash_tJoin_4.get(row6HashKey); if (lookupValue != null) { return true; } return false; } } Util_tJoin_4 util_tJoin_4 = new Util_tJoin_4(); int nb_line_tJoin_4 = 0; /** * [tJoin_4 begin ] stop */ /** * [tMap_12 begin ] start */ ok_Hash.put("tMap_12", false); start_Hash.put("tMap_12", System.currentTimeMillis()); currentComponent = "tMap_12"; int tos_count_tMap_12 = 0; // ############################### // # Lookup's keys initialization org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row12Struct> tHash_Lookup_row12 = null; org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row12Struct> tHash_Lookup_Cache_row12 = org.talend.designer.components.lookup.memory.AdvancedMemoryLookup .<row12Struct>getLookup( org.talend.designer.components.lookup.common.ICommonLookup.MATCHING_MODE.UNIQUE_MATCH); org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row12Struct> tHash_Lookup_Real_row12 = null; row12Struct row12HashKey = new row12Struct(); row12Struct row12Default = new row12Struct(); // ############################### // ############################### // # Vars initialization class Var__tMap_12__Struct { } Var__tMap_12__Struct Var__tMap_12 = new Var__tMap_12__Struct(); // ############################### // ############################### // # Outputs initialization out1Struct out1_tmp = new out1Struct(); // ############################### /** * [tMap_12 begin ] stop */ /** * [tMysqlOutput_7 begin ] start */ ok_Hash.put("tMysqlOutput_7", false); start_Hash.put("tMysqlOutput_7", System.currentTimeMillis()); currentComponent = "tMysqlOutput_7"; int tos_count_tMysqlOutput_7 = 0; int nb_line_tMysqlOutput_7 = 0; int nb_line_update_tMysqlOutput_7 = 0; int nb_line_inserted_tMysqlOutput_7 = 0; int nb_line_deleted_tMysqlOutput_7 = 0; int nb_line_rejected_tMysqlOutput_7 = 0; int deletedCount_tMysqlOutput_7 = 0; int updatedCount_tMysqlOutput_7 = 0; int insertedCount_tMysqlOutput_7 = 0; int rejectedCount_tMysqlOutput_7 = 0; String tableName_tMysqlOutput_7 = "STATE"; boolean whetherReject_tMysqlOutput_7 = false; java.util.Calendar calendar_tMysqlOutput_7 = java.util.Calendar.getInstance(); calendar_tMysqlOutput_7.set(1, 0, 1, 0, 0, 0); long year1_tMysqlOutput_7 = calendar_tMysqlOutput_7.getTime().getTime(); calendar_tMysqlOutput_7.set(10000, 0, 1, 0, 0, 0); long year10000_tMysqlOutput_7 = calendar_tMysqlOutput_7.getTime().getTime(); long date_tMysqlOutput_7; java.sql.Connection conn_tMysqlOutput_7 = null; java.util.Map<String, routines.system.TalendDataSource> dataSources_tMysqlOutput_7 = (java.util.Map<String, routines.system.TalendDataSource>) globalMap .get(KEY_DB_DATASOURCES); if (null != dataSources_tMysqlOutput_7) { conn_tMysqlOutput_7 = dataSources_tMysqlOutput_7.get("").getConnection(); } else { String dbProperties_tMysqlOutput_7 = context.talon_AdditionalParams; String url_tMysqlOutput_7 = null; if (dbProperties_tMysqlOutput_7 == null || dbProperties_tMysqlOutput_7.trim().length() == 0) { url_tMysqlOutput_7 = "jdbc:mysql://" + context.talon_Server + ":" + context.talon_Port + "/" + context.talon_Database + "?" + "rewriteBatchedStatements=true"; } else { String properties_tMysqlOutput_7 = context.talon_AdditionalParams; if (!properties_tMysqlOutput_7.contains("rewriteBatchedStatements")) { properties_tMysqlOutput_7 += "&rewriteBatchedStatements=true"; } url_tMysqlOutput_7 = "jdbc:mysql://" + context.talon_Server + ":" + context.talon_Port + "/" + context.talon_Database + "?" + properties_tMysqlOutput_7; } String dbUser_tMysqlOutput_7 = context.talon_Login; String dbPwd_tMysqlOutput_7 = context.talon_Password; java.lang.Class.forName("org.gjt.mm.mysql.Driver"); conn_tMysqlOutput_7 = java.sql.DriverManager.getConnection(url_tMysqlOutput_7, dbUser_tMysqlOutput_7, dbPwd_tMysqlOutput_7); } conn_tMysqlOutput_7.setAutoCommit(false); int commitEvery_tMysqlOutput_7 = 10000; int commitCounter_tMysqlOutput_7 = 0; int count_tMysqlOutput_7 = 0; String insert_tMysqlOutput_7 = "INSERT INTO `" + "STATE" + "` (`ID`,`STATE`,`FULL_NAME`) VALUES (?,?,?)"; int batchSize_tMysqlOutput_7 = 100; int batchSizeCounter_tMysqlOutput_7 = 0; java.sql.PreparedStatement pstmt_tMysqlOutput_7 = conn_tMysqlOutput_7 .prepareStatement(insert_tMysqlOutput_7); /** * [tMysqlOutput_7 begin ] stop */ /** * [tMap_9 begin ] start */ ok_Hash.put("tMap_9", false); start_Hash.put("tMap_9", System.currentTimeMillis()); currentComponent = "tMap_9"; int tos_count_tMap_9 = 0; // ############################### // # Lookup's keys initialization // ############################### // ############################### // # Vars initialization class Var__tMap_9__Struct { } Var__tMap_9__Struct Var__tMap_9 = new Var__tMap_9__Struct(); // ############################### // ############################### // # Outputs initialization loadStateStruct loadState_tmp = new loadStateStruct(); // ############################### /** * [tMap_9 begin ] stop */ /** * [tJoin_6 begin ] start */ ok_Hash.put("tJoin_6", false); start_Hash.put("tJoin_6", System.currentTimeMillis()); currentComponent = "tJoin_6"; int tos_count_tJoin_6 = 0; final java.util.Map<row11Struct, row11Struct> tHash_tJoin_6 = (java.util.Map<row11Struct, row11Struct>) globalMap .get("tHash_row11"); class Util_tJoin_6 { row11Struct lookupValue = null; row11Struct row11HashKey = new row11Struct(); public boolean isJoined(stateInfoStruct mainRow) { row11HashKey.STATE = mainRow.state; row11HashKey.hashCodeDirty = true; lookupValue = tHash_tJoin_6.get(row11HashKey); if (lookupValue != null) { return true; } return false; } } Util_tJoin_6 util_tJoin_6 = new Util_tJoin_6(); int nb_line_tJoin_6 = 0; /** * [tJoin_6 begin ] stop */ /** * [tMysqlOutput_3 begin ] start */ ok_Hash.put("tMysqlOutput_3", false); start_Hash.put("tMysqlOutput_3", System.currentTimeMillis()); currentComponent = "tMysqlOutput_3"; int tos_count_tMysqlOutput_3 = 0; int nb_line_tMysqlOutput_3 = 0; int nb_line_update_tMysqlOutput_3 = 0; int nb_line_inserted_tMysqlOutput_3 = 0; int nb_line_deleted_tMysqlOutput_3 = 0; int nb_line_rejected_tMysqlOutput_3 = 0; int deletedCount_tMysqlOutput_3 = 0; int updatedCount_tMysqlOutput_3 = 0; int insertedCount_tMysqlOutput_3 = 0; int rejectedCount_tMysqlOutput_3 = 0; String tableName_tMysqlOutput_3 = "CITY"; boolean whetherReject_tMysqlOutput_3 = false; java.util.Calendar calendar_tMysqlOutput_3 = java.util.Calendar.getInstance(); calendar_tMysqlOutput_3.set(1, 0, 1, 0, 0, 0); long year1_tMysqlOutput_3 = calendar_tMysqlOutput_3.getTime().getTime(); calendar_tMysqlOutput_3.set(10000, 0, 1, 0, 0, 0); long year10000_tMysqlOutput_3 = calendar_tMysqlOutput_3.getTime().getTime(); long date_tMysqlOutput_3; java.sql.Connection conn_tMysqlOutput_3 = null; java.util.Map<String, routines.system.TalendDataSource> dataSources_tMysqlOutput_3 = (java.util.Map<String, routines.system.TalendDataSource>) globalMap .get(KEY_DB_DATASOURCES); if (null != dataSources_tMysqlOutput_3) { conn_tMysqlOutput_3 = dataSources_tMysqlOutput_3.get("").getConnection(); } else { String dbProperties_tMysqlOutput_3 = context.talon_AdditionalParams; String url_tMysqlOutput_3 = null; if (dbProperties_tMysqlOutput_3 == null || dbProperties_tMysqlOutput_3.trim().length() == 0) { url_tMysqlOutput_3 = "jdbc:mysql://" + context.talon_Server + ":" + context.talon_Port + "/" + context.talon_Database + "?" + "rewriteBatchedStatements=true"; } else { String properties_tMysqlOutput_3 = context.talon_AdditionalParams; if (!properties_tMysqlOutput_3.contains("rewriteBatchedStatements")) { properties_tMysqlOutput_3 += "&rewriteBatchedStatements=true"; } url_tMysqlOutput_3 = "jdbc:mysql://" + context.talon_Server + ":" + context.talon_Port + "/" + context.talon_Database + "?" + properties_tMysqlOutput_3; } String dbUser_tMysqlOutput_3 = context.talon_Login; String dbPwd_tMysqlOutput_3 = context.talon_Password; java.lang.Class.forName("org.gjt.mm.mysql.Driver"); conn_tMysqlOutput_3 = java.sql.DriverManager.getConnection(url_tMysqlOutput_3, dbUser_tMysqlOutput_3, dbPwd_tMysqlOutput_3); } conn_tMysqlOutput_3.setAutoCommit(false); int commitEvery_tMysqlOutput_3 = 10000; int commitCounter_tMysqlOutput_3 = 0; int count_tMysqlOutput_3 = 0; String insert_tMysqlOutput_3 = "INSERT INTO `" + "CITY" + "` (`ID`,`CITY`,`SUMMARY`,`IMAGE_URL`,`STATE_ID`) VALUES (?,?,?,?,?)"; int batchSize_tMysqlOutput_3 = 100; int batchSizeCounter_tMysqlOutput_3 = 0; java.sql.PreparedStatement pstmt_tMysqlOutput_3 = conn_tMysqlOutput_3 .prepareStatement(insert_tMysqlOutput_3); /** * [tMysqlOutput_3 begin ] stop */ /** * [tMap_3 begin ] start */ ok_Hash.put("tMap_3", false); start_Hash.put("tMap_3", System.currentTimeMillis()); currentComponent = "tMap_3"; int tos_count_tMap_3 = 0; // ############################### // # Lookup's keys initialization org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row15Struct> tHash_Lookup_row15 = null; row15Struct row15HashKey = new row15Struct(); row15Struct row15Default = new row15Struct(); // ############################### // ############################### // # Vars initialization class Var__tMap_3__Struct { } Var__tMap_3__Struct Var__tMap_3 = new Var__tMap_3__Struct(); // ############################### // ############################### // # Outputs initialization loadCityDataStruct loadCityData_tmp = new loadCityDataStruct(); // ############################### /** * [tMap_3 begin ] stop */ /** * [tJoin_5 begin ] start */ ok_Hash.put("tJoin_5", false); start_Hash.put("tJoin_5", System.currentTimeMillis()); currentComponent = "tJoin_5"; int tos_count_tJoin_5 = 0; final java.util.Map<row4Struct, row4Struct> tHash_tJoin_5 = (java.util.Map<row4Struct, row4Struct>) globalMap .get("tHash_row4"); class Util_tJoin_5 { row4Struct lookupValue = null; row4Struct row4HashKey = new row4Struct(); public boolean isJoined(stateCityStruct mainRow) { row4HashKey.CITY = mainRow.city; row4HashKey.hashCodeDirty = true; lookupValue = tHash_tJoin_5.get(row4HashKey); if (lookupValue != null) { return true; } return false; } } Util_tJoin_5 util_tJoin_5 = new Util_tJoin_5(); int nb_line_tJoin_5 = 0; /** * [tJoin_5 begin ] stop */ /** * [tMap_10 begin ] start */ ok_Hash.put("tMap_10", false); start_Hash.put("tMap_10", System.currentTimeMillis()); currentComponent = "tMap_10"; int tos_count_tMap_10 = 0; // ############################### // # Lookup's keys initialization // ############################### // ############################### // # Vars initialization class Var__tMap_10__Struct { } Var__tMap_10__Struct Var__tMap_10 = new Var__tMap_10__Struct(); // ############################### // ############################### // # Outputs initialization zipRowDataStruct zipRowData_tmp = new zipRowDataStruct(); stateInfoStruct stateInfo_tmp = new stateInfoStruct(); stateCityStruct stateCity_tmp = new stateCityStruct(); // ############################### /** * [tMap_10 begin ] stop */ /** * [tJavaRow_1 begin ] start */ ok_Hash.put("tJavaRow_1", false); start_Hash.put("tJavaRow_1", System.currentTimeMillis()); currentComponent = "tJavaRow_1"; int tos_count_tJavaRow_1 = 0; int nb_line_tJavaRow_1 = 0; /** * [tJavaRow_1 begin ] stop */ /** * [tFileInputJSON_1 begin ] start */ ok_Hash.put("tFileInputJSON_1", false); start_Hash.put("tFileInputJSON_1", System.currentTimeMillis()); currentComponent = "tFileInputJSON_1"; int tos_count_tFileInputJSON_1 = 0; class JSONUtil_tFileInputJSON_1 { public int getData(String query, javax.script.Invocable invocableEngine, java.util.List<org.json.simple.JSONArray> jsonResultList, int recordMaxSize) { try { // only 2 types: String/Boolean String resultObj = invocableEngine.invokeFunction("jsonPath", query) .toString(); if (!"false".equals(resultObj)) { org.json.simple.JSONArray resultArray = (org.json.simple.JSONArray) org.json.simple.JSONValue .parse(resultObj); jsonResultList.add(resultArray); if (recordMaxSize != -1 && recordMaxSize != resultArray.size()) { // just give an error, don't // stop System.err.println( "The Json resource datas maybe have some problems, please make sure the data structure with the same fields."); } recordMaxSize = Math.max(recordMaxSize, resultArray.size()); } else { System.err.println("Can't find any data with JSONPath " + query); // add null to take a place in // List(buffer) jsonResultList.add(null); } } catch (Exception e) { e.printStackTrace(); } return recordMaxSize; } void setRowValue_0(row2Struct row2, java.util.List<org.json.simple.JSONArray> JSONResultList_tFileInputJSON_1, int nbResultArray_tFileInputJSON_1) throws java.io.UnsupportedEncodingException { if (JSONResultList_tFileInputJSON_1.get(0) != null && nbResultArray_tFileInputJSON_1 < JSONResultList_tFileInputJSON_1 .get(0).size() && JSONResultList_tFileInputJSON_1.get(0) .get(nbResultArray_tFileInputJSON_1) != null) { row2.city = JSONResultList_tFileInputJSON_1.get(0) .get(nbResultArray_tFileInputJSON_1).toString(); } else { row2.city = null; } if (JSONResultList_tFileInputJSON_1.get(1) != null && nbResultArray_tFileInputJSON_1 < JSONResultList_tFileInputJSON_1 .get(1).size() && JSONResultList_tFileInputJSON_1.get(1) .get(nbResultArray_tFileInputJSON_1) != null) { row2.state = JSONResultList_tFileInputJSON_1.get(1) .get(nbResultArray_tFileInputJSON_1).toString(); } else { row2.state = null; } if (JSONResultList_tFileInputJSON_1.get(2) != null && nbResultArray_tFileInputJSON_1 < JSONResultList_tFileInputJSON_1 .get(2).size() && JSONResultList_tFileInputJSON_1.get(2) .get(nbResultArray_tFileInputJSON_1) != null) { row2.country = JSONResultList_tFileInputJSON_1.get(2) .get(nbResultArray_tFileInputJSON_1).toString(); } else { row2.country = null; } } } int nb_line_tFileInputJSON_1 = 0; javax.script.ScriptEngineManager scriptEngineMgr_tFileInputJSON_1 = new javax.script.ScriptEngineManager(); javax.script.ScriptEngine jsEngine_tFileInputJSON_1 = scriptEngineMgr_tFileInputJSON_1 .getEngineByName("JavaScript"); if (jsEngine_tFileInputJSON_1 == null) { System.err.println("No script engine found for JavaScript"); } java.io.InputStream jsonis_tFileInputJSON_1 = com.jsonpath.test.ReadJar.class .getResource("json.js").openStream(); jsEngine_tFileInputJSON_1.eval(new java.io.BufferedReader( new java.io.InputStreamReader(jsonis_tFileInputJSON_1))); java.io.InputStream jsonpathis_tFileInputJSON_1 = com.jsonpath.test.ReadJar.class .getResource("jsonpath.js").openStream(); jsEngine_tFileInputJSON_1.eval(new java.io.BufferedReader( new java.io.InputStreamReader(jsonpathis_tFileInputJSON_1))); java.net.URL url_tFileInputJSON_1 = new java.net.URL( "http://ziptasticapi.com/" + ((Integer) globalMap.get("zipCode"))); java.net.URLConnection urlConn_tFileInputJSON_1 = url_tFileInputJSON_1.openConnection(); java.io.InputStreamReader fr_tFileInputJSON_1 = new java.io.InputStreamReader( urlConn_tFileInputJSON_1.getInputStream(), "UTF-8"); java.lang.Object jsonText_tFileInputJSON_1 = org.json.simple.JSONValue .parse(fr_tFileInputJSON_1); jsEngine_tFileInputJSON_1.eval("var obj=" + jsonText_tFileInputJSON_1.toString()); java.util.List<org.json.simple.JSONArray> JSONResultList_tFileInputJSON_1 = new java.util.ArrayList<org.json.simple.JSONArray>(); int recordMaxSize_tFileInputJSON_1 = -1; javax.script.Invocable invocableEngine_tFileInputJSON_1 = (javax.script.Invocable) jsEngine_tFileInputJSON_1; JSONUtil_tFileInputJSON_1 jsonUtil_tFileInputJSON_1 = new JSONUtil_tFileInputJSON_1(); recordMaxSize_tFileInputJSON_1 = jsonUtil_tFileInputJSON_1.getData("city", invocableEngine_tFileInputJSON_1, JSONResultList_tFileInputJSON_1, recordMaxSize_tFileInputJSON_1); recordMaxSize_tFileInputJSON_1 = jsonUtil_tFileInputJSON_1.getData("state", invocableEngine_tFileInputJSON_1, JSONResultList_tFileInputJSON_1, recordMaxSize_tFileInputJSON_1); recordMaxSize_tFileInputJSON_1 = jsonUtil_tFileInputJSON_1.getData("country", invocableEngine_tFileInputJSON_1, JSONResultList_tFileInputJSON_1, recordMaxSize_tFileInputJSON_1); for (int nbResultArray_tFileInputJSON_1 = 0; nbResultArray_tFileInputJSON_1 < recordMaxSize_tFileInputJSON_1; nbResultArray_tFileInputJSON_1++) { nb_line_tFileInputJSON_1++; jsonUtil_tFileInputJSON_1.setRowValue_0(row2, JSONResultList_tFileInputJSON_1, nbResultArray_tFileInputJSON_1); /** * [tFileInputJSON_1 begin ] stop */ /** * [tFileInputJSON_1 main ] start */ currentComponent = "tFileInputJSON_1"; tos_count_tFileInputJSON_1++; /** * [tFileInputJSON_1 main ] stop */ /** * [tJavaRow_1 main ] start */ currentComponent = "tJavaRow_1"; // Code generated according to input schema and // output schema row3.city = row2.city; row3.state = row2.state; row3.country = row2.country; row3.zip = ((Integer) globalMap.get("zipCode")); nb_line_tJavaRow_1++; tos_count_tJavaRow_1++; /** * [tJavaRow_1 main ] stop */ /** * [tMap_10 main ] start */ currentComponent = "tMap_10"; boolean hasCasePrimitiveKeyWithNull_tMap_10 = false; // ############################### // # Input tables (lookups) boolean rejectedInnerJoin_tMap_10 = false; boolean mainRowRejected_tMap_10 = false; // ############################### { // start of Var scope // ############################### // # Vars tables Var__tMap_10__Struct Var = Var__tMap_10;// ############################### // ############################### // # Output tables zipRowData = null; stateInfo = null; stateCity = null; // # Output table : 'zipRowData' zipRowData_tmp.city = row3.city; zipRowData_tmp.zip = row3.zip; zipRowData = zipRowData_tmp; // # Output table : 'stateInfo' stateInfo_tmp.state = row3.state; stateInfo = stateInfo_tmp; // # Output table : 'stateCity' stateCity_tmp.city = row3.city; stateCity_tmp.state = row3.state; stateCity_tmp.zip = row3.zip; stateCity = stateCity_tmp; // ############################### } // end of Var scope rejectedInnerJoin_tMap_10 = false; tos_count_tMap_10++; /** * [tMap_10 main ] stop */ // Start of branch "zipRowData" if (zipRowData != null) { row10 = null; /** * [tMap_12 main ] start */ currentComponent = "tMap_12"; boolean hasCasePrimitiveKeyWithNull_tMap_12 = false; // ############################### // # Input tables (lookups) boolean rejectedInnerJoin_tMap_12 = false; boolean mainRowRejected_tMap_12 = false; // ///////////////////////////////////////////// // Starting Lookup Table "row12" // ///////////////////////////////////////////// boolean forceLooprow12 = false; row12Struct row12ObjectFromLookup = null; if (!rejectedInnerJoin_tMap_12) { // G_TM_M_020 hasCasePrimitiveKeyWithNull_tMap_12 = false; row12HashKey.CITY = zipRowData.city; row12HashKey.hashCodeDirty = true; tHash_Lookup_Cache_row12.lookup(row12HashKey); if (tHash_Lookup_Cache_row12.hasNext()) { // G_TM_M_835 tHash_Lookup_row12 = tHash_Lookup_Cache_row12; } // G_TM_M_834 else { // G_TM_M_835 tMysqlInput_1Process(globalMap); tHash_Lookup_row12 = (org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row12Struct>) ((org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row12Struct>) globalMap .get("tHash_Lookup_row12")); tHash_Lookup_row12.initGet(); tHash_Lookup_row12.lookup(row12HashKey); } // G_TM_M_835 if (!tHash_Lookup_row12.hasNext()) { // G_TM_M_090 rejectedInnerJoin_tMap_12 = true; } // G_TM_M_090 } // G_TM_M_020 if (tHash_Lookup_row12 != null && tHash_Lookup_row12.getCount(row12HashKey) > 1) { // G // 071 // System.out.println("WARNING: UNIQUE MATCH is configured for the lookup 'row12' and it contains more one result from keys : row12.CITY = '" // + row12HashKey.CITY + "'"); } // G 071 row12Struct row12 = null; row12Struct fromLookup_row12 = null; row12 = row12Default; if (tHash_Lookup_row12 != null && tHash_Lookup_row12.hasNext()) { // G // 099 fromLookup_row12 = tHash_Lookup_row12.next(); } // G 099 if (fromLookup_row12 != null) { row12 = fromLookup_row12; } if (tHash_Lookup_Cache_row12 != tHash_Lookup_row12) { tHash_Lookup_Cache_row12.put(row12); } // ############################### { // start of Var scope // ############################### // # Vars tables Var__tMap_12__Struct Var = Var__tMap_12;// ############################### // ############################### // # Output tables out1 = null; if (!rejectedInnerJoin_tMap_12) { // # Output table : 'out1' out1_tmp.CITY_ID = row12.ID; out1_tmp.zip = zipRowData.zip; out1 = out1_tmp; } // closing inner join bracket (2) // ############################### } // end of Var scope rejectedInnerJoin_tMap_12 = false; tos_count_tMap_12++; /** * [tMap_12 main ] stop */ // Start of branch "out1" if (out1 != null) { row10 = null; /** * [tJoin_4 main ] start */ currentComponent = "tJoin_4"; row10 = null; row10 = new row10Struct(); row10.CITY_ID = out1.CITY_ID; row10.zip = out1.zip; if (util_tJoin_4.isJoined(out1)) { row10 = null; } else { } // ///////////////////// tos_count_tJoin_4++; /** * [tJoin_4 main ] stop */ // Start of branch "row10" if (row10 != null) { /** * [tMap_13 main ] start */ currentComponent = "tMap_13"; boolean hasCasePrimitiveKeyWithNull_tMap_13 = false; // ############################### // # Input tables (lookups) boolean rejectedInnerJoin_tMap_13 = false; boolean mainRowRejected_tMap_13 = false; // ############################### { // start of Var scope // ############################### // # Vars tables Var__tMap_13__Struct Var = Var__tMap_13;// ############################### // ############################### // # Output tables loadZip = null; // # Output table : 'loadZip' loadZip_tmp.ZIP_CODE = row10.zip; loadZip_tmp.CITY_ID = row10.CITY_ID; loadZip = loadZip_tmp; // ############################### } // end of Var scope rejectedInnerJoin_tMap_13 = false; tos_count_tMap_13++; /** * [tMap_13 main ] stop */ // Start of branch "loadZip" if (loadZip != null) { /** * [tMysqlOutput_5 main ] start */ currentComponent = "tMysqlOutput_5"; whetherReject_tMysqlOutput_5 = false; pstmt_tMysqlOutput_5.setInt(1, loadZip.ZIP_CODE); pstmt_tMysqlOutput_5.setInt(2, loadZip.CITY_ID); pstmt_tMysqlOutput_5.addBatch(); nb_line_tMysqlOutput_5++; batchSizeCounter_tMysqlOutput_5++; if (batchSize_tMysqlOutput_5 <= batchSizeCounter_tMysqlOutput_5) { try { int countSum_tMysqlOutput_5 = 0; for (int countEach_tMysqlOutput_5 : pstmt_tMysqlOutput_5 .executeBatch()) { countSum_tMysqlOutput_5 += (countEach_tMysqlOutput_5 < 0 ? 0 : countEach_tMysqlOutput_5); } insertedCount_tMysqlOutput_5 += countSum_tMysqlOutput_5; } catch (java.sql.BatchUpdateException e) { int countSum_tMysqlOutput_5 = 0; for (int countEach_tMysqlOutput_5 : e.getUpdateCounts()) { countSum_tMysqlOutput_5 += (countEach_tMysqlOutput_5 < 0 ? 0 : countEach_tMysqlOutput_5); } insertedCount_tMysqlOutput_5 += countSum_tMysqlOutput_5; System.err.println(e.getMessage()); } batchSizeCounter_tMysqlOutput_5 = 0; } commitCounter_tMysqlOutput_5++; if (commitEvery_tMysqlOutput_5 <= commitCounter_tMysqlOutput_5) { try { int countSum_tMysqlOutput_5 = 0; for (int countEach_tMysqlOutput_5 : pstmt_tMysqlOutput_5 .executeBatch()) { countSum_tMysqlOutput_5 += (countEach_tMysqlOutput_5 < 0 ? 0 : countEach_tMysqlOutput_5); } insertedCount_tMysqlOutput_5 += countSum_tMysqlOutput_5; } catch (java.sql.BatchUpdateException e) { int countSum_tMysqlOutput_5 = 0; for (int countEach_tMysqlOutput_5 : e.getUpdateCounts()) { countSum_tMysqlOutput_5 += (countEach_tMysqlOutput_5 < 0 ? 0 : countEach_tMysqlOutput_5); } insertedCount_tMysqlOutput_5 += countSum_tMysqlOutput_5; System.out.println(e.getMessage()); } conn_tMysqlOutput_5.commit(); commitCounter_tMysqlOutput_5 = 0; } tos_count_tMysqlOutput_5++; /** * [tMysqlOutput_5 main ] stop */ } // End of branch "loadZip" } // End of branch "row10" } // End of branch "out1" } // End of branch "zipRowData" // Start of branch "stateInfo" if (stateInfo != null) { row13 = null; /** * [tJoin_6 main ] start */ currentComponent = "tJoin_6"; row13 = null; row13 = new row13Struct(); row13.state = stateInfo.state; if (util_tJoin_6.isJoined(stateInfo)) { row13 = null; } else { } // ///////////////////// tos_count_tJoin_6++; /** * [tJoin_6 main ] stop */ // Start of branch "row13" if (row13 != null) { /** * [tMap_9 main ] start */ currentComponent = "tMap_9"; boolean hasCasePrimitiveKeyWithNull_tMap_9 = false; // ############################### // # Input tables (lookups) boolean rejectedInnerJoin_tMap_9 = false; boolean mainRowRejected_tMap_9 = false; // ############################### { // start of Var scope // ############################### // # Vars tables Var__tMap_9__Struct Var = Var__tMap_9;// ############################### // ############################### // # Output tables loadState = null; // # Output table : 'loadState' loadState_tmp.ID = 0; loadState_tmp.STATE = row13.state; loadState_tmp.FULL_NAME = null; loadState = loadState_tmp; // ############################### } // end of Var scope rejectedInnerJoin_tMap_9 = false; tos_count_tMap_9++; /** * [tMap_9 main ] stop */ // Start of branch "loadState" if (loadState != null) { /** * [tMysqlOutput_7 main ] start */ currentComponent = "tMysqlOutput_7"; whetherReject_tMysqlOutput_7 = false; pstmt_tMysqlOutput_7.setInt(1, loadState.ID); if (loadState.STATE == null) { pstmt_tMysqlOutput_7.setNull(2, java.sql.Types.VARCHAR); } else { pstmt_tMysqlOutput_7.setString(2, loadState.STATE); } if (loadState.FULL_NAME == null) { pstmt_tMysqlOutput_7.setNull(3, java.sql.Types.VARCHAR); } else { pstmt_tMysqlOutput_7.setString(3, loadState.FULL_NAME); } pstmt_tMysqlOutput_7.addBatch(); nb_line_tMysqlOutput_7++; batchSizeCounter_tMysqlOutput_7++; if (batchSize_tMysqlOutput_7 <= batchSizeCounter_tMysqlOutput_7) { try { int countSum_tMysqlOutput_7 = 0; for (int countEach_tMysqlOutput_7 : pstmt_tMysqlOutput_7 .executeBatch()) { countSum_tMysqlOutput_7 += (countEach_tMysqlOutput_7 < 0 ? 0 : countEach_tMysqlOutput_7); } insertedCount_tMysqlOutput_7 += countSum_tMysqlOutput_7; } catch (java.sql.BatchUpdateException e) { int countSum_tMysqlOutput_7 = 0; for (int countEach_tMysqlOutput_7 : e.getUpdateCounts()) { countSum_tMysqlOutput_7 += (countEach_tMysqlOutput_7 < 0 ? 0 : countEach_tMysqlOutput_7); } insertedCount_tMysqlOutput_7 += countSum_tMysqlOutput_7; System.err.println(e.getMessage()); } batchSizeCounter_tMysqlOutput_7 = 0; } commitCounter_tMysqlOutput_7++; if (commitEvery_tMysqlOutput_7 <= commitCounter_tMysqlOutput_7) { try { int countSum_tMysqlOutput_7 = 0; for (int countEach_tMysqlOutput_7 : pstmt_tMysqlOutput_7 .executeBatch()) { countSum_tMysqlOutput_7 += (countEach_tMysqlOutput_7 < 0 ? 0 : countEach_tMysqlOutput_7); } insertedCount_tMysqlOutput_7 += countSum_tMysqlOutput_7; } catch (java.sql.BatchUpdateException e) { int countSum_tMysqlOutput_7 = 0; for (int countEach_tMysqlOutput_7 : e.getUpdateCounts()) { countSum_tMysqlOutput_7 += (countEach_tMysqlOutput_7 < 0 ? 0 : countEach_tMysqlOutput_7); } insertedCount_tMysqlOutput_7 += countSum_tMysqlOutput_7; System.out.println(e.getMessage()); } conn_tMysqlOutput_7.commit(); commitCounter_tMysqlOutput_7 = 0; } tos_count_tMysqlOutput_7++; /** * [tMysqlOutput_7 main ] stop */ } // End of branch "loadState" } // End of branch "row13" } // End of branch "stateInfo" // Start of branch "stateCity" if (stateCity != null) { row5 = null; /** * [tJoin_5 main ] start */ currentComponent = "tJoin_5"; row5 = null; row5 = new row5Struct(); row5.city = stateCity.city; row5.state = stateCity.state; row5.zip = stateCity.zip; if (util_tJoin_5.isJoined(stateCity)) { row5 = null; } else { } // ///////////////////// tos_count_tJoin_5++; /** * [tJoin_5 main ] stop */ // Start of branch "row5" if (row5 != null) { /** * [tMap_3 main ] start */ currentComponent = "tMap_3"; boolean hasCasePrimitiveKeyWithNull_tMap_3 = false; // ############################### // # Input tables (lookups) boolean rejectedInnerJoin_tMap_3 = false; boolean mainRowRejected_tMap_3 = false; // ///////////////////////////////////////////// // Starting Lookup Table "row15" // ///////////////////////////////////////////// boolean forceLooprow15 = false; row15Struct row15ObjectFromLookup = null; if (!rejectedInnerJoin_tMap_3) { // G_TM_M_020 hasCasePrimitiveKeyWithNull_tMap_3 = false; row15HashKey.STATE = row5.state; row15HashKey.hashCodeDirty = true; tMysqlInput_11Process(globalMap); tHash_Lookup_row15 = (org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row15Struct>) ((org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row15Struct>) globalMap .get("tHash_Lookup_row15")); tHash_Lookup_row15.initGet(); tHash_Lookup_row15.lookup(row15HashKey); if (!tHash_Lookup_row15.hasNext()) { // G_TM_M_090 rejectedInnerJoin_tMap_3 = true; } // G_TM_M_090 } // G_TM_M_020 if (tHash_Lookup_row15 != null && tHash_Lookup_row15.getCount(row15HashKey) > 1) { // G // 071 // System.out.println("WARNING: UNIQUE MATCH is configured for the lookup 'row15' and it contains more one result from keys : row15.STATE = '" // + row15HashKey.STATE + "'"); } // G 071 row15Struct row15 = null; row15Struct fromLookup_row15 = null; row15 = row15Default; if (tHash_Lookup_row15 != null && tHash_Lookup_row15.hasNext()) { // G // 099 fromLookup_row15 = tHash_Lookup_row15.next(); } // G 099 if (fromLookup_row15 != null) { row15 = fromLookup_row15; } // ############################### { // start of Var scope // ############################### // # Vars tables Var__tMap_3__Struct Var = Var__tMap_3;// ############################### // ############################### // # Output tables loadCityData = null; if (!rejectedInnerJoin_tMap_3) { // # Output table : // 'loadCityData' loadCityData_tmp.ID = 0; loadCityData_tmp.CITY = row5.city; loadCityData_tmp.SUMMARY = "NA"; loadCityData_tmp.IMAGE_URL = "NA"; loadCityData_tmp.STATE_ID = row15.ID; loadCityData = loadCityData_tmp; } // closing inner join bracket (2) // ############################### } // end of Var scope rejectedInnerJoin_tMap_3 = false; tos_count_tMap_3++; /** * [tMap_3 main ] stop */ // Start of branch "loadCityData" if (loadCityData != null) { /** * [tMysqlOutput_3 main ] start */ currentComponent = "tMysqlOutput_3"; whetherReject_tMysqlOutput_3 = false; pstmt_tMysqlOutput_3.setInt(1, loadCityData.ID); if (loadCityData.CITY == null) { pstmt_tMysqlOutput_3.setNull(2, java.sql.Types.VARCHAR); } else { pstmt_tMysqlOutput_3.setString(2, loadCityData.CITY); } if (loadCityData.SUMMARY == null) { pstmt_tMysqlOutput_3.setNull(3, java.sql.Types.VARCHAR); } else { pstmt_tMysqlOutput_3.setString(3, loadCityData.SUMMARY); } if (loadCityData.IMAGE_URL == null) { pstmt_tMysqlOutput_3.setNull(4, java.sql.Types.VARCHAR); } else { pstmt_tMysqlOutput_3.setString(4, loadCityData.IMAGE_URL); } pstmt_tMysqlOutput_3.setInt(5, loadCityData.STATE_ID); pstmt_tMysqlOutput_3.addBatch(); nb_line_tMysqlOutput_3++; batchSizeCounter_tMysqlOutput_3++; if (batchSize_tMysqlOutput_3 <= batchSizeCounter_tMysqlOutput_3) { try { int countSum_tMysqlOutput_3 = 0; for (int countEach_tMysqlOutput_3 : pstmt_tMysqlOutput_3 .executeBatch()) { countSum_tMysqlOutput_3 += (countEach_tMysqlOutput_3 < 0 ? 0 : countEach_tMysqlOutput_3); } insertedCount_tMysqlOutput_3 += countSum_tMysqlOutput_3; } catch (java.sql.BatchUpdateException e) { int countSum_tMysqlOutput_3 = 0; for (int countEach_tMysqlOutput_3 : e.getUpdateCounts()) { countSum_tMysqlOutput_3 += (countEach_tMysqlOutput_3 < 0 ? 0 : countEach_tMysqlOutput_3); } insertedCount_tMysqlOutput_3 += countSum_tMysqlOutput_3; System.err.println(e.getMessage()); } batchSizeCounter_tMysqlOutput_3 = 0; } commitCounter_tMysqlOutput_3++; if (commitEvery_tMysqlOutput_3 <= commitCounter_tMysqlOutput_3) { try { int countSum_tMysqlOutput_3 = 0; for (int countEach_tMysqlOutput_3 : pstmt_tMysqlOutput_3 .executeBatch()) { countSum_tMysqlOutput_3 += (countEach_tMysqlOutput_3 < 0 ? 0 : countEach_tMysqlOutput_3); } insertedCount_tMysqlOutput_3 += countSum_tMysqlOutput_3; } catch (java.sql.BatchUpdateException e) { int countSum_tMysqlOutput_3 = 0; for (int countEach_tMysqlOutput_3 : e.getUpdateCounts()) { countSum_tMysqlOutput_3 += (countEach_tMysqlOutput_3 < 0 ? 0 : countEach_tMysqlOutput_3); } insertedCount_tMysqlOutput_3 += countSum_tMysqlOutput_3; System.out.println(e.getMessage()); } conn_tMysqlOutput_3.commit(); commitCounter_tMysqlOutput_3 = 0; } tos_count_tMysqlOutput_3++; /** * [tMysqlOutput_3 main ] stop */ } // End of branch "loadCityData" } // End of branch "row5" } // End of branch "stateCity" /** * [tFileInputJSON_1 end ] start */ currentComponent = "tFileInputJSON_1"; } globalMap.put("tFileInputJSON_1_NB_LINE", nb_line_tFileInputJSON_1); ok_Hash.put("tFileInputJSON_1", true); end_Hash.put("tFileInputJSON_1", System.currentTimeMillis()); /** * [tFileInputJSON_1 end ] stop */ /** * [tJavaRow_1 end ] start */ currentComponent = "tJavaRow_1"; globalMap.put("tJavaRow_1_NB_LINE", nb_line_tJavaRow_1); ok_Hash.put("tJavaRow_1", true); end_Hash.put("tJavaRow_1", System.currentTimeMillis()); /** * [tJavaRow_1 end ] stop */ /** * [tMap_10 end ] start */ currentComponent = "tMap_10"; // ############################### // # Lookup hashes releasing // ############################### ok_Hash.put("tMap_10", true); end_Hash.put("tMap_10", System.currentTimeMillis()); /** * [tMap_10 end ] stop */ /** * [tJoin_5 end ] start */ currentComponent = "tJoin_5"; ok_Hash.put("tJoin_5", true); end_Hash.put("tJoin_5", System.currentTimeMillis()); /** * [tJoin_5 end ] stop */ /** * [tMap_3 end ] start */ currentComponent = "tMap_3"; // ############################### // # Lookup hashes releasing // ############################### ok_Hash.put("tMap_3", true); end_Hash.put("tMap_3", System.currentTimeMillis()); /** * [tMap_3 end ] stop */ /** * [tMysqlOutput_3 end ] start */ currentComponent = "tMysqlOutput_3"; try { if (batchSizeCounter_tMysqlOutput_3 != 0) { int countSum_tMysqlOutput_3 = 0; for (int countEach_tMysqlOutput_3 : pstmt_tMysqlOutput_3.executeBatch()) { countSum_tMysqlOutput_3 += (countEach_tMysqlOutput_3 < 0 ? 0 : countEach_tMysqlOutput_3); } insertedCount_tMysqlOutput_3 += countSum_tMysqlOutput_3; } } catch (java.sql.BatchUpdateException e) { int countSum_tMysqlOutput_3 = 0; for (int countEach_tMysqlOutput_3 : e.getUpdateCounts()) { countSum_tMysqlOutput_3 += (countEach_tMysqlOutput_3 < 0 ? 0 : countEach_tMysqlOutput_3); } insertedCount_tMysqlOutput_3 += countSum_tMysqlOutput_3; System.err.println(e.getMessage()); } batchSizeCounter_tMysqlOutput_3 = 0; try { if (pstmt_tMysqlOutput_3 != null) { int countSum_tMysqlOutput_3 = 0; for (int countEach_tMysqlOutput_3 : pstmt_tMysqlOutput_3.executeBatch()) { countSum_tMysqlOutput_3 += (countEach_tMysqlOutput_3 < 0 ? 0 : countEach_tMysqlOutput_3); } insertedCount_tMysqlOutput_3 += countSum_tMysqlOutput_3; } } catch (java.sql.BatchUpdateException e) { int countSum_tMysqlOutput_3 = 0; for (int countEach_tMysqlOutput_3 : e.getUpdateCounts()) { countSum_tMysqlOutput_3 += (countEach_tMysqlOutput_3 < 0 ? 0 : countEach_tMysqlOutput_3); } insertedCount_tMysqlOutput_3 += countSum_tMysqlOutput_3; System.out.println(e.getMessage()); } if (pstmt_tMysqlOutput_3 != null) { pstmt_tMysqlOutput_3.close(); } conn_tMysqlOutput_3.commit(); conn_tMysqlOutput_3.close(); nb_line_deleted_tMysqlOutput_3 = nb_line_deleted_tMysqlOutput_3 + deletedCount_tMysqlOutput_3; nb_line_update_tMysqlOutput_3 = nb_line_update_tMysqlOutput_3 + updatedCount_tMysqlOutput_3; nb_line_inserted_tMysqlOutput_3 = nb_line_inserted_tMysqlOutput_3 + insertedCount_tMysqlOutput_3; nb_line_rejected_tMysqlOutput_3 = nb_line_rejected_tMysqlOutput_3 + rejectedCount_tMysqlOutput_3; globalMap.put("tMysqlOutput_3_NB_LINE", nb_line_tMysqlOutput_3); globalMap.put("tMysqlOutput_3_NB_LINE_UPDATED", nb_line_update_tMysqlOutput_3); globalMap.put("tMysqlOutput_3_NB_LINE_INSERTED", nb_line_inserted_tMysqlOutput_3); globalMap.put("tMysqlOutput_3_NB_LINE_DELETED", nb_line_deleted_tMysqlOutput_3); globalMap.put("tMysqlOutput_3_NB_LINE_REJECTED", nb_line_rejected_tMysqlOutput_3); ok_Hash.put("tMysqlOutput_3", true); end_Hash.put("tMysqlOutput_3", System.currentTimeMillis()); /** * [tMysqlOutput_3 end ] stop */ /** * [tJoin_6 end ] start */ currentComponent = "tJoin_6"; ok_Hash.put("tJoin_6", true); end_Hash.put("tJoin_6", System.currentTimeMillis()); /** * [tJoin_6 end ] stop */ /** * [tMap_9 end ] start */ currentComponent = "tMap_9"; // ############################### // # Lookup hashes releasing // ############################### ok_Hash.put("tMap_9", true); end_Hash.put("tMap_9", System.currentTimeMillis()); /** * [tMap_9 end ] stop */ /** * [tMysqlOutput_7 end ] start */ currentComponent = "tMysqlOutput_7"; try { if (batchSizeCounter_tMysqlOutput_7 != 0) { int countSum_tMysqlOutput_7 = 0; for (int countEach_tMysqlOutput_7 : pstmt_tMysqlOutput_7.executeBatch()) { countSum_tMysqlOutput_7 += (countEach_tMysqlOutput_7 < 0 ? 0 : countEach_tMysqlOutput_7); } insertedCount_tMysqlOutput_7 += countSum_tMysqlOutput_7; } } catch (java.sql.BatchUpdateException e) { int countSum_tMysqlOutput_7 = 0; for (int countEach_tMysqlOutput_7 : e.getUpdateCounts()) { countSum_tMysqlOutput_7 += (countEach_tMysqlOutput_7 < 0 ? 0 : countEach_tMysqlOutput_7); } insertedCount_tMysqlOutput_7 += countSum_tMysqlOutput_7; System.err.println(e.getMessage()); } batchSizeCounter_tMysqlOutput_7 = 0; try { if (pstmt_tMysqlOutput_7 != null) { int countSum_tMysqlOutput_7 = 0; for (int countEach_tMysqlOutput_7 : pstmt_tMysqlOutput_7.executeBatch()) { countSum_tMysqlOutput_7 += (countEach_tMysqlOutput_7 < 0 ? 0 : countEach_tMysqlOutput_7); } insertedCount_tMysqlOutput_7 += countSum_tMysqlOutput_7; } } catch (java.sql.BatchUpdateException e) { int countSum_tMysqlOutput_7 = 0; for (int countEach_tMysqlOutput_7 : e.getUpdateCounts()) { countSum_tMysqlOutput_7 += (countEach_tMysqlOutput_7 < 0 ? 0 : countEach_tMysqlOutput_7); } insertedCount_tMysqlOutput_7 += countSum_tMysqlOutput_7; System.out.println(e.getMessage()); } if (pstmt_tMysqlOutput_7 != null) { pstmt_tMysqlOutput_7.close(); } conn_tMysqlOutput_7.commit(); conn_tMysqlOutput_7.close(); nb_line_deleted_tMysqlOutput_7 = nb_line_deleted_tMysqlOutput_7 + deletedCount_tMysqlOutput_7; nb_line_update_tMysqlOutput_7 = nb_line_update_tMysqlOutput_7 + updatedCount_tMysqlOutput_7; nb_line_inserted_tMysqlOutput_7 = nb_line_inserted_tMysqlOutput_7 + insertedCount_tMysqlOutput_7; nb_line_rejected_tMysqlOutput_7 = nb_line_rejected_tMysqlOutput_7 + rejectedCount_tMysqlOutput_7; globalMap.put("tMysqlOutput_7_NB_LINE", nb_line_tMysqlOutput_7); globalMap.put("tMysqlOutput_7_NB_LINE_UPDATED", nb_line_update_tMysqlOutput_7); globalMap.put("tMysqlOutput_7_NB_LINE_INSERTED", nb_line_inserted_tMysqlOutput_7); globalMap.put("tMysqlOutput_7_NB_LINE_DELETED", nb_line_deleted_tMysqlOutput_7); globalMap.put("tMysqlOutput_7_NB_LINE_REJECTED", nb_line_rejected_tMysqlOutput_7); ok_Hash.put("tMysqlOutput_7", true); end_Hash.put("tMysqlOutput_7", System.currentTimeMillis()); /** * [tMysqlOutput_7 end ] stop */ /** * [tMap_12 end ] start */ currentComponent = "tMap_12"; // ############################### // # Lookup hashes releasing // ############################### ok_Hash.put("tMap_12", true); end_Hash.put("tMap_12", System.currentTimeMillis()); /** * [tMap_12 end ] stop */ /** * [tJoin_4 end ] start */ currentComponent = "tJoin_4"; ok_Hash.put("tJoin_4", true); end_Hash.put("tJoin_4", System.currentTimeMillis()); /** * [tJoin_4 end ] stop */ /** * [tMap_13 end ] start */ currentComponent = "tMap_13"; // ############################### // # Lookup hashes releasing // ############################### ok_Hash.put("tMap_13", true); end_Hash.put("tMap_13", System.currentTimeMillis()); /** * [tMap_13 end ] stop */ /** * [tMysqlOutput_5 end ] start */ currentComponent = "tMysqlOutput_5"; try { if (batchSizeCounter_tMysqlOutput_5 != 0) { int countSum_tMysqlOutput_5 = 0; for (int countEach_tMysqlOutput_5 : pstmt_tMysqlOutput_5.executeBatch()) { countSum_tMysqlOutput_5 += (countEach_tMysqlOutput_5 < 0 ? 0 : countEach_tMysqlOutput_5); } insertedCount_tMysqlOutput_5 += countSum_tMysqlOutput_5; } } catch (java.sql.BatchUpdateException e) { int countSum_tMysqlOutput_5 = 0; for (int countEach_tMysqlOutput_5 : e.getUpdateCounts()) { countSum_tMysqlOutput_5 += (countEach_tMysqlOutput_5 < 0 ? 0 : countEach_tMysqlOutput_5); } insertedCount_tMysqlOutput_5 += countSum_tMysqlOutput_5; System.err.println(e.getMessage()); } batchSizeCounter_tMysqlOutput_5 = 0; try { if (pstmt_tMysqlOutput_5 != null) { int countSum_tMysqlOutput_5 = 0; for (int countEach_tMysqlOutput_5 : pstmt_tMysqlOutput_5.executeBatch()) { countSum_tMysqlOutput_5 += (countEach_tMysqlOutput_5 < 0 ? 0 : countEach_tMysqlOutput_5); } insertedCount_tMysqlOutput_5 += countSum_tMysqlOutput_5; } } catch (java.sql.BatchUpdateException e) { int countSum_tMysqlOutput_5 = 0; for (int countEach_tMysqlOutput_5 : e.getUpdateCounts()) { countSum_tMysqlOutput_5 += (countEach_tMysqlOutput_5 < 0 ? 0 : countEach_tMysqlOutput_5); } insertedCount_tMysqlOutput_5 += countSum_tMysqlOutput_5; System.out.println(e.getMessage()); } if (pstmt_tMysqlOutput_5 != null) { pstmt_tMysqlOutput_5.close(); } conn_tMysqlOutput_5.commit(); conn_tMysqlOutput_5.close(); nb_line_deleted_tMysqlOutput_5 = nb_line_deleted_tMysqlOutput_5 + deletedCount_tMysqlOutput_5; nb_line_update_tMysqlOutput_5 = nb_line_update_tMysqlOutput_5 + updatedCount_tMysqlOutput_5; nb_line_inserted_tMysqlOutput_5 = nb_line_inserted_tMysqlOutput_5 + insertedCount_tMysqlOutput_5; nb_line_rejected_tMysqlOutput_5 = nb_line_rejected_tMysqlOutput_5 + rejectedCount_tMysqlOutput_5; globalMap.put("tMysqlOutput_5_NB_LINE", nb_line_tMysqlOutput_5); globalMap.put("tMysqlOutput_5_NB_LINE_UPDATED", nb_line_update_tMysqlOutput_5); globalMap.put("tMysqlOutput_5_NB_LINE_INSERTED", nb_line_inserted_tMysqlOutput_5); globalMap.put("tMysqlOutput_5_NB_LINE_DELETED", nb_line_deleted_tMysqlOutput_5); globalMap.put("tMysqlOutput_5_NB_LINE_REJECTED", nb_line_rejected_tMysqlOutput_5); ok_Hash.put("tMysqlOutput_5", true); end_Hash.put("tMysqlOutput_5", System.currentTimeMillis()); /** * [tMysqlOutput_5 end ] stop */ } // End of branch "zipCode" // Start of branch "propertyData" if (propertyData != null) { row9 = null; /** * [tMap_4 main ] start */ currentComponent = "tMap_4"; boolean hasCasePrimitiveKeyWithNull_tMap_4 = false; // ############################### // # Input tables (lookups) boolean rejectedInnerJoin_tMap_4 = false; boolean mainRowRejected_tMap_4 = false; // ///////////////////////////////////////////// // Starting Lookup Table "custData" // ///////////////////////////////////////////// boolean forceLoopcustData = false; custDataStruct custDataObjectFromLookup = null; if (!rejectedInnerJoin_tMap_4) { // G_TM_M_020 hasCasePrimitiveKeyWithNull_tMap_4 = false; custDataHashKey.CUST_UUID = propertyData.customerUUId; custDataHashKey.hashCodeDirty = true; tHash_Lookup_custData.lookup(custDataHashKey); if (!tHash_Lookup_custData.hasNext()) { // G_TM_M_090 rejectedInnerJoin_tMap_4 = true; } // G_TM_M_090 } // G_TM_M_020 if (tHash_Lookup_custData != null && tHash_Lookup_custData.getCount(custDataHashKey) > 1) { // G // 071 // System.out.println("WARNING: UNIQUE MATCH is configured for the lookup 'custData' and it contains more one result from keys : custData.CUST_UUID = '" // + custDataHashKey.CUST_UUID + "'"); } // G 071 custDataStruct custData = null; custDataStruct fromLookup_custData = null; custData = custDataDefault; if (tHash_Lookup_custData != null && tHash_Lookup_custData.hasNext()) { // G // 099 fromLookup_custData = tHash_Lookup_custData.next(); } // G 099 if (fromLookup_custData != null) { custData = fromLookup_custData; } // ############################### { // start of Var scope // ############################### // # Vars tables Var__tMap_4__Struct Var = Var__tMap_4;// ############################### // ############################### // # Output tables loadData = null; if (!rejectedInnerJoin_tMap_4) { // # Output table : 'loadData' loadData_tmp.PROP_NAME = propertyData.name; loadData_tmp.PRICE = propertyData.price__c; loadData_tmp.SQFT = propertyData.pba__totalarea_pb__c; loadData_tmp.DESCRIPTION = propertyData.pba__description_pb__c; loadData_tmp.NUM_BEDS = propertyData.bedrooms__c; loadData_tmp.NUM_BATHS = propertyData.bathrooms__c; loadData_tmp.TYPE = propertyData.pba__propertytype__c; loadData_tmp.STATUS = propertyData.pba__status__c; loadData_tmp.DATA_SOURCE_ID = custData.DATA_SOURCE_ID; loadData_tmp.ZIP_CODE = propertyData.zipcode__c; loadData = loadData_tmp; } // closing inner join bracket (2) // ############################### } // end of Var scope rejectedInnerJoin_tMap_4 = false; tos_count_tMap_4++; /** * [tMap_4 main ] stop */ // Start of branch "loadData" if (loadData != null) { row9 = null; /** * [tJoin_3 main ] start */ currentComponent = "tJoin_3"; row9 = null; row9 = new row9Struct(); row9.PROP_NAME = loadData.PROP_NAME; row9.PRICE = loadData.PRICE; row9.SQFT = loadData.SQFT; row9.DESCRIPTION = loadData.DESCRIPTION; row9.NUM_BEDS = loadData.NUM_BEDS; row9.NUM_BATHS = loadData.NUM_BATHS; row9.TYPE = loadData.TYPE; row9.STATUS = loadData.STATUS; row9.DATA_SOURCE_ID = loadData.DATA_SOURCE_ID; row9.ZIP_CODE = loadData.ZIP_CODE; if (util_tJoin_3.isJoined(loadData)) { row9 = null; } else { } // ///////////////////// tos_count_tJoin_3++; /** * [tJoin_3 main ] stop */ // Start of branch "row9" if (row9 != null) { /** * [tJavaRow_3 main ] start */ currentComponent = "tJavaRow_3"; // Code generated according to input schema // and output schema System.out.println( "***** Loading New Property Data for:" + row9.PROP_NAME + " *****"); row14.PROP_NAME = row9.PROP_NAME; row14.PRICE = row9.PRICE; row14.SQFT = row9.SQFT; row14.DESCRIPTION = row9.DESCRIPTION; row14.NUM_BEDS = row9.NUM_BEDS; row14.NUM_BATHS = row9.NUM_BATHS; row14.TYPE = row9.TYPE; row14.STATUS = row9.STATUS; row14.ZIP_CODE = row9.ZIP_CODE; row14.DATA_SOURCE_ID = row9.DATA_SOURCE_ID; row14.PROP_UUID = UUID.randomUUID().toString(); nb_line_tJavaRow_3++; tos_count_tJavaRow_3++; /** * [tJavaRow_3 main ] stop */ /** * [tMap_8 main ] start */ currentComponent = "tMap_8"; boolean hasCasePrimitiveKeyWithNull_tMap_8 = false; // ############################### // # Input tables (lookups) boolean rejectedInnerJoin_tMap_8 = false; boolean mainRowRejected_tMap_8 = false; // ############################### { // start of Var scope // ############################### // # Vars tables Var__tMap_8__Struct Var = Var__tMap_8;// ############################### // ############################### // # Output tables loadPropertyData = null; // # Output table : 'loadPropertyData' loadPropertyData_tmp.ID = 0; loadPropertyData_tmp.UUID = row14.PROP_UUID; loadPropertyData_tmp.PROP_NAME = row14.PROP_NAME; loadPropertyData_tmp.PRICE = row14.PRICE; loadPropertyData_tmp.SQFT = row14.SQFT; loadPropertyData_tmp.DESCRIPTION = row14.DESCRIPTION; loadPropertyData_tmp.NUM_BEDS = row14.NUM_BEDS; loadPropertyData_tmp.NUM_BATHS = row14.NUM_BATHS; loadPropertyData_tmp.TYPE = row14.TYPE; loadPropertyData_tmp.STATUS = row14.STATUS; loadPropertyData_tmp.DATA_SOURCE_ID = row14.DATA_SOURCE_ID; loadPropertyData_tmp.ZIP_CODE = row14.ZIP_CODE; loadPropertyData = loadPropertyData_tmp; // ############################### } // end of Var scope rejectedInnerJoin_tMap_8 = false; tos_count_tMap_8++; /** * [tMap_8 main ] stop */ // Start of branch "loadPropertyData" if (loadPropertyData != null) { /** * [tMysqlOutput_1 main ] start */ currentComponent = "tMysqlOutput_1"; whetherReject_tMysqlOutput_1 = false; pstmt_tMysqlOutput_1.setInt(1, loadPropertyData.ID); if (loadPropertyData.UUID == null) { pstmt_tMysqlOutput_1.setNull(2, java.sql.Types.VARCHAR); } else { pstmt_tMysqlOutput_1.setString(2, loadPropertyData.UUID); } if (loadPropertyData.PROP_NAME == null) { pstmt_tMysqlOutput_1.setNull(3, java.sql.Types.VARCHAR); } else { pstmt_tMysqlOutput_1.setString(3, loadPropertyData.PROP_NAME); } pstmt_tMysqlOutput_1.setFloat(4, loadPropertyData.PRICE); pstmt_tMysqlOutput_1.setFloat(5, loadPropertyData.SQFT); if (loadPropertyData.DESCRIPTION == null) { pstmt_tMysqlOutput_1.setNull(6, java.sql.Types.VARCHAR); } else { pstmt_tMysqlOutput_1.setString(6, loadPropertyData.DESCRIPTION); } pstmt_tMysqlOutput_1.setFloat(7, loadPropertyData.NUM_BEDS); pstmt_tMysqlOutput_1.setFloat(8, loadPropertyData.NUM_BATHS); if (loadPropertyData.TYPE == null) { pstmt_tMysqlOutput_1.setNull(9, java.sql.Types.VARCHAR); } else { pstmt_tMysqlOutput_1.setString(9, loadPropertyData.TYPE); } if (loadPropertyData.STATUS == null) { pstmt_tMysqlOutput_1.setNull(10, java.sql.Types.VARCHAR); } else { pstmt_tMysqlOutput_1.setString(10, loadPropertyData.STATUS); } pstmt_tMysqlOutput_1.setInt(11, loadPropertyData.DATA_SOURCE_ID); pstmt_tMysqlOutput_1.setInt(12, loadPropertyData.ZIP_CODE); try { insertedCount_tMysqlOutput_1 = insertedCount_tMysqlOutput_1 + pstmt_tMysqlOutput_1.executeUpdate(); nb_line_tMysqlOutput_1++; } catch (Exception e) { whetherReject_tMysqlOutput_1 = true; System.err.print(e.getMessage()); } commitCounter_tMysqlOutput_1++; if (commitEvery_tMysqlOutput_1 <= commitCounter_tMysqlOutput_1) { try { int countSum_tMysqlOutput_1 = 0; for (int countEach_tMysqlOutput_1 : pstmt_tMysqlOutput_1 .executeBatch()) { countSum_tMysqlOutput_1 += (countEach_tMysqlOutput_1 < 0 ? 0 : countEach_tMysqlOutput_1); } insertedCount_tMysqlOutput_1 += countSum_tMysqlOutput_1; } catch (java.sql.BatchUpdateException e) { int countSum_tMysqlOutput_1 = 0; for (int countEach_tMysqlOutput_1 : e.getUpdateCounts()) { countSum_tMysqlOutput_1 += (countEach_tMysqlOutput_1 < 0 ? 0 : countEach_tMysqlOutput_1); } insertedCount_tMysqlOutput_1 += countSum_tMysqlOutput_1; System.out.println(e.getMessage()); } conn_tMysqlOutput_1.commit(); commitCounter_tMysqlOutput_1 = 0; } tos_count_tMysqlOutput_1++; /** * [tMysqlOutput_1 main ] stop */ } // End of branch "loadPropertyData" } // End of branch "row9" } // End of branch "loadData" } // End of branch "propertyData" } // End of branch "row1" /** * [tFileInputXML_1 end ] start */ currentComponent = "tFileInputXML_1"; } try { looper_tFileInputXML_1.handleTaskResponse(); } catch (Exception e) { System.err.println(e.getMessage()); } globalMap.put("tFileInputXML_1_NB_LINE", nb_line_tFileInputXML_1); ok_Hash.put("tFileInputXML_1", true); end_Hash.put("tFileInputXML_1", System.currentTimeMillis()); /** * [tFileInputXML_1 end ] stop */ /** * [tMap_2 end ] start */ currentComponent = "tMap_2"; // ############################### // # Lookup hashes releasing // ############################### ok_Hash.put("tMap_2", true); end_Hash.put("tMap_2", System.currentTimeMillis()); /** * [tMap_2 end ] stop */ /** * [tMap_4 end ] start */ currentComponent = "tMap_4"; // ############################### // # Lookup hashes releasing if (tHash_Lookup_custData != null) { tHash_Lookup_custData.endGet(); } globalMap.remove("tHash_Lookup_custData"); // ############################### ok_Hash.put("tMap_4", true); end_Hash.put("tMap_4", System.currentTimeMillis()); /** * [tMap_4 end ] stop */ /** * [tJoin_3 end ] start */ currentComponent = "tJoin_3"; ok_Hash.put("tJoin_3", true); end_Hash.put("tJoin_3", System.currentTimeMillis()); /** * [tJoin_3 end ] stop */ /** * [tJavaRow_3 end ] start */ currentComponent = "tJavaRow_3"; globalMap.put("tJavaRow_3_NB_LINE", nb_line_tJavaRow_3); ok_Hash.put("tJavaRow_3", true); end_Hash.put("tJavaRow_3", System.currentTimeMillis()); /** * [tJavaRow_3 end ] stop */ /** * [tMap_8 end ] start */ currentComponent = "tMap_8"; // ############################### // # Lookup hashes releasing // ############################### ok_Hash.put("tMap_8", true); end_Hash.put("tMap_8", System.currentTimeMillis()); /** * [tMap_8 end ] stop */ /** * [tMysqlOutput_1 end ] start */ currentComponent = "tMysqlOutput_1"; try { if (pstmt_tMysqlOutput_1 != null) { int countSum_tMysqlOutput_1 = 0; for (int countEach_tMysqlOutput_1 : pstmt_tMysqlOutput_1.executeBatch()) { countSum_tMysqlOutput_1 += (countEach_tMysqlOutput_1 < 0 ? 0 : countEach_tMysqlOutput_1); } insertedCount_tMysqlOutput_1 += countSum_tMysqlOutput_1; } } catch (java.sql.BatchUpdateException e) { int countSum_tMysqlOutput_1 = 0; for (int countEach_tMysqlOutput_1 : e.getUpdateCounts()) { countSum_tMysqlOutput_1 += (countEach_tMysqlOutput_1 < 0 ? 0 : countEach_tMysqlOutput_1); } insertedCount_tMysqlOutput_1 += countSum_tMysqlOutput_1; System.out.println(e.getMessage()); } if (pstmt_tMysqlOutput_1 != null) { pstmt_tMysqlOutput_1.close(); } conn_tMysqlOutput_1.commit(); conn_tMysqlOutput_1.close(); nb_line_deleted_tMysqlOutput_1 = nb_line_deleted_tMysqlOutput_1 + deletedCount_tMysqlOutput_1; nb_line_update_tMysqlOutput_1 = nb_line_update_tMysqlOutput_1 + updatedCount_tMysqlOutput_1; nb_line_inserted_tMysqlOutput_1 = nb_line_inserted_tMysqlOutput_1 + insertedCount_tMysqlOutput_1; nb_line_rejected_tMysqlOutput_1 = nb_line_rejected_tMysqlOutput_1 + rejectedCount_tMysqlOutput_1; globalMap.put("tMysqlOutput_1_NB_LINE", nb_line_tMysqlOutput_1); globalMap.put("tMysqlOutput_1_NB_LINE_UPDATED", nb_line_update_tMysqlOutput_1); globalMap.put("tMysqlOutput_1_NB_LINE_INSERTED", nb_line_inserted_tMysqlOutput_1); globalMap.put("tMysqlOutput_1_NB_LINE_DELETED", nb_line_deleted_tMysqlOutput_1); globalMap.put("tMysqlOutput_1_NB_LINE_REJECTED", nb_line_rejected_tMysqlOutput_1); ok_Hash.put("tMysqlOutput_1", true); end_Hash.put("tMysqlOutput_1", System.currentTimeMillis()); /** * [tMysqlOutput_1 end ] stop */ /** * [tFlowToIterate_1 end ] start */ currentComponent = "tFlowToIterate_1"; globalMap.put("tFlowToIterate_1_NB_LINE", nb_line_tFlowToIterate_1); ok_Hash.put("tFlowToIterate_1", true); end_Hash.put("tFlowToIterate_1", System.currentTimeMillis()); /** * [tFlowToIterate_1 end ] stop */ } // end the resume if (resumeEntryMethodName == null || globalResumeTicket) { resumeUtil.addLog("CHECKPOINT", "CONNECTION:SUBJOB_OK:tFileInputXML_1:OnSubjobOk", "", Thread.currentThread().getId() + "", "", "", "", "", ""); } tJava_1Process(globalMap); } catch (Exception e) { throw new TalendException(e, currentComponent, globalMap); } catch (java.lang.Error error) { throw new java.lang.Error(error); } finally { // free memory for "tJoin_4" globalMap.put("tHash_row6", null); // free memory for "tMap_12" globalMap.put("tHash_Lookup_row12", null); // free memory for "tJoin_6" globalMap.put("tHash_row11", null); // free memory for "tMap_3" globalMap.put("tHash_Lookup_row15", null); // free memory for "tJoin_5" globalMap.put("tHash_row4", null); // free memory for "tJoin_3" globalMap.put("tHash_getCurrentProperties", null); // free memory for "tMap_4" globalMap.put("tHash_Lookup_custData", null); } globalMap.put("tFileInputXML_1_SUBPROCESS_STATE", 1); }