Groovy source in an external file
Yes, you have several ways of achieving that. You can create a Groovy script file (or multiple) in your Bonita project (Development > Groovy > New... > Create your class). Write all your business logic in them and then reference them in groovy script expressions of your processes. Either by instantiating your script instance (new MyClass().myBusinessLogic()) or use static methods in your script. The script files will be added as process dependencies in the configuration.
You can also create this logic in a custom project (using whatever tools suits you, maven, gradle, groovy, java...) and import the resulting jar file in project dependencies (the project should depend on bonita-common artifact with a provided scope to use Bonita APIs). Then use the logic in the process script expressions the same way as the first solution. This option can be trickier to implement but can give you better control as you can more easily plug unit tests on your logic.