var mapper = mapperFactory.createMapperMult(['EstProdPrecoTblHist', 'EstProdPrecoTblHistCpl']);

try {
    var itens = message.get('itens');
    for (var i = 0; i < itens.size(); i++) {
        if (itens.get(i).get('vlrFornNovo') != itens.get(i).get('vlrFornOriginal') || itens.get(i).get('vlrVdNovo') != itens.get(i).get('vlrVdOriginal')) {
            mapper.update('EstProdPrecoTblHistCpl.alterarEstProdPrecoTblHistCpl', itens.get(i));
        }
    }

    if (message.get('flagNaoAtualizaStatus') == null || message.get('flagNaoAtualizaStatus') == 0) {
        mapper.update('EstProdPrecoTblHist.alterarEstProdPrecoTblHist', {
            'cdEmp': message.get('cdEmp'),
            'cdCtr': message.get('cdCtr'),
            'dtProcessar': message.get('dtProcessar'),
            'flagProcessado': 0,
            'flagIgnorarBlisters': message.get('flagIgnorarBlisters'),
            'flagNaoAtualizarPrecoOferta': message.get('flagNaoAtualizarPrecoOferta')
        });
    }

    mapper.commit();

} catch (err) {
    mapper.rollback();
    throw err;
}