use of org.pentaho.di.core.CheckResult in project pentaho-kettle by pentaho.
the class ZipFileMeta 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 = "";
// source filename
if (Utils.isEmpty(sourcefilenamefield)) {
error_message = BaseMessages.getString(PKG, "ZipFileMeta.CheckResult.SourceFileFieldMissing");
cr = new CheckResult(CheckResult.TYPE_RESULT_ERROR, error_message, stepMeta);
remarks.add(cr);
} else {
error_message = BaseMessages.getString(PKG, "ZipFileMeta.CheckResult.TargetFileFieldOK");
cr = new CheckResult(CheckResult.TYPE_RESULT_OK, error_message, 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, "ZipFileMeta.CheckResult.ReceivingInfoFromOtherSteps"), stepMeta);
remarks.add(cr);
} else {
cr = new CheckResult(CheckResult.TYPE_RESULT_ERROR, BaseMessages.getString(PKG, "ZipFileMeta.CheckResult.NoInpuReceived"), stepMeta);
remarks.add(cr);
}
}
use of org.pentaho.di.core.CheckResult in project pentaho-kettle by pentaho.
the class StepMetastructureMeta 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;
cr = new CheckResult(CheckResultInterface.TYPE_RESULT_OK, "Not implemented", stepMeta);
remarks.add(cr);
}
use of org.pentaho.di.core.CheckResult in project pentaho-kettle by pentaho.
the class StepsMetricsMeta 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, "StepsMetricsMeta.CheckResult.NotReceivingFields"), stepMeta);
remarks.add(cr);
if (stepName.length > 0) {
cr = new CheckResult(CheckResult.TYPE_RESULT_OK, BaseMessages.getString(PKG, "StepsMetricsMeta.CheckResult.AllStepsFound"), stepMeta);
} else {
cr = new CheckResult(CheckResult.TYPE_RESULT_WARNING, BaseMessages.getString(PKG, "StepsMetricsMeta.CheckResult.NoStepsEntered"), stepMeta);
}
remarks.add(cr);
} else {
cr = new CheckResult(CheckResult.TYPE_RESULT_ERROR, BaseMessages.getString(PKG, "StepsMetricsMeta.CheckResult.ReceivingFields"), 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, "StepsMetricsMeta.CheckResult.StepRecevingData2"), stepMeta);
} else {
cr = new CheckResult(CheckResult.TYPE_RESULT_ERROR, BaseMessages.getString(PKG, "StepsMetricsMeta.CheckResult.NoInputReceivedFromOtherSteps"), stepMeta);
}
remarks.add(cr);
}
use of org.pentaho.di.core.CheckResult in project pentaho-kettle by pentaho.
the class StringCutMeta method check.
public void check(List<CheckResultInterface> remarks, TransMeta transMeta, StepMeta stepinfo, RowMetaInterface prev, String[] input, String[] output, RowMetaInterface info, VariableSpace space, Repository repository, IMetaStore metaStore) {
CheckResult cr;
String error_message = "";
boolean first = true;
boolean error_found = false;
if (prev == null) {
error_message += BaseMessages.getString(PKG, "StringCutMeta.CheckResult.NoInputReceived") + Const.CR;
cr = new CheckResult(CheckResult.TYPE_RESULT_ERROR, error_message, stepinfo);
remarks.add(cr);
} else {
for (int i = 0; i < fieldInStream.length; i++) {
String field = fieldInStream[i];
ValueMetaInterface v = prev.searchValueMeta(field);
if (v == null) {
if (first) {
first = false;
error_message += BaseMessages.getString(PKG, "StringCutMeta.CheckResult.MissingInStreamFields") + Const.CR;
}
error_found = true;
error_message += "\t\t" + field + Const.CR;
}
}
if (error_found) {
cr = new CheckResult(CheckResult.TYPE_RESULT_ERROR, error_message, stepinfo);
} else {
cr = new CheckResult(CheckResult.TYPE_RESULT_OK, BaseMessages.getString(PKG, "StringCutMeta.CheckResult.FoundInStreamFields"), stepinfo);
}
remarks.add(cr);
// Check whether all are strings
first = true;
error_found = false;
for (int i = 0; i < fieldInStream.length; i++) {
String field = fieldInStream[i];
ValueMetaInterface v = prev.searchValueMeta(field);
if (v != null) {
if (v.getType() != ValueMetaInterface.TYPE_STRING) {
if (first) {
first = false;
error_message += BaseMessages.getString(PKG, "StringCutMeta.CheckResult.OperationOnNonStringFields") + Const.CR;
}
error_found = true;
error_message += "\t\t" + field + Const.CR;
}
}
}
if (error_found) {
cr = new CheckResult(CheckResult.TYPE_RESULT_ERROR, error_message, stepinfo);
} else {
cr = new CheckResult(CheckResult.TYPE_RESULT_OK, BaseMessages.getString(PKG, "StringCutMeta.CheckResult.AllOperationsOnStringFields"), stepinfo);
}
remarks.add(cr);
if (fieldInStream.length > 0) {
for (int idx = 0; idx < fieldInStream.length; idx++) {
if (Utils.isEmpty(fieldInStream[idx])) {
cr = new CheckResult(CheckResult.TYPE_RESULT_ERROR, BaseMessages.getString(PKG, "StringCutMeta.CheckResult.InStreamFieldMissing", new Integer(idx + 1).toString()), stepinfo);
remarks.add(cr);
}
}
}
}
}
use of org.pentaho.di.core.CheckResult in project pentaho-kettle by pentaho.
the class SwitchCaseMeta 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;
StepIOMetaInterface ioMeta = getStepIOMeta();
for (StreamInterface stream : ioMeta.getTargetStreams()) {
SwitchCaseTarget target = (SwitchCaseTarget) stream.getSubject();
if (target != null && target.caseTargetStep == null) {
cr = new CheckResult(CheckResultInterface.TYPE_RESULT_ERROR, BaseMessages.getString(PKG, "SwitchCaseMeta.CheckResult.TargetStepInvalid", "false", target.caseTargetStepname), stepMeta);
remarks.add(cr);
}
}
if (Utils.isEmpty(fieldname)) {
cr = new CheckResult(CheckResultInterface.TYPE_RESULT_ERROR, BaseMessages.getString(PKG, "SwitchCaseMeta.CheckResult.NoFieldSpecified"), stepMeta);
} else {
cr = new CheckResult(CheckResultInterface.TYPE_RESULT_OK, BaseMessages.getString(PKG, "SwitchCaseMeta.CheckResult.FieldSpecified"), 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, "SwitchCaseMeta.CheckResult.StepReceivingInfoFromOtherSteps"), stepMeta);
remarks.add(cr);
} else {
cr = new CheckResult(CheckResultInterface.TYPE_RESULT_ERROR, BaseMessages.getString(PKG, "SwitchCaseMeta.CheckResult.NoInputReceivedFromOtherSteps"), stepMeta);
remarks.add(cr);
}
}
Aggregations