Skip to main content

How do I write else if loop in groovy evaluator 

Example: the if-else loop in expression evaluator is written in below way: 

${record:value('/phone_homem0]') != ' ' ? record:value('/phone_homem0]'):

(record:value('/phone_homem1]') != ' ' ? record:value('/phone_homem1]'):

(record:value('/phone_homem2]') != ' ' ? record:value('/phone_homem2]'): ' '))}

 

How do I implement Same-Example thing in groovy evaluator,

Since there are dynamic number of rows coming each time, esometimes number is 10, sometimes 100 etc, so need to write for-loop]

@Priyanka Mynepally

if(condition) {   
   statement #1   
} else if(condition) {   
   statement #2   
} else {   
   statement #3   

 

@Bikram  shared some code earlier about looping using Evaluators. Let me find the thread for you.


@Priyanka Mynepally 

 

Here: 

 

You can use the same concept in Groovy and iterate for all the phone numbers.


It was helpful. Thanks,

Could you please help me with groovy-code as well.


@Priyanka Mynepally please share the sample data


same data as in before example


same data used in jython example


Reply