Discussion

How can I use a mod operation

hi all,

Get a very simple question about the mod operation, if I wand to do something in a loop like below,

pyForEachCount % 2 == 0,

How can I write it in expression build in the pre-condition section,

thanks,

**Moderation Team has archived post**

This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.

Comments

Keep up to date on this post and subscribe to comments

November 6, 2009 - 7:02am

Hi,

You can use something like following in the pre condition

@java("String.valueOf(Integer.parseInt(tools.getParamValue(\"pyForEachCount\")) % 2 == 0)") - yes I know this is bit overuse of pre condition block [:)]

or use a function rule (Rule-Utility-Function) to have the logic and call it in the pre condition

Thanks and Regards
Indrajith