Announcement

Collapse
No announcement yet.

JS delete tmp['test-element-name'] doesn't work

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • JS delete tmp['test-element-name'] doesn't work

    Hi evrybody,

    I'm trying to delete some element with a JavaScript in the Transformer

    As a result ONLY EVEN POSITION ELEMENT are deleted and NOT ODD POSITION ONES.

    I think "delete msg['element']" could have some bug.

    Any help/idea/workaround?

    for (jj in tmp['element-name']['sub-element'] )
    {
    delete tmp['element-name']['sub-element'][jj];
    logger.info('delete_cycle_r:'+ jj);
    }

    It deletes only EVEN position...
    Or it's my fault?

    Thanks in advance...
    Stefano
    Stefano Mastrogiacomo

  • #2
    Re:JS delete tmp['test-element-name'] doesn't work

    Try:

    Code:
    for each (jj in tmp['element-name']['sub-element'] )
    {
         delete jj;
         logger.info('delete_cycle_r:'+ jj);
    }
    Chris Lang

    Comment

    Working...
    X