{"record":{"id":"987388351f8e7da2","repo":"pentaho/pentaho-kettle","slug":"transformclassbase-exception","errorCode":null,"errorMessage":"TransformClassBase.Exception.UnableToFindTargetStepNameForTag","messagePattern":"TransformClassBase\\.Exception\\.UnableToFindTargetStepNameForTag","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/userdefinedjavaclass/TransformClassBase.java","lineNumber":592,"sourceCode":"    if ( Utils.isEmpty( stepname ) ) {\n      throw new KettleException( BaseMessages.getString(\n        PKG, \"TransformClassBase.Exception.UnableToFindInfoStepNameForTag\", tag ) );\n    }\n    RowSet rowSet = findInputRowSet( stepname );\n    if ( rowSet == null ) {\n      throw new KettleException( BaseMessages.getString(\n        PKG, \"TransformClassBase.Exception.UnableToFindInfoRowSetForStep\", stepname ) );\n    }\n    return rowSet;\n  }\n\n  public RowSet findTargetRowSet( String tag ) throws KettleException {\n    if ( tag == null ) {\n      return null;\n    }\n    String stepname = data.targetMap.get( tag );\n    if ( Utils.isEmpty( stepname ) ) {\n      throw new KettleException( BaseMessages.getString(\n        PKG, \"TransformClassBase.Exception.UnableToFindTargetStepNameForTag\", tag ) );\n    }\n    RowSet rowSet = findOutputRowSet( stepname );\n    if ( rowSet == null ) {\n      throw new KettleException( BaseMessages.getString(\n        PKG, \"TransformClassBase.Exception.UnableToFindTargetRowSetForStep\", stepname ) );\n    }\n    return rowSet;\n  }\n\n  private final Map<String, FieldHelper> inFieldHelpers = new HashMap<String, FieldHelper>();\n  private final Map<String, FieldHelper> infoFieldHelpers = new HashMap<String, FieldHelper>();\n  private final Map<String, FieldHelper> outFieldHelpers = new HashMap<String, FieldHelper>();\n\n  public enum Fields {\n    In, Out, Info;\n  }\n","sourceCodeStart":574,"sourceCodeEnd":610,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/userdefinedjavaclass/TransformClassBase.java#L574-L610","documentation":"Thrown by TransformClassBase.findTargetRowSet(tag) when the given target tag is not mapped to any step name in data.targetMap. Target tags must be declared (e.g. addTargetSource or target step mappings) before the script can retrieve their rowset.","triggerScenarios":"Calling findTargetRowSet(\"myTag\") with a tag never added as a target definition, or with a tag whose mapping was removed/renamed in the step's target configuration.","commonSituations":"Typo in the tag; deleting a target hop in Spoon while the script still looks up the old tag; script copied from another transformation with different target definitions.","solutions":["Declare the tag as a target in the UDJC step dialog (or addTargetSource) so it maps to a step name.","Correct the tag string used in findTargetRowSet to match a registered target tag.","Confirm the target step hop still exists in the transformation."],"exampleFix":"// before\nRowSet rs = findTargetRowSet(\"outputA\"); // not registered\n// after\naddTargetSource(\"outputA\", \"Output Step A\");\nRowSet rs = findTargetRowSet(\"outputA\");","handlingStrategy":"validation","validationCode":"if (tag != null) { Object o = data.targetMap.get(tag); if (o == null || o.toString().isEmpty()) throw new KettleException(\"Target tag not mapped: \" + tag); }","typeGuard":"boolean isTargetMapped(String tag) { return tag != null && data.targetMap.get(tag) != null && !data.targetMap.get(tag).toString().isEmpty(); }","tryCatchPattern":"try { RowSet rs = findTargetRowSet(tag); ... } catch (KettleException e) { logError(\"Target tag not mapped: \" + tag, e); throw e; }","preventionTips":["Register every target tag used in the script via addTargetSource or the dialog","Use constants for tag names","Audit target hops when copying steps between transformations"],"tags":["kettle","udjc","target-stream","rowset"],"backgroundTag":"resource-not-found","analyzedSha":"f3058517a153da500bf4551f46d79b91bf8ec552","analyzedAt":"2026-09-13T14:04:16.340Z","contentChangedAt":"2026-09-13T14:04:16.340Z","schemaVersion":2},"datasetVersion":"2026-09-20T23:17:15.980Z"}