use of org.pentaho.di.core.CheckResult in project pentaho-kettle by pentaho.
the class FormulaMeta method check.
/**
* Checks the settings of this step and puts the findings in a remarks List.
*
* @param remarks
* The list to put the remarks in @see org.pentaho.di.core.CheckResult
* @param stepMeta
* The stepMeta to help checking
* @param prev
* The fields coming from the previous step
* @param input
* The input step names
* @param output
* The output step names
* @param info
* The fields that are used as information by the step
*/
public void check(List<CheckResultInterface> remarks, TransMeta transMeta, StepMeta stepMeta, RowMetaInterface prev, String[] input, String[] output, RowMetaInterface info, VariableSpace space, Repository repository, IMetaStore metaStore) {
CheckResult cr;
if (prev == null || prev.size() == 0) {
cr = new CheckResult(CheckResult.TYPE_RESULT_WARNING, BaseMessages.getString(PKG, "FormulaMeta.CheckResult.ExpectedInputError"), stepMeta);
remarks.add(cr);
} else {
cr = new CheckResult(CheckResult.TYPE_RESULT_OK, BaseMessages.getString(PKG, "FormulaMeta.CheckResult.FieldsReceived", "" + prev.size()), stepMeta);
remarks.add(cr);
}
// See if we have input streams leading to this step!
if (input.length > 0) {
cr = new CheckResult(CheckResult.TYPE_RESULT_OK, BaseMessages.getString(PKG, "FormulaMeta.CheckResult.ExpectedInputOk"), stepMeta);
remarks.add(cr);
} else {
cr = new CheckResult(CheckResult.TYPE_RESULT_ERROR, BaseMessages.getString(PKG, "FormulaMeta.CheckResult.ExpectedInputError"), stepMeta);
remarks.add(cr);
}
}
use of org.pentaho.di.core.CheckResult in project pentaho-kettle by pentaho.
the class FuzzyMatchMeta method check.
public void check(List<CheckResultInterface> remarks, TransMeta transMeta, StepMeta stepMeta, RowMetaInterface prev, String[] input, String[] output, RowMetaInterface info, VariableSpace space, Repository repository, IMetaStore metaStore) {
CheckResult cr;
if (prev != null && prev.size() > 0) {
cr = new CheckResult(CheckResult.TYPE_RESULT_OK, BaseMessages.getString(PKG, "FuzzyMatchMeta.CheckResult.StepReceivingFields", prev.size() + ""), stepMeta);
remarks.add(cr);
// Starting from selected fields in ...
// Check the fields from the previous stream!
String mainField = transMeta.environmentSubstitute(getMainStreamField());
int idx = prev.indexOfValue(mainField);
if (idx < 0) {
cr = new CheckResult(CheckResult.TYPE_RESULT_ERROR, BaseMessages.getString(PKG, "FuzzyMatchMeta.CheckResult.MainFieldNotFound", mainField), stepMeta);
} else {
cr = new CheckResult(CheckResult.TYPE_RESULT_OK, BaseMessages.getString(PKG, "FuzzyMatchMeta.CheckResult.MainFieldFound", mainField), stepMeta);
}
remarks.add(cr);
} else {
cr = new CheckResult(CheckResult.TYPE_RESULT_ERROR, BaseMessages.getString(PKG, "FuzzyMatchMeta.CheckResult.CouldNotFindFieldsFromPreviousSteps"), stepMeta);
remarks.add(cr);
}
if (info != null && info.size() > 0) {
cr = new CheckResult(CheckResult.TYPE_RESULT_OK, BaseMessages.getString(PKG, "FuzzyMatchMeta.CheckResult.StepReceivingLookupData", info.size() + ""), stepMeta);
remarks.add(cr);
// Check the fields from the lookup stream!
String lookupField = transMeta.environmentSubstitute(getLookupField());
int idx = info.indexOfValue(lookupField);
if (idx < 0) {
cr = new CheckResult(CheckResult.TYPE_RESULT_ERROR, BaseMessages.getString(PKG, "FuzzyMatchMeta.CheckResult.FieldNotFoundInLookupStream", lookupField), stepMeta);
} else {
cr = new CheckResult(CheckResult.TYPE_RESULT_OK, BaseMessages.getString(PKG, "FuzzyMatchMeta.CheckResult.FieldFoundInTheLookupStream", lookupField), stepMeta);
}
remarks.add(cr);
String error_message = "";
boolean error_found = false;
// Check the values to retrieve from the lookup stream!
for (int i = 0; i < value.length; i++) {
idx = info.indexOfValue(value[i]);
if (idx < 0) {
error_message += "\t\t" + value[i] + Const.CR;
error_found = true;
}
}
if (error_found) {
error_message = BaseMessages.getString(PKG, "FuzzyMatchMeta.CheckResult.FieldsNotFoundInLookupStream2") + Const.CR + Const.CR + error_message;
cr = new CheckResult(CheckResultInterface.TYPE_RESULT_ERROR, error_message, stepMeta);
} else {
cr = new CheckResult(CheckResultInterface.TYPE_RESULT_OK, BaseMessages.getString(PKG, "FuzzyMatchMeta.CheckResult.AllFieldsFoundInTheLookupStream2"), stepMeta);
}
remarks.add(cr);
} else {
cr = new CheckResult(CheckResult.TYPE_RESULT_ERROR, BaseMessages.getString(PKG, "FuzzyMatchMeta.CheckResult.FieldsNotFoundFromInLookupSep"), stepMeta);
remarks.add(cr);
}
// See if the source step is filled in!
StreamInterface infoStream = getStepIOMeta().getInfoStreams().get(0);
if (infoStream.getStepMeta() == null) {
cr = new CheckResult(CheckResult.TYPE_RESULT_ERROR, BaseMessages.getString(PKG, "FuzzyMatchMeta.CheckResult.SourceStepNotSelected"), stepMeta);
remarks.add(cr);
} else {
cr = new CheckResult(CheckResult.TYPE_RESULT_OK, BaseMessages.getString(PKG, "FuzzyMatchMeta.CheckResult.SourceStepIsSelected"), stepMeta);
remarks.add(cr);
//
if (info != null) {
cr = new CheckResult(CheckResult.TYPE_RESULT_OK, BaseMessages.getString(PKG, "FuzzyMatchMeta.CheckResult.SourceStepExist", infoStream.getStepname() + ""), stepMeta);
remarks.add(cr);
} else {
cr = new CheckResult(CheckResult.TYPE_RESULT_ERROR, BaseMessages.getString(PKG, "FuzzyMatchMeta.CheckResult.SourceStepDoesNotExist", infoStream.getStepname() + ""), stepMeta);
remarks.add(cr);
}
}
// See if we have input streams leading to this step!
if (input.length >= 2) {
cr = new CheckResult(CheckResult.TYPE_RESULT_OK, BaseMessages.getString(PKG, "FuzzyMatchMeta.CheckResult.StepReceivingInfoFromInputSteps", input.length + ""), stepMeta);
remarks.add(cr);
} else {
cr = new CheckResult(CheckResult.TYPE_RESULT_ERROR, BaseMessages.getString(PKG, "FuzzyMatchMeta.CheckResult.NeedAtLeast2InputStreams", Const.CR, Const.CR), stepMeta);
remarks.add(cr);
}
}
use of org.pentaho.di.core.CheckResult in project pentaho-kettle by pentaho.
the class GetSlaveSequenceMeta method check.
@Override
public void check(List<CheckResultInterface> remarks, TransMeta transMeta, StepMeta stepMeta, RowMetaInterface prev, String[] input, String[] output, RowMetaInterface info, VariableSpace space, Repository repository, IMetaStore metaStore) {
CheckResult cr;
if (input.length > 0) {
cr = new CheckResult(CheckResultInterface.TYPE_RESULT_OK, BaseMessages.getString(PKG, "GetSequenceMeta.CheckResult.StepIsReceving.Title"), stepMeta);
remarks.add(cr);
} else {
cr = new CheckResult(CheckResultInterface.TYPE_RESULT_ERROR, BaseMessages.getString(PKG, "GetSequenceMeta.CheckResult.NoInputReceived.Title"), stepMeta);
remarks.add(cr);
}
}
use of org.pentaho.di.core.CheckResult in project pentaho-kettle by pentaho.
the class GetSubFoldersMeta method check.
public void check(List<CheckResultInterface> remarks, TransMeta transMeta, StepMeta stepMeta, RowMetaInterface prev, String[] input, String[] output, RowMetaInterface info, VariableSpace space, Repository repository, IMetaStore metaStore) {
CheckResult cr;
// See if we get input...
if (isFoldernameDynamic) {
if (input.length > 0) {
cr = new CheckResult(CheckResultInterface.TYPE_RESULT_OK, BaseMessages.getString(PKG, "GetSubFoldersMeta.CheckResult.InputOk"), stepMeta);
} else {
cr = new CheckResult(CheckResultInterface.TYPE_RESULT_ERROR, BaseMessages.getString(PKG, "GetSubFoldersMeta.CheckResult.InputErrorKo"), stepMeta);
}
remarks.add(cr);
if (Utils.isEmpty(dynamicFoldernameField)) {
cr = new CheckResult(CheckResultInterface.TYPE_RESULT_ERROR, BaseMessages.getString(PKG, "GetSubFoldersMeta.CheckResult.FolderFieldnameMissing"), stepMeta);
} else {
cr = new CheckResult(CheckResultInterface.TYPE_RESULT_OK, BaseMessages.getString(PKG, "GetSubFoldersMeta.CheckResult.FolderFieldnameOk"), stepMeta);
}
remarks.add(cr);
} else {
if (input.length > 0) {
cr = new CheckResult(CheckResultInterface.TYPE_RESULT_ERROR, BaseMessages.getString(PKG, "GetSubFoldersMeta.CheckResult.NoInputError"), stepMeta);
} else {
cr = new CheckResult(CheckResultInterface.TYPE_RESULT_OK, BaseMessages.getString(PKG, "GetSubFoldersMeta.CheckResult.NoInputOk"), stepMeta);
}
remarks.add(cr);
// check specified folder names
FileInputList fileList = getFolderList(transMeta);
if (fileList.nrOfFiles() == 0) {
cr = new CheckResult(CheckResultInterface.TYPE_RESULT_ERROR, BaseMessages.getString(PKG, "GetSubFoldersMeta.CheckResult.ExpectedFoldersError"), stepMeta);
remarks.add(cr);
} else {
cr = new CheckResult(CheckResultInterface.TYPE_RESULT_OK, BaseMessages.getString(PKG, "GetSubFoldersMeta.CheckResult.ExpectedFilesOk", "" + fileList.nrOfFiles()), stepMeta);
remarks.add(cr);
}
}
}
use of org.pentaho.di.core.CheckResult in project pentaho-kettle by pentaho.
the class GroupByMeta method check.
@Override
public void check(List<CheckResultInterface> remarks, TransMeta transMeta, StepMeta stepMeta, RowMetaInterface prev, String[] input, String[] output, RowMetaInterface info, VariableSpace space, Repository repository, IMetaStore metaStore) {
CheckResult cr;
if (input.length > 0) {
cr = new CheckResult(CheckResultInterface.TYPE_RESULT_OK, BaseMessages.getString(PKG, "GroupByMeta.CheckResult.ReceivingInfoOK"), stepMeta);
remarks.add(cr);
} else {
cr = new CheckResult(CheckResultInterface.TYPE_RESULT_ERROR, BaseMessages.getString(PKG, "GroupByMeta.CheckResult.NoInputError"), stepMeta);
remarks.add(cr);
}
}
Aggregations