In general, your approach is the right way to use a custom engine configuration. However, it is hard to tell what exactly the problem is. So could you please clarify your problem by posting the error output (e.g. log) or describing in detail what exactly doesn’t work?
However, I have two hints that might help to solve the issue:
Is your class JndiOjbectFactoryBean extending the abstract class ProcessEngineConfiguration? Maybe you can have a look at our default implementation on how we configure the engine by default.
The XML code you posted, should be contained in the camunda.cfg.xml. Is that already the case?
Sorry for the misguidance. I totally forgot to ask you about your camunda version. In jboss you need of course to edit wildfly’s standalone.xml.
Basically, what you provide in the < configuration> tag is a path and name of a java class that extends the abstract class ProcessEngineConfiguration . In the ‘camunda-bpm-platform/engine/src/main/java/org/camunda/bpm/engine/impl/cfg/’ directory you can already find some sample/default implementations (see e.g. here). Within the tag you then provide the path beginning from the ‘org’ directory to the file and the name of the file (concatenated with dots). For you example you could try out following sample configuration:
@devj87 Yes, it is. Keep in mind though, that it is not enough to just use the StandaloneProcessEngineConfiguration, because the standalone.xml just allows you to define String, Integer and Boolean values (see here). So if you want to use your own IdGenerator you have two options:
You create your own config class (MyProcessEngineConfiguration) that extends ProcessEngineConfiguration and then plug that in your standalone.xml (meaning put that inside you < configuration> tag
You configure your IdGenerator as a plugin and add that to your standalone.xml (see here on how to do that).
According to the docs you have to extend the JtaProcessEngineConfiguration for your custom configuration implementation. So try to change that and have a look if that already solves the problem.
In case that didn’t help, you should check if you adapted the following line in the standalone.xml :
I took a deeper look into your problem and it’s not as easy to solve as I thought. On a general note first: you cannot inject spring into Wildfly as this is not supported by Wildfly’s core system. You have to create an own wildfly module and add that to the subsystem. Thus, the best way to use your own id generator in Camunda Wildfly is:
Create a Wildfly module with a custom ProcessEnginePlugin. See here for how to create a process engine plugin and here an example on how to create a Wildfly module. In addition, the
custom ID generator needs the following module dependencies:
camunda-engine
whatever is needed for your custom id generator
Register the custom module as a module dependency in Camunda Wildfly subsystem.
Register the ProcessEnginePlugin for the process engine in the standalone.xml (see here).