Flowable not autodeploying processes in the default location

Hi all,

I have these integration tests functioning correctly but I need an auto-deploy solution that doesn’t require the @Deployment tag.

I have these lines in my application-dev.properties file:

flowable.process-definition-location-prefix=classpath*:/processes/ # The folder in which processes need to be searched for auto deployment.
flowable.process-definition-location-suffixes=**.bpmn20.xml,**.bpmn # The suffixes (extensions) of the files that needs to be deployed from the 'processDefinitionLocationPrefix' location.

This file is used in my integration test file:

@WebAppConfiguration
@AutoConfigureMockMvc
@ContextConfiguration(classes = IntegrationConfiguration.class)
@ActiveProfiles(resolver = ProfileResolver.class)
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
@ExtendWith(FlowableSpringExtension.class)
@ExtendWith(SpringExtension.class)
@TestMethodOrder(OrderAnnotation.class)
public class FlowableIntegrationSmokeTest extends FlowableIntegrationTestBase {

The ContextConfiguration class uses the application-dev.properties like so:

  @Profile("dev")
  @Configuration
  @PropertySources({ @PropertySource("classpath:application-dev.properties")})
  static class DevConfiguration implements TestConfiguration {
  }

  @Profile("qab")
  @Configuration
  @PropertySources({ @PropertySource("classpath:application-dev.properties")})
  static class QabConfiguration implements TestConfiguration {
  }
   
  @SpringBootApplication(scanBasePackages = "com.pgi.flowzilla", exclude = {FlowzillaAutoConfiguration.class })
  static class TestApplication {
      public static void main(String[] args) {
      SpringApplication.run(FlowzillaApplication.class, args);
    }
  }

My working example if you comment back in the @Deployment:

  @Test
  @Order(1)
  //@Deployment(resources = { "processes/NewUser.bpmn20.xml",
    //  "processes/New_Company_setup.bpmn20.xml",
      //"processes/UpdateUser.bpmn20.xml" })
  void CompanySmokeProcessStart() throws Exception {
    this.mockMvc = webAppContextSetup(this.wac).build();

    List<ProcessDefinition> processDefinitions =
        processEngine.getRepositoryService()
            .createProcessDefinitionQuery()
            .listPage(0, 5);

    assertEquals(3, processDefinitions.size(),
        "There should be three processes deployed");
    LOG.info("Process Definition List size: " + processDefinitions.size());
    for (ProcessDefinition processDefinition : processDefinitions) {
      String deploymentId = processDefinition.getDeploymentId();
      LOG.info("Deployment ID for definition: " + deploymentId);
    }

    String requestBody = loadCompanyData("smoke_test_data.json")
        .replace("**COMPANY_NAME**", COMPANYNAMETOSEARCH.get())
        .replace("**REQUESTED_URL_GM**", REQUESTED_URL_GM.get());

    MvcResult result =
        mockMvc.perform(post("/customers/ucaas").contentType("application/json")
            .accept("application/json")
            .content(requestBody)).andExpect(status().isOk()).andReturn();

    System.out.println(result.getResponse().getContentAsString());
  }

This test fails at the assertion that 3 processes should have been deployed but there are 0 present.

Any help on this would be appreciated

Your using the default location(s)?

By default, certain folders on the classpath are automatically scanned:

  • /apps: Looks for all files ending with .zip or .bar and deploys them
  • /cases: Looks for all files ending with .cmmn, .cmmn11, .cmmn.xml or .cmmn11.xml and deploys them
  • /dmn: Looks for all files ending with .dmn, .dmn11, .dmn.xml or .dmn12.xml and deploys them
  • /forms: Looks for all files ending with .form and deploys them
  • /processes: Looks for all files ending with .bpmn20.xml or .bpmn and deploys them

For example:

├── /src
    └── /main
        └── /java
        └── /resources
            └── /apps
                ├── hr-app.zip
            └── /processes
            ├── application.properties
    └── /test

Ref: Flowable OAuth2 Resource Server

Yes I am using the default location and its not picking up the files names .bpmn20.xml and I can’t figure out why

flowable.process-definition-location-prefix=classpath*:/processes/ # The folder in which processes need to be searched for auto deployment.

I have this in my properties file