How to implement a service task with a java class (without creating a .war file and without having an external worker)?

Hello,

its my first post here. Happy to share my question with you and hopefully someone can help :grinning:

I am using camunda in a tomcat distribution. I have a .war file with all the needed files (bpmn models, forms, java classes) to execute my business process.

AS-IS situation:
I have a service task (as shown below) and this task is implemented with a java class.
image

The engine will find this java class in runtime as I deploy the .war file in the webapps folder (the class is within this .war file).

TO-BE
The question is whether (somehow) I can write a java class and deploy it somewhere in this distribution, so the engine during runtime will pick it and execute my task.

For example, if I have a form, I specify it in my user task like shown below, and during runtime it will be picked.
For forms: camunda-forms:deployment:userForm.form

Can I do something like this for a java class and be picked during runtime (without having a .war file)??

Additionally, I don’t want to use external workers. That’s why I am wondering if there is an option to run a service task with a java class that is deployed somewhere and not having a .war file. So, can a java class “live” somewhere within the distribution and be invoked by the engine?

Thank you for your time.