Hitachi Vantara Pentaho Community Forums
Results 1 to 2 of 2

Thread: Passing Transformation ERROR Log file to Javascript to filter Error Status in PDI

  1. #1
    Join Date
    Jun 2016
    Posts
    3

    Default Passing Transformation ERROR Log file to Javascript to filter Error Status in PDI

    Hi,


    I am running below javascript in Kettel job to filter rollback transaction "Transformation ERROR Log file". if result is true, the retry must be applied, otherwise error log send thru email. however, code does not work. for more detail information, please see the attached file (image file).

    Thanks again for your support.

    function getMatches(searchStr, str) {
    var ind = 0, searchStrL = searchStr.length;
    var index, matches = [];

    str = str.toLowerCase();
    searchStr = searchStr.toLowerCase();

    while ((index = str.indexOf(searchStr, ind)) > -1) {
    matches.push(index);
    ind = index + searchStrL;
    }
    return matches;
    }


    var errorMsg = previous_result.getLogText()

    if(getMatches('Transaction collision',errorMsg).length > 0)
    {
    // issue caused by rollback transaction. retry it again.
    true;

    }else{
    // send error log
    false;
    }

    Name:  Case_Study_Javascript_Filtering.jpg
Views: 193
Size:  15.0 KB

  2. #2
    Join Date
    Nov 2014
    Posts
    15

    Default

    It did work for me. I just used the above script in JavaScript task and it worked for me.

    Name:  Capture.jpg
Views: 136
Size:  10.4 KB

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.