I’m struggling to follow your second result screenshot - can you cleanup your variables (link) and give them meaningful names?
Variable-naming and cleanup discipline is paramount for a developer.
The Java code was easier to follow - your flag is 0, so it means that 10 is not a prime number.
Check if you’re populating the “message” field in all the debugLog steps.
P.S - It looks like you replicated the code without understanding what it is doing (particularly the logic under Repeat). Use the “debug” functionality on Designer, to follow the variables and the flow.
Your second Branch is set up as a Switch, but you’re evaluating a condition as an If-Else construct. Can you update the “Evaluate Label” parameter to “true”, just like in your first branch?
Also, both the conditions on output have “=” on them - you need to correct that as well.
Input variables are dropped even before they’re used
Java service is not functional because “input” and “i” are used as service inputs but also being reinitialized again so your modulus operation does not work
Second branch is being used incorrectly
“m” is configured in Repeat as a counter but it’s not available in the pipeline
“flag” variable is initialized because it’s available in the Java snippet, but it has no use
“for ( i=2 ; i<=m ; i++)” is a comment and not the coding logic (Flow doesn’t work like that)
Based on my comments above, here’s some straightforward feedback to you -
You are not ready to build Flow or Java services, yet
Fundamentals - Understand what each Flow operation is meant for and how to use them
Understand what is that you are trying to solve, before you write code - if you don’t understand the math behind how to determine a prime number, you cannot build a service to solve that problem
Start with simple flow services - for example, math operations, calculator, etc.
Familiarize yourself with the concepts of writing a Java service in IS - they are trickier than Flow
Use the “Debug” and “Step” features to step through your flow to see how your variables
Forums are to help you get past an obstacle, but not at this fundamental level. You are new to this, which is perfectly fine - we all started at zero at some point. However, without understanding the fundamental building blocks, you are not going to move forward.