Spring-Boot with StandaloneProcessEngineConfiguration does not deploy *.bpmn-files

1,751 views
Skip to first unread message

Torsten Geise

unread,
Apr 17, 2015, 9:54:11 AM4/17/15
to camunda-...@googlegroups.com
Hi guys,

I'm stuck setting up a simple web application containing a standalone process engine deploying a simple BPMN process. The problem is that a src/main/resources/bpmn/camunda-demo-1.bpmn file is not deployed. 

After startup of the SpringBootApplication the engine is running. Here's my process engine configuration:

@Configuration
public class CamundaConfiguration {

   
@Autowired private DataSource dataSource;

    @Bean
    public ProcessEngineConfiguration processEngineConfiguration() {
       
ProcessEngineConfiguration pec = new StandaloneProcessEngineConfiguration();
        pec.setDataSource(dataSource);
        pec.setDatabaseSchemaUpdate("true");
        pec.setJobExecutorActivate(true);
        pec.setHistory("full");
        pec.setJobExecutorDeploymentAware(true);
        return pec;
    }

   
@Bean
    public ProcessEngine processEngine() {
       
return processEngineConfiguration().buildProcessEngine();
    }
   
...
}

The BPMN file is location in "src/main/resources/bpmn/camunda-demo-1.bpmn". 
I also provided a src/main/resources/META-INF/processes.xml with the following content:

<process-application xmlns="http://www.camunda.org/schema/1.0/ProcessApplication">
    <process-archive name="camunda-demo">
       <resource>bpmn/camunda-demo-1.bpmn</resource>
       
<properties>
           
<property name="isDeleteUponUndeploy">false</property>
           
<property name="isScanForProcessDefinitions">true</property>
       
</properties>
   
</process-archive>

</process-application>

But there is no process available after startup:

@Override
public void run(String... strings) throws Exception {
   
List<ProcessDefinition> procDefs = repositoryService.createProcessDefinitionQuery().list();
    LOG.debug("Number of deployed processes: " + procDefs.size());
}

Any hints?

Thanks,
Torsten
 

Roman Smirnov

unread,
Apr 17, 2015, 10:54:04 AM4/17/15
to camunda-...@googlegroups.com
Hi Torsten,

What does the console say? Is there any log that the processes has been deployed?

Is the attribute "isExecutable" of your process set to true?

Cheers,
Roman

Torsten Geise

unread,
Apr 17, 2015, 4:12:21 PM4/17/15
to camunda-...@googlegroups.com
The console output does not say anything about deployment. Just a statement about successful creation of the process engine:
o.c.bpm.engine.impl.ProcessEngineImpl    : ProcessEngine default created

The BPMN file is executable:
<?xml version="1.0" encoding="UTF-8"?>
<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd" id="_cS3BYOU8EeSOnprl-BZowg" exporter="camunda modeler" exporterVersion="2.7.0" targetNamespace="http://activiti.org/bpmn">
 
<bpmn2:process id="Process_1" isExecutable="true">
   
<bpmn2:startEvent id="StartEvent_1">
...


Torsten Geise

unread,
Apr 18, 2015, 5:47:07 AM4/18/15
to camunda-...@googlegroups.com
I tried setup the engine with spring xml configuration ... it works. Obviously, there is one configuration property "deploymentResources" that is not available when configurating the process engine in Java.

<bean id="processEngineConfiguration" class="org.camunda.bpm.engine.spring.SpringProcessEngineConfiguration">
   
<property name="dataSource" ref="camundaDataSource" />
   
<property name="transactionManager" ref="camundaTransactionManager" />
   
<property name="databaseSchemaUpdate" value="true" />
   
<property name="jobExecutorActivate" value="false" />
   
<property name="deploymentResources" value="classpath*:/bpmn/*.bpmn" />
   
<property name="historyLevel" value="HISTORY_LEVEL_FULL" />
</bean>



Any idea where to configure this property in Java?

Thanks,
Torsten

Roman Smirnov

unread,
Apr 20, 2015, 3:25:21 AM4/20/15
to camunda-...@googlegroups.com
Hi Torsten,

The property "deploymentResources" can only configured on a "SpringProcessEngineConfiguration" (see [1]).

You could try to adjust your java process engine configuration as follows:


  public ProcessEngineConfiguration processEngineConfiguration() {
   
SpringProcessEngineConfiguration pec = new SpringProcessEngineConfiguration();
// ...

// set deployment resources
pec.setDeploymentResources(...);

    return pec;
  }
 

Cheers,
Roman

Torsten Geise

unread,
Apr 20, 2015, 5:41:38 AM4/20/15
to camunda-...@googlegroups.com
This works.
Thanks, Torsten
Reply all
Reply to author
Forward
0 new messages