use of org.pentaho.di.core.CheckResult in project pentaho-kettle by pentaho.
the class BlockUntilStepsFinishMeta 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_WARNING, BaseMessages.getString(PKG, "BlockUntilStepsFinishMeta.CheckResult.NotReceivingFields"), stepMeta);
} else {
if (stepName.length > 0) {
cr = new CheckResult(CheckResult.TYPE_RESULT_OK, BaseMessages.getString(PKG, "BlockUntilStepsFinishMeta.CheckResult.AllStepsFound"), stepMeta);
} else {
cr = new CheckResult(CheckResult.TYPE_RESULT_WARNING, BaseMessages.getString(PKG, "BlockUntilStepsFinishMeta.CheckResult.NoStepsEntered"), 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, "BlockUntilStepsFinishMeta.CheckResult.StepRecevingData2"), stepMeta);
} else {
cr = new CheckResult(CheckResult.TYPE_RESULT_ERROR, BaseMessages.getString(PKG, "BlockUntilStepsFinishMeta.CheckResult.NoInputReceivedFromOtherSteps"), stepMeta);
}
remarks.add(cr);
}
use of org.pentaho.di.core.CheckResult in project pentaho-kettle by pentaho.
the class CsvInputMeta 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 (prev == null || prev.size() == 0) {
cr = new CheckResult(CheckResultInterface.TYPE_RESULT_OK, BaseMessages.getString(PKG, "CsvInputMeta.CheckResult.NotReceivingFields"), stepMeta);
remarks.add(cr);
} else {
cr = new CheckResult(CheckResultInterface.TYPE_RESULT_ERROR, BaseMessages.getString(PKG, "CsvInputMeta.CheckResult.StepRecevingData", prev.size() + ""), stepMeta);
remarks.add(cr);
}
// See if we have input streams leading to this step!
if (input.length > 0) {
cr = new CheckResult(CheckResultInterface.TYPE_RESULT_ERROR, BaseMessages.getString(PKG, "CsvInputMeta.CheckResult.StepRecevingData2"), stepMeta);
remarks.add(cr);
} else {
cr = new CheckResult(CheckResultInterface.TYPE_RESULT_OK, BaseMessages.getString(PKG, "CsvInputMeta.CheckResult.NoInputReceivedFromOtherSteps"), stepMeta);
remarks.add(cr);
}
}
use of org.pentaho.di.core.CheckResult in project pentaho-kettle by pentaho.
the class CubeOutputMeta 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;
// Check output fields
if (prev != null && prev.size() > 0) {
cr = new CheckResult(CheckResult.TYPE_RESULT_OK, BaseMessages.getString(PKG, "CubeOutputMeta.CheckResult.ReceivingFields", String.valueOf(prev.size())), stepMeta);
remarks.add(cr);
}
cr = new CheckResult(CheckResult.TYPE_RESULT_COMMENT, BaseMessages.getString(PKG, "CubeOutputMeta.CheckResult.FileSpecificationsNotChecked"), stepMeta);
remarks.add(cr);
}
use of org.pentaho.di.core.CheckResult in project pentaho-kettle by pentaho.
the class DBProcMeta 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;
String error_message = "";
if (database != null) {
Database db = new Database(transMeta, database);
try {
db.connect();
// Look up fields in the input stream <prev>
if (prev != null && prev.size() > 0) {
boolean first = true;
error_message = "";
boolean error_found = false;
for (int i = 0; i < argument.length; i++) {
ValueMetaInterface v = prev.searchValueMeta(argument[i]);
if (v == null) {
if (first) {
first = false;
error_message += BaseMessages.getString(PKG, "DBProcMeta.CheckResult.MissingArguments") + Const.CR;
}
error_found = true;
error_message += "\t\t" + argument[i] + Const.CR;
} else {
if (v.getType() != argumentType[i] && !(v.isNumeric() && ValueMetaBase.isNumeric(argumentType[i]))) {
error_found = true;
error_message += "\t\t" + argument[i] + BaseMessages.getString(PKG, "DBProcMeta.CheckResult.WrongTypeArguments", v.getTypeDesc(), ValueMetaFactory.getValueMetaName(argumentType[i])) + Const.CR;
}
}
}
if (error_found) {
cr = new CheckResult(CheckResultInterface.TYPE_RESULT_ERROR, error_message, stepMeta);
} else {
cr = new CheckResult(CheckResultInterface.TYPE_RESULT_OK, BaseMessages.getString(PKG, "DBProcMeta.CheckResult.AllArgumentsOK"), stepMeta);
}
remarks.add(cr);
} else {
error_message = BaseMessages.getString(PKG, "DBProcMeta.CheckResult.CouldNotReadFields") + Const.CR;
cr = new CheckResult(CheckResultInterface.TYPE_RESULT_ERROR, error_message, stepMeta);
remarks.add(cr);
}
} catch (KettleException e) {
error_message = BaseMessages.getString(PKG, "DBProcMeta.CheckResult.ErrorOccurred") + e.getMessage();
cr = new CheckResult(CheckResultInterface.TYPE_RESULT_ERROR, error_message, stepMeta);
remarks.add(cr);
}
} else {
error_message = BaseMessages.getString(PKG, "DBProcMeta.CheckResult.InvalidConnection");
cr = new CheckResult(CheckResultInterface.TYPE_RESULT_ERROR, error_message, stepMeta);
remarks.add(cr);
}
// See if we have input streams leading to this step!
if (input.length > 0) {
cr = new CheckResult(CheckResultInterface.TYPE_RESULT_OK, BaseMessages.getString(PKG, "DBProcMeta.CheckResult.ReceivingInfoFromOtherSteps"), stepMeta);
remarks.add(cr);
} else {
cr = new CheckResult(CheckResultInterface.TYPE_RESULT_ERROR, BaseMessages.getString(PKG, "DBProcMeta.CheckResult.NoInpuReceived"), stepMeta);
remarks.add(cr);
}
}
use of org.pentaho.di.core.CheckResult in project pentaho-kettle by pentaho.
the class DenormaliserMeta 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 (input.length > 0) {
cr = new CheckResult(CheckResult.TYPE_RESULT_OK, BaseMessages.getString(PKG, "DenormaliserMeta.CheckResult.ReceivingInfoFromOtherSteps"), stepMeta);
remarks.add(cr);
} else {
cr = new CheckResult(CheckResult.TYPE_RESULT_ERROR, BaseMessages.getString(PKG, "DenormaliserMeta.CheckResult.NoInputReceived"), stepMeta);
remarks.add(cr);
}
}
Aggregations