Customer Portal

DataFieldMetadata: possible to overwrite programatically??

Comments 1

  • Avatar
    avackova
    0
    Comment actions Permalink
    Hello,
    what you are trying to do is very unconventional and danger. But if you want to change record metadata you have to call init() method:
    newRec.init()

    But why are you trying to do this? Rather create temporary record in init method of your transformation:

    public boolean init(Properties parameters,
    DataRecordMetadata[] sourceRecordsMetadata,
    DataRecordMetadata[] targetRecordsMetadata)
    throws ComponentNotReadyException {
    tMetadata = targetRecordsMetadata[0].duplicate();
    tMetadata.getField("REF").setSize((short) 10);
    tMetadata.getField("REF").setType(DataFieldMetadata.STRING_FIELD);
    tMetadata.getField("REF").setNullable(true);
    tmpRecord = new DataRecord(tMetadata);
    tmpRecord.init();
    return super.init(parameters, sourceRecordsMetadata, targetRecordsMetadata);
    }

    Then you can store anything in such temporary record.

Please sign in to leave a comment.