HI @leonardo_lsilva,
If you are getting started with rules and wondering where to start with you can check on this comment of mine. And the solution the thread that has a sample working rule.
As @dheerajk27, said you don’t have to consider it to be a java application with public class main function and etc.
To have a simple visualisation, Think that every line you are placing in the rule will be placed in a function and called into the main function that IDN maintains. Meaning whatever write into it gets executed and you don’t have to worry about anything outside it (like file structure, compilation and execution.
Do make sure to add appropriate JARs, that you use in your rules in the Source config.