lifalin2016 wrote:
Actually, it just dawned on me, that it's defined in this file: C:\Program Files\FME 2022\transformers\fmesuite.fmx
The code seems to be Tcl/Tk, which I never really learned.
Are there any Tcl/Tk programmers out there, that may be able to decipher it and suggest a fix ?
YES!!!!
I did manage to decipher the TclTk code myself, and offer a correction.
This is the original code piece:
if {[string length $newAttrVal] == 0} {
if {{$(PASSTHROUGH)} eq {NO} || [string length $oldAttrVal] > 0} {
FME_SetAttribute fme_rejection_code "INVALID_INPUT";
break;
} elseif {!$oldAttrExists} {
FME_UnsetAttributes $attr;
} elseif {!$oldAttrNull} {
FME_SetAttribute $attr {};
};
}
This is my fix:
if {[string length $newAttrVal] == 0} {
if {{$(PASSTHROUGH)} eq {NO} || [string length $oldAttrVal] > 0} {
FME_SetAttribute $attr $oldAttrVal;
FME_SetAttribute fme_rejection_code "INVALID_INPUT";
break;
} elseif {!$oldAttrExists} {
FME_UnsetAttributes $attr;
} elseif {!$oldAttrNull} {
;
FME_SetAttribute $attr $oldAttrVal;
};
}
And it works 🙂
Now I can use the transformers in a cascading manner.
Yippee!
--------------------- edit:
Actually, the fix need only be added to the "INVALID_INPUT" block:
if {[string length $newAttrVal] == 0} {
if {{$(PASSTHROUGH)} eq {NO} || [string length $oldAttrVal] > 0} {
FME_SetAttribute $attr $oldAttrVal;
FME_SetAttribute fme_rejection_code "INVALID_INPUT";
break;
} elseif {!$oldAttrExists} {
FME_UnsetAttributes $attr;
} elseif {!$oldAttrNull} {
FME_SetAttribute $attr {};
};
}
And the updated transformer definition can be kept in a separate FMX file in the same folder as fmesuite.fmx. Just remember to increase its version number.