Spring Boot Camunda: loading deployment resources from @Service

Hello all,

I have a running Spring Boot Camunda workflow engine with some individual services, that are accessible from (groovy) script tasks inside my process and it all works like a charm, thanks for that! Inside of some of the service implementiations, I compile and send emails using freemarker and it’s template loading mechanisms. The API of my service, I call from the camunda script task, is something like

sendEmailTo(receiver, businessKey, templateName)

Right now I can succesfully use classpath (of the spring boot app) and static resources (via file:/… template source path) for resolving the templateName parameter.

But I wonder how to access additional resources from the camunda deployment, my task is based on? I mean, I have used the REST endpoint engine-rest/deployment/create to create a deployment with a .bpmn and a freemarker template .ftl. Now I want to access this template from back in the spring boot implementation… I know, I would be able to get it from the workflow via deployment:... prefix but can not get it to work from the Java code.

Does anyone here ever had such a system architecture running?
Maybe I have to load the resource in the groovy script task and pass the result text to the backend service? How would that be achived?

Thanks in advance
Geraint

PS: i found Groovy files can't invoke methods in other groovy files which are part of same deployment - #5 by pme123 and wonder if it is still state of the art?