An addition: You can use the process engine configuration class org.camunda.bpm.engine.cdi.CdiStandaloneProcessEngineConfiguration. This configuration uses an artifact factory (that is called when the engine instantiates classes), that looks into the application’s CDI context.
Hi thorben. There is some example on how to configure the default shared engine for this kind of purpose ?
Using a delegateExpression with a bean could be a solution but the field injection is permanent (as it’s a singleton bean) and I can use custom spring beans already wired.
Using a Class is a better solution because my injected fields are changing every time, but inside that class actually I can’t inject useful bean like db connections, custom services etc, and I don’t want to specify those beans for every call.
For example for a TaskListener : class : pack.CompleteTask
injected field : var1 (manually set on modeler)
injected field : var 2 (manually set on modeler)
Inside the notify method of CompleteTask class:
bean1.foo(var1, var2, task.getExecution().getVariable(“form_var_foo”))
I want var1,var2 to be specified every time, while bean1 and bean2 should be autowired at every class instantiation. Is this possible ? Or there is a way to detect spring environment from this class and get the desired beans ?