IRE engine is not working in on before transform script (ignoring all the record )

amar7
Kilo Guru

Hi Community ,

To avoid duplication i am trying to use IRE engine in on before transform script, but all the time its ignoring the record even if is the correct record to insert .

on before transform script:

(function runTransformScript(source, map, log, target) {
    // Call CMDB API to do Identification and Reconciliation of current row
    var cmdbUtil = new global.CMDBTransformUtil();
    cmdbUtil.identifyAndReconcile(source, map, log);
    ignore = true;
    if (cmdbUtil.hasError()) {
        var errorMessage = cmdbUtil.getError();
        log.error(errorMessage);
    } else {
        log.info('IE Output Payload: ' + cmdbUtil.getOutputPayload());
        log.info('Imported CI: ' + cmdbUtil.getOutputRecordSysId());
    }
})(source, map, log, target);

 

amar7_0-1676461202038.png

 

help would be appreciated. 

2 REPLIES 2

CMDB Whisperer
Mega Sage
Mega Sage

Actually it is NOT necessarily ignoring the record.  This is a known effect of using the IRE from an onBefore() transform script.  The "Ignored" status is literally what you told it to do, i.e. "ignore = true".   You are not alone.  This is a known and documented side effect.  So the advice here is to "ignore the ignores" if using IRE from a traditional transform in this manner, and add messages to the log to troubleshoot.  That said, a much better way to use the IRE from a transform is to use IntegrationHub ETL to do your transforms and abandon the traditional transforms.  This will give you much more flexibility and capability in your transform logic as IHETL uses the Robust Transform Engine.  IHETL is a free application and you can convert your existing data sources to use IHETL and disable your existing transform maps.  There is a bit of a learning curve but it is the preferred method of integrating into CMDB and it is the method used by Service Graph Connectors.


The opinions expressed here are the opinions of the author, and are not endorsed by ServiceNow or any other employer, company, or entity.

MMGF
Tera Contributor

Put this in the script section of the Transform not on the row-level transform script.