AnsweredAssumed Answered

quick observation on spring boot feature 5.17.0 ..

Question asked by willwoodman on Jan 10, 2015
interested to see the spring-boot enablement coming in so i tried to have a go using a gradle build - but following the guidelines in chapter 05.

this all kind of worked except it didnt seem to auto deploy my process.  The documentation says create the file in class path in a directory called processes/

i'd created my gradle project so added the /processes directory to the src/main/resources source folder.  however i wanted to use the activiti editor so i tried to box clever and created the process name one-task-process.bpmn - which is recognised by the eclipse bpmn editor i have installed.

however this is not auto deployed by default - seems like an oversight.  when i copied the file and called it one-task-process.bpmn20.xml that did auto deploy - but its just an xml file so the designer wont read it straight away.

i've kind of fixed it eventually by adding a line in the CommandLineRunner method like this


      return new CommandLineRunner() {
         @Override
         public void run(String… strings) throws Exception {
            System.out.println("Number of process definitions : "
               + repositoryService.createProcessDefinitionQuery().count())
            println("Number of tasks : " + taskService.createTaskQuery().count())
            
            repositoryService.createDeployment().addClasspathResource ("processes/oneTaskProcess.bpmn").deploy()
            runtimeService.startProcessInstanceByKey("oneTaskProcess")
            println("Number of tasks after process start: " + taskService.createTaskQuery().count())
         }


is there a reason why it doesnt auto load .bpmn files ? - not a killer but took half an hour to figure out why my approach hadnt worked

if any one else wants to try gradle rather than maven - heres my simple build.gradle


buildscript {
   repositories {
      mavenCentral()
   }

   dependencies {
      classpath("org.springframework.boot:spring-boot-gradle-plugin:1.2.1.RELEASE")
   }
}

apply plugin: 'groovy'
apply plugin: 'eclipse'
apply plugin: 'spring-boot'



sourceCompatibility = 1.7
version = '0.1'
def activitiVersion = '5.17.0'
jar {
    manifest {
        attributes 'Implementation-Title': 'activiti-spring-boot', 'Implementation-Version': version
    }
}

repositories {
    mavenCentral()
}

dependencies {
    compile group: 'commons-collections', name: 'commons-collections', version: '3.2'
    testCompile group: 'junit', name: 'junit', version: '4.11'
   
   compile("org.activiti:spring-boot-starter-basic:$activitiVersion")
   compile 'com.h2database:h2:1.4.184'
   compile 'org.codehaus.groovy:groovy-all:2.3.9'
   
   
   //compile("org.springframework.boot:spring-boot-starter-web")
   //compile("org.thymeleaf:thymeleaf-spring4")
   //compile("nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect")
}

test {
    systemProperties 'property': 'value'
}

uploadArchives {
    repositories {
       flatDir {
           dirs 'repos'
       }
    }
}



Outcomes