本文整理汇总了Java中org.pentaho.di.core.Result.setNrErrors方法的典型用法代码示例。如果您正苦于以下问题:Java Result.setNrErrors方法的具体用法?Java Result.setNrErrors怎么用?Java Result.setNrErrors使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.pentaho.di.core.Result
的用法示例。
在下文中一共展示了Result.setNrErrors方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: execute
import org.pentaho.di.core.Result; //导入方法依赖的package包/类
/**
* Execute this job entry and return the result. In this case it means, just
* set the result boolean in the Result class.
*
* @param prev_result
* The result of the previous execution
* @return The Result of the execution.
*/
public Result execute(Result prev_result, int nr) {
boolean result = true;
if(StringUtils.isNotBlank(className)){
try {
//实例化配置的类
JobEntryEasyExpandRunBase kui = (JobEntryEasyExpandRunBase) Class.forName(
environmentSubstitute(className)).newInstance();
kui.setJeku(this);
result = kui.run();
} catch (Exception e) {
prev_result.setNrErrors(1);
result = false;
logError("运行失败,"+className+","+environmentSubstitute(configInfo), e);
}
}
prev_result.setResult(result);
return prev_result;
}
示例2: getResult
import org.pentaho.di.core.Result; //导入方法依赖的package包/类
public Result getResult(TransMeta transMeta)
{
Result result = new Result();
for (StepStatus stepStatus : stepStatusList) {
result.setNrErrors(result.getNrErrors()+stepStatus.getErrors()+(result.isStopped()?1:0)); // If the remote trans is stopped, count as an error
if (transMeta.getReadStep() !=null && stepStatus.getStepname().equals(transMeta.getReadStep().getName())) {
result.setNrLinesRead(result.getNrLinesRead()+ stepStatus.getLinesRead());
}
if (transMeta.getInputStep() !=null && stepStatus.getStepname().equals(transMeta.getInputStep().getName())) {
result.setNrLinesInput(result.getNrLinesInput() + stepStatus.getLinesInput());
}
if (transMeta.getWriteStep() !=null && stepStatus.getStepname().equals(transMeta.getWriteStep().getName())) {
result.setNrLinesWritten(result.getNrLinesWritten()+stepStatus.getLinesWritten());
}
if (transMeta.getOutputStep() !=null && stepStatus.getStepname().equals(transMeta.getOutputStep().getName())) {
result.setNrLinesOutput(result.getNrLinesOutput()+stepStatus.getLinesOutput());
}
if (transMeta.getUpdateStep() !=null && stepStatus.getStepname().equals(transMeta.getUpdateStep().getName())) {
result.setNrLinesUpdated(result.getNrLinesUpdated()+stepStatus.getLinesUpdated());
}
if (transMeta.getRejectedStep()!=null && stepStatus.getStepname().equals(transMeta.getRejectedStep().getName())) {
result.setNrLinesRejected(result.getNrLinesRejected()+stepStatus.getLinesRejected());
}
if (stepStatus.isStopped()) {
result.setStopped(true);
result.setResult(false);
}
}
return result;
}
示例3: execute
import org.pentaho.di.core.Result; //导入方法依赖的package包/类
/**
* Execute this job entry and return the result.
* In this case it means, just set the result boolean in the Result class.
* @param previousResult The result of the previous execution
* @return The Result of the execution.
*/
public Result execute(Result previousResult, int nr)
{
Result result = previousResult;
result.setNrErrors(0);
result.setResult(true);
return result;
}
示例4: execute
import org.pentaho.di.core.Result; //导入方法依赖的package包/类
public Result execute(Result previousResult, int nr)
{
Result result = previousResult;
result.setResult( true );
String realxmlfilename = getRealxmlfilename();
String realDTDfilename = getRealDTDfilename();
// Define a new DTD validator instance
DTDValidator validator = new DTDValidator(log);
// Set XML filename
validator.setXMLFilename(realxmlfilename);
if(dtdintern) {
// The DTD is intern to XML file
validator.setInternDTD(true);
} else {
// The DTD is extern
// set the DTD filename
validator.setDTDFilename(realDTDfilename);
}
// Validate the XML file and return the status
boolean status = validator.validate();
if(!status) {
// The XML file is invalid!
log.logError(validator.getErrorMessage());
result.setResult( false );
result.setNrErrors(validator.getNrErrors());
result.setLogText(validator.getErrorMessage());
}
return result;
}
示例5: execute
import org.pentaho.di.core.Result; //导入方法依赖的package包/类
public Result execute(Result previousResult, int nr)
{
Result result = previousResult;
result.setResult( false );
if (filename!=null)
{
String realFilename = getRealFilename();
try
{
FileObject file = KettleVFS.getFileObject(realFilename, this);
if (file.exists() && file.isReadable())
{
logDetailed(BaseMessages.getString(PKG, "JobEntryFileExists.File_Exists", realFilename)); //$NON-NLS-1$
result.setResult( true );
}
else
{
logDetailed(BaseMessages.getString(PKG, "JobEntryFileExists.File_Does_Not_Exist", realFilename)); //$NON-NLS-1$
}
}
catch (Exception e)
{
result.setNrErrors(1);
logError(BaseMessages.getString(PKG, "JobEntryFileExists.ERROR_0004_IO_Exception", e.getMessage()), e); //$NON-NLS-1$
}
}
else
{
result.setNrErrors(1);
logError(BaseMessages.getString(PKG, "JobEntryFileExists.ERROR_0005_No_Filename_Defined")); //$NON-NLS-1$
}
return result;
}
示例6: execute
import org.pentaho.di.core.Result; //导入方法依赖的package包/类
public Result execute(Result result, int nr) throws KettleException {
List<RowMetaAndData> rows = result.getRows();
RowMetaAndData resultRow = null;
result.setNrErrors(1);
result.setResult(false);
NrErrors=0;
NrSuccess=0;
successConditionBroken=false;
successConditionBrokenExit=false;
limitFolders=Const.toInt(environmentSubstitute(getLimitFolders()),10);
if (argFromPrevious) {
if(log.isDetailed())
logDetailed(BaseMessages.getString(PKG, "JobEntryDeleteFolders.FoundPreviousRows", String.valueOf((rows != null ? rows.size() : 0)))); //$NON-NLS-1$
}
if (argFromPrevious && rows != null){
for (int iteration = 0; iteration < rows.size() && !parentJob.isStopped(); iteration++) {
if(successConditionBroken){
logError(BaseMessages.getString(PKG, "JobEntryDeleteFolders.Error.SuccessConditionbroken",""+NrErrors));
result.setNrErrors(NrErrors);
result.setNrLinesDeleted(NrSuccess);
return result;
}
resultRow = rows.get(iteration);
String args_previous = resultRow.getString(0, null);
if(!Const.isEmpty(args_previous)){
if(deleteFolder(args_previous)){
updateSuccess();
}else {
updateErrors();
}
}else{
// empty filename !
logError(BaseMessages.getString(PKG, "JobEntryDeleteFolders.Error.EmptyLine"));
}
}
} else if (arguments != null) {
for (int i = 0; i < arguments.length && !parentJob.isStopped(); i++) {
if(successConditionBroken)
{
logError(BaseMessages.getString(PKG, "JobEntryDeleteFolders.Error.SuccessConditionbroken",""+NrErrors));
result.setNrErrors(NrErrors);
result.setNrLinesDeleted(NrSuccess);
return result;
}
String realfilename=environmentSubstitute(arguments[i]);
if(!Const.isEmpty(realfilename))
{
if(deleteFolder(realfilename)){
updateSuccess();
}else {
updateErrors();
}
}else{
// empty filename !
logError(BaseMessages.getString(PKG, "JobEntryDeleteFolders.Error.EmptyLine"));
}
}
}
if(log.isDetailed()){
logDetailed("=======================================");
logDetailed(BaseMessages.getString(PKG, "JobEntryDeleteFolders.Log.Info.NrError","" + NrErrors));
logDetailed(BaseMessages.getString(PKG, "JobEntryDeleteFolders.Log.Info.NrDeletedFolders","" + NrSuccess));
logDetailed("=======================================");
}
result.setNrErrors(NrErrors);
result.setNrLinesDeleted(NrSuccess);
if(getSuccessStatus()) result.setResult(true);
return result;
}
示例7: execute
import org.pentaho.di.core.Result; //导入方法依赖的package包/类
public Result execute(Result previousResult, int nr)
{
Result result = previousResult;
List<RowMetaAndData> rows = result.getRows();
RowMetaAndData resultRow = null;
result.setResult( false );
NrErrors=0;
NrSuccess=0;
NrFilesToProcess=0;
continueProcessing=true;
limitFiles=Const.toInt(environmentSubstitute(getLimit()),10);
// Get source and destination files, also wildcard
String vsourceFilefolder[] = source_filefolder;
String vsourceWildcard[] = source_wildcard;
String vsourceDelimiter[] = delimiter;
String targetDb[] = target_Db;
String targetTable[] = target_table;
try
{
if (is_args_from_previous){
if (log.isDetailed())
logDetailed(BaseMessages.getString(PKG, "JobEntryMSAccessBulkLoad.Log.ArgFromPrevious.Found",(rows!=null?rows.size():0)+ ""));
}
if (is_args_from_previous && rows!=null){
for (int iteration=0;iteration<rows.size() && !parentJob.isStopped() && continueProcessing;iteration++) {
resultRow = rows.get(iteration);
// Get source and destination file names, also wildcard
String vSourceFileFolder_previous = resultRow.getString(0,null);
String vSourceWildcard_previous = resultRow.getString(1,null);
String vDelimiter_previous = resultRow.getString(2,null);
String vTargetDb_previous = resultRow.getString(3,null);
String vTargetTable_previous = resultRow.getString(4,null);
processOneRow(vSourceFileFolder_previous, vSourceWildcard_previous,vDelimiter_previous,
vTargetDb_previous, vTargetTable_previous, parentJob,result);
}
}
else if(vsourceFilefolder!=null && targetDb!=null && targetTable!=null)
{
for (int i=0;i<vsourceFilefolder.length && !parentJob.isStopped() && continueProcessing;i++)
{
// get real values
String realSourceFileFolder=environmentSubstitute(vsourceFilefolder[i]);
String realSourceWildcard=environmentSubstitute(vsourceWildcard[i]);
String realSourceDelimiter=environmentSubstitute(vsourceDelimiter[i]);
String realTargetDb=environmentSubstitute(targetDb[i]);
String realTargetTable=environmentSubstitute(targetTable[i]);
processOneRow(realSourceFileFolder, realSourceWildcard,realSourceDelimiter,
realTargetDb, realTargetTable, parentJob,result);
}
}
}
catch ( Exception e ){
incrErrors();
logError(BaseMessages.getString(PKG, "JobEntryMSAccessBulkLoad.UnexpectedError",e.getMessage()));
}
// Success Condition
result.setNrErrors(NrErrors);
result.setNrLinesInput(NrFilesToProcess);
result.setNrLinesWritten(NrSuccess);
if(getSuccessStatus()) result.setResult(true);
displayResults();
return result;
}
示例8: execute
import org.pentaho.di.core.Result; //导入方法依赖的package包/类
public Result execute(Result previousResult, int nr) throws KettleException
{
Result result = previousResult;
result.setResult(false);
if (filename != null)
{
String realFilename = getRealFilename();
FileObject fileObject = null;
try
{
fileObject = KettleVFS.getFileObject(realFilename, this);
if (fileObject.exists())
{
if (isFailIfFileExists())
{
// File exists and fail flag is on.
result.setResult(false);
logError("File [" + realFilename + "] exists, failing.");
} else
{
// File already exists, no reason to try to create it
result.setResult(true);
logBasic("File [" + realFilename + "] already exists, not recreating.");
}
// add filename to result filenames if needed
if(isAddFilenameToResult()) {
addFilenameToResult(realFilename,result, parentJob);
}
} else
{
// No file yet, create an empty file.
fileObject.createFile();
logBasic("File [" + realFilename + "] created!");
// add filename to result filenames if needed
if(isAddFilenameToResult())
addFilenameToResult(realFilename,result, parentJob);
result.setResult(true);
}
} catch (IOException e)
{
logError("Could not create file [" + realFilename + "], exception: " + e.getMessage());
result.setResult(false);
result.setNrErrors(1);
} finally
{
if (fileObject != null)
{
try
{
fileObject.close();
fileObject=null;
} catch (IOException ex)
{
}
;
}
}
} else
{
logError("No filename is defined.");
}
return result;
}
示例9: evaluate
import org.pentaho.di.core.Result; //导入方法依赖的package包/类
/**
* Output message to job log.
*/
public boolean evaluate(Result result)
{
LogWriter log = LogWriter.getInstance();
try
{
loglevel=loglevel+1;
if (loglevel==LogWriter.LOG_LEVEL_ERROR)
{
// Output message to log
// Log level = ERREUR
log.logError(Const.CR + getRealLogSubject()+ Const.CR, getRealLogMessage()+ Const.CR);
}
else if (loglevel==LogWriter.LOG_LEVEL_MINIMAL)
{
// Output message to log
// Log level = MINIMAL
log.logMinimal(Const.CR + getRealLogSubject()+ Const.CR, getRealLogMessage()+ Const.CR);
}
else if (loglevel==LogWriter.LOG_LEVEL_BASIC)
{
// Output message to log
// Log level = BASIC
log.logBasic(Const.CR + getRealLogSubject()+ Const.CR, getRealLogMessage()+ Const.CR);
}
else if (loglevel==LogWriter.LOG_LEVEL_DETAILED)
{
// Output message to log
// Log level = DETAILED
log.logDetailed(Const.CR + getRealLogSubject()+ Const.CR, getRealLogMessage()+ Const.CR);
}
else if (loglevel==LogWriter.LOG_LEVEL_DEBUG)
{
// Output message to log
// Log level = DEBUG
log.logDebug(Const.CR + getRealLogSubject()+ Const.CR, getRealLogMessage()+ Const.CR);
}
else if (loglevel==LogWriter.LOG_LEVEL_ROWLEVEL)
{
// Output message to log
// Log level = ROWLEVEL
log.logRowlevel(Const.CR + getRealLogSubject()+ Const.CR, getRealLogMessage()+ Const.CR);
}
return true;
}
catch(Exception e)
{
result.setNrErrors(1);
log.logError(Messages.getString("WriteToLog.Error.Label"), Messages.getString("WriteToLog.Error.Description") + " : "+e.toString());
return false;
}
}
示例10: execute
import org.pentaho.di.core.Result; //导入方法依赖的package包/类
/**
* Execute this job entry and return the result.
* In this case it means, just set the result boolean in the Result class.
* @param previousResult The result of the previous execution
* @return The Result of the execution.
*/
public Result execute(Result previousResult, int nr, Repository rep, Job parentJob)
{
Result result = previousResult;
result.setNrErrors(1);
result.setResult(false);
LogWriter log = LogWriter.getInstance();
String realEmailAddress=environmentSubstitute(emailAddress);
if(Const.isEmpty(realEmailAddress))
{
log.logError(toString(),Messages.getString("JobEntryMailValidator.Error.EmailEmpty"));
return result;
}
String realSender=environmentSubstitute(emailSender);
if(smtpCheck)
{
// check sender
if(Const.isEmpty(realSender))
{
log.logError(toString(),Messages.getString("JobEntryMailValidator.Error.EmailSenderEmpty"));
return result;
}
}
String realDefaultSMTP=environmentSubstitute(defaultSMTP);
int timeOut=Const.toInt(environmentSubstitute(timeout), 0);
// Split the mail-address: separated by space
String mailsCheck[] = realEmailAddress.split(" ");
boolean exitloop=false;
boolean mailIsValid=false;
String MailError=null;
for (int i = 0; i < mailsCheck.length && !exitloop; i++)
{
String email = mailsCheck[i];
if(log.isDetailed())
log.logDetailed(toString(), Messages.getString("JobEntryMailValidator.CheckingMail",email));
// Check if address is valid
MailValidationResult resultValidator=MailValidation.isAddressValid(email,
realSender, realDefaultSMTP,timeOut,smtpCheck);
mailIsValid=resultValidator.isValide();
MailError=resultValidator.getErrorMessage();
if(log.isDetailed())
{
if(mailIsValid)
log.logDetailed(toString(), Messages.getString("JobEntryMailValidator.MailValid",email));
else
{
log.logDetailed(toString(), Messages.getString("JobEntryMailValidator.MailNotValid",email));
log.logDetailed(toString(), MailError);
}
}
// invalid mail? exit loop
if(!resultValidator.isValide()) exitloop=true;
}
result.setResult(mailIsValid);
if(mailIsValid) result.setNrErrors(0);
// return result
return result;
}
示例11: execute
import org.pentaho.di.core.Result; //导入方法依赖的package包/类
/**
* Execute this job entry and return the result.
* In this case it means, just set the result boolean in the Result class.
* @param previousResult The result of the previous execution
* @return The Result of the execution.
*/
public Result execute(Result previousResult, int nr)
{
Result result = previousResult;
result.setNrErrors(1);
result.setResult(false);
String realEmailAddress=environmentSubstitute(emailAddress);
if(Const.isEmpty(realEmailAddress))
{
logError(BaseMessages.getString(PKG, "JobEntryMailValidator.Error.EmailEmpty"));
return result;
}
String realSender=environmentSubstitute(emailSender);
if(smtpCheck)
{
// check sender
if(Const.isEmpty(realSender))
{
logError(BaseMessages.getString(PKG, "JobEntryMailValidator.Error.EmailSenderEmpty"));
return result;
}
}
String realDefaultSMTP=environmentSubstitute(defaultSMTP);
int timeOut=Const.toInt(environmentSubstitute(timeout), 0);
// Split the mail-address: separated by space
String mailsCheck[] = realEmailAddress.split(" ");
boolean exitloop=false;
boolean mailIsValid=false;
String MailError=null;
for (int i = 0; i < mailsCheck.length && !exitloop; i++)
{
String email = mailsCheck[i];
if(log.isDetailed())
logDetailed(BaseMessages.getString(PKG, "JobEntryMailValidator.CheckingMail",email));
// Check if address is valid
MailValidationResult resultValidator=MailValidation.isAddressValid(log, email, realSender, realDefaultSMTP,timeOut,smtpCheck);
mailIsValid=resultValidator.isValide();
MailError=resultValidator.getErrorMessage();
if(log.isDetailed())
{
if(mailIsValid)
logDetailed(BaseMessages.getString(PKG, "JobEntryMailValidator.MailValid",email));
else
{
logDetailed(BaseMessages.getString(PKG, "JobEntryMailValidator.MailNotValid",email));
logDetailed(MailError);
}
}
// invalid mail? exit loop
if(!resultValidator.isValide()) exitloop=true;
}
result.setResult(mailIsValid);
if(mailIsValid) result.setNrErrors(0);
// return result
return result;
}
示例12: execute
import org.pentaho.di.core.Result; //导入方法依赖的package包/类
public Result execute(Result previousResult, int nr, Repository rep, Job parentJob) throws KettleException
{
LogWriter log = LogWriter.getInstance();
Result result = previousResult;
result.setResult(false);
if (filename != null)
{
String realFilename = getRealFilename();
FileObject fileObject = null;
try
{
fileObject = KettleVFS.getFileObject(realFilename);
if (fileObject.exists())
{
if (isFailIfFileExists())
{
// File exists and fail flag is on.
result.setResult(false);
log.logError(toString(), "File [" + realFilename + "] exists, failing.");
} else
{
// File already exists, no reason to try to create it
result.setResult(true);
log.logBasic(toString(), "File [" + realFilename + "] already exists, not recreating.");
}
// add filename to result filenames if needed
if(isAddFilenameToResult())
addFilenameToResult(realFilename,log,result, parentJob);
} else
{
// No file yet, create an empty file.
fileObject.createFile();
log.logBasic(toString(), "File [" + realFilename + "] created!");
// add filename to result filenames if needed
if(isAddFilenameToResult())
addFilenameToResult(realFilename,log,result, parentJob);
result.setResult(true);
}
} catch (IOException e)
{
log.logError(toString(), "Could not create file [" + realFilename + "], exception: " + e.getMessage());
result.setResult(false);
result.setNrErrors(1);
} finally
{
if (fileObject != null)
{
try
{
fileObject.close();
} catch (IOException ex)
{
}
;
}
}
} else
{
log.logError(toString(), "No filename is defined.");
}
return result;
}
示例13: execute
import org.pentaho.di.core.Result; //导入方法依赖的package包/类
public Result execute(Result previousResult, int nr)
{
Result result = previousResult;
result.setNrErrors(1);
result.setResult( false );
String servername=environmentSubstitute(getServerName());
if(Const.isEmpty(servername)) {
logError(BaseMessages.getString(PKG, "JobEntrySyslog.MissingServerName"));
}
String messageString=environmentSubstitute(getMessage());
if(Const.isEmpty(messageString)) {
logError(BaseMessages.getString(PKG, "JobEntrySyslog.MissingMessage"));
}
int nrPort=Const.toInt(environmentSubstitute(getPort()), SyslogDefs.DEFAULT_PORT);
SyslogIF syslog=null;
try {
String pattern=null;
if(isAddTimestamp()) {
// add timestamp to message
pattern= environmentSubstitute(getDatePattern());
if(Const.isEmpty(pattern)) {
logError(BaseMessages.getString(PKG, "JobEntrySyslog.DatePatternEmpty"));
throw new KettleException(BaseMessages.getString(PKG, "JobEntrySyslog.DatePatternEmpty"));
}
}
// Open syslog connection
// Set a Specific Host, then Log to It
syslog = Syslog.getInstance("udp");
syslog.getConfig().setHost(servername);
syslog.getConfig().setPort(nrPort);
syslog.getConfig().setFacility(getFacility());
syslog.getConfig().setSendLocalName(false);
syslog.getConfig().setSendLocalTimestamp(false);
SyslogDefs.sendMessage(syslog, SyslogDefs.getPriority(getPriority()),
messageString, isAddTimestamp(), pattern, isAddHostName());
// message was sent
result.setNrErrors(0);
result.setResult(true);
} catch(Exception e){
logError(BaseMessages.getString(PKG, "JobEntrySyslog.ErrorSendingMessage", e.toString())); //$NON-NLS-1$
} finally{
if(syslog!=null) syslog.shutdown();
}
return result;
}
示例14: execute
import org.pentaho.di.core.Result; //导入方法依赖的package包/类
public Result execute(Result previousResult, int nr)
{
Result result = previousResult;
result.setResult( false );
if (filename!=null)
{
String realFilename = getRealFilename();
FileObject fileObject = null;
try {
fileObject = KettleVFS.getFileObject(realFilename, this);
if ( ! fileObject.exists() )
{
if ( isFailIfFileNotExists() )
{
// File doesn't exist and fail flag is on.
result.setResult( false );
logError(BaseMessages.getString(PKG, "JobEntryDeleteFile.ERROR_0004_File_Does_Not_Exist", realFilename)); //$NON-NLS-1$
}
else
{
// File already deleted, no reason to try to delete it
result.setResult( true );
if(log.isBasic()) logBasic(BaseMessages.getString(PKG, "JobEntryDeleteFile.File_Already_Deleted", realFilename)); //$NON-NLS-1$
}
}
else
{
boolean deleted = fileObject.delete();
if ( ! deleted )
{
logError(BaseMessages.getString(PKG, "JobEntryDeleteFile.ERROR_0005_Could_Not_Delete_File", realFilename)); //$NON-NLS-1$
result.setResult( false );
result.setNrErrors(1);
}
if(log.isBasic()) logBasic(BaseMessages.getString(PKG, "JobEntryDeleteFile.File_Deleted", realFilename)); //$NON-NLS-1$
result.setResult( true );
}
}
catch (Exception e) {
logError(BaseMessages.getString(PKG, "JobEntryDeleteFile.ERROR_0006_Exception_Deleting_File", realFilename, e.getMessage()), e); //$NON-NLS-1$
result.setResult( false );
result.setNrErrors(1);
}
finally {
if ( fileObject != null )
{
try {
fileObject.close();
fileObject=null;
}
catch ( IOException ex ) {};
}
}
}
else
{
logError(BaseMessages.getString(PKG, "JobEntryDeleteFile.ERROR_0007_No_Filename_Is_Defined")); //$NON-NLS-1$
}
return result;
}
示例15: execute
import org.pentaho.di.core.Result; //导入方法依赖的package包/类
public Result execute(Result previousResult, int nr)
{
Result result = previousResult;
result.setResult(false);
result.setNrErrors(1);
int nrexistcolums=0;
int nrnotexistcolums=0;
if(Const.isEmpty(tablename))
{
logError(BaseMessages.getString(PKG, "JobEntryColumnsExist.Error.TablenameEmpty"));
return result;
}
if(arguments == null)
{
logError(BaseMessages.getString(PKG, "JobEntryColumnsExist.Error.ColumnameEmpty"));
return result;
}
if (connection!=null)
{
Database db = new Database(this, connection);
db.shareVariablesWith(this);
try
{
String realSchemaname = environmentSubstitute(schemaname);
String realTablename = environmentSubstitute(tablename);
if(!Const.isEmpty(realSchemaname))
realTablename = db.getDatabaseMeta().getQuotedSchemaTableCombination(realSchemaname, realTablename);
else
realTablename = db.getDatabaseMeta().quoteField(realTablename);
db.connect();
if (db.checkTableExists(realTablename))
{
if(log.isDetailed()) logDetailed(BaseMessages.getString(PKG, "JobEntryColumnsExist.Log.TableExists",realTablename));
for (int i = 0; i < arguments.length && !parentJob.isStopped(); i++)
{
String realColumnname = environmentSubstitute(arguments[i]);
realColumnname=db.getDatabaseMeta().quoteField(realColumnname);
if (db.checkColumnExists(realColumnname,realTablename))
{
if(log.isDetailed()) logDetailed(BaseMessages.getString(PKG, "JobEntryColumnsExist.Log.ColumnExists",realColumnname,realTablename));
nrexistcolums++;
}else
{
logError(BaseMessages.getString(PKG, "JobEntryColumnsExist.Log.ColumnNotExists",realColumnname,realTablename));
nrnotexistcolums++;
}
}
}
else
{
logError(BaseMessages.getString(PKG, "JobEntryColumnsExist.Log.TableNotExists",realTablename));
}
}
catch(KettleDatabaseException dbe)
{
logError(BaseMessages.getString(PKG, "JobEntryColumnsExist.Error.UnexpectedError",dbe.getMessage()));
}finally
{
if(db!=null) try{db.disconnect();}catch(Exception e){};
}
}
else
{
logError(BaseMessages.getString(PKG, "JobEntryColumnsExist.Error.NoDbConnection"));
}
result.setEntryNr(nrnotexistcolums);
result.setNrLinesWritten(nrexistcolums);
if(nrnotexistcolums==0) result.setResult(true);
return result;
}