To get more information on how an application interacts with UFW use:
$ sudo ufw app info [application name]
For example
$ sudo ufw app info Apache