Hi
I am running Camunda as an embedded service on Jboss EAP 6.4.21. Camunda is bootstraped by extending EjbProcessApplication and annotating it with @ProcessApplication. The configuration is placed in META-INF/processes.xml.
My situation is the following. When I build my application I deploy it to two different environments. In production I need to run it backed by an Oracle database. In the other environment where I deploy the application it should run with an inmem configuration. It is not an option just to build a new version, since I need it to be the same version. I have an environment variable, which I can use to determine which environment I am in.
So to the question, is there af way to switch the configuration (ei processes.xml to processesInmem.xml)? I have tried to make two subclasses of EjbProcessApplication and make a conditional call to the deploy method as shown below and vice versa in the other bean
@Singleton
@Startup
@ConcurrencyManagement(ConcurrencyManagementType.BEAN)
@TransactionAttribute(TransactionAttributeType.REQUIRED)
@ProcessApplication(deploymentDescriptors = {"META-INF/processes_inmem.xml"})
@Local(ProcessApplicationInterface.class)
public class BootableProcessApplicationInMem extends EjbProcessApplication {
@PostConstruct
public void start() {
if (ProcessEnvironment.isInMem()) {
deploy();
}
}
I was almost there until I ran into the ServletProcessApplicationDeployer.class where I am stopped by
String contextPath = ctx.getContextPath();
if(c.size() > 1) {
// a deployment must only contain a single PA
throw LOG.multiplePasException(c, contextPath);
because I have two beans annotated with ProcessApplication.class
Is there a solution to my issue that you could suggest?
Best regards,
Allan