reminder operator is not working in branch flow

I m trying to branch on evaluate label
calculate remainder using % operator

%num% %2 ==0
but not working
branch.jpg

Hi Mohammad,

this is not possible as the remainder operator is not allowed in comparison expressions.

See Service Development Help for details.

You can calculate the remainder before the branch and then branch on the outcome of this calculation.

You can check the CodeSamples resp. Downloads section of this community for PSUtilities package, which has a service ps.util.math:modDivideInts, which will also return the remainder.

Or you can write you service to achieve this.

Regards,
Holger

Thank you…

May i create and use a java service instead of ps.util.math:modDivideInts,

will it be good for my project?

Hi Mohammad,

this decision is up to you:
If you want provide the full PSUtilities Package to all your installations/instances or not?
In my project we provide the full package to all installation/instances as we are using several services out of it.
On the other side, if you only need this particular service, feel free to create a copy in one of your custom packages and use this copy in your code.

BTW:
When ever we are migrating to a newer version of IntegrationServer we check if there are appropriate services in WmPublic package available and replace the PSUtilities based services with those from WmPublic package.

Please note, that ps.util.math:modDivideInts is implemented as Java Service as most of the services in the PSUtilities package are Java Services.

Regards,
Holger

As Holger suggested, start using PSUtils or if you have any CommonUtils or CommonServices in your project, create them in this packages and make sure you have proper governance around it to avoid duplicate and unused services.

1 Like