Skip to content

Commit

Permalink
Merge 2886c5e into 0baf0a1
Browse files Browse the repository at this point in the history
  • Loading branch information
efonsell committed Nov 28, 2019
2 parents 0baf0a1 + 2886c5e commit 058f1a0
Show file tree
Hide file tree
Showing 9 changed files with 67 additions and 50 deletions.
6 changes: 3 additions & 3 deletions nflow-examples/spring-boot/bare-minimum/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id "com.github.ben-manes.versions" version "0.22.0"
id 'org.springframework.boot' version '2.1.7.RELEASE'
id "com.github.ben-manes.versions" version "0.27.0"
id 'org.springframework.boot' version '2.2.1.RELEASE'
id 'io.spring.dependency-management' version '1.0.8.RELEASE'
}

Expand All @@ -16,7 +16,7 @@ repositories {

dependencies {
compile('org.springframework.boot:spring-boot-starter-jdbc')
compile("io.nflow:nflow-engine:5.7.0")
compile("io.nflow:nflow-engine:6.0.0")
runtime('com.h2database:h2')
testCompile('org.springframework.boot:spring-boot-starter-test')
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
# upgrading to 5.6 or newer breaks eclipse test classpath
distributionUrl=https\://services.gradle.org/distributions/gradle-5.5.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package io.nflow.springboot.bareminimum;

import javax.annotation.PostConstruct;
import javax.inject.Inject;

import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Import;

import io.nflow.engine.config.EngineConfiguration;
Expand All @@ -15,30 +15,37 @@

@SpringBootApplication
@Import(EngineConfiguration.class)
@ComponentScan("io.nflow.springbootbareminimum")
public class SpringBootBareMinimumApplication {

@Inject
private WorkflowInstanceService workflowInstances;

@Inject
private WorkflowInstanceFactory workflowInstanceFactory;

@Bean
public ExampleWorkflow exampleWorkflow() {
return new ExampleWorkflow();
}

@PostConstruct
public void createExampleWorkflowInstance() {
workflowInstances.insertWorkflowInstance(workflowInstanceFactory.newWorkflowInstanceBuilder()
.setType(ExampleWorkflow.TYPE)
.setExternalId("example")
.putStateVariable(ExampleWorkflow.VAR_COUNTER, 0)
.build());
@Bean
public ApplicationRunner applicationRunner() {
return new ExampleApplicationRunner();
}

public static void main(String[] args) {
SpringApplication.run(SpringBootBareMinimumApplication.class, args);
}

public static class ExampleApplicationRunner implements ApplicationRunner {

@Inject
private WorkflowInstanceService workflowInstances;

@Inject
private WorkflowInstanceFactory workflowInstanceFactory;

@Override
public void run(ApplicationArguments args) {
workflowInstances.insertWorkflowInstance(workflowInstanceFactory.newWorkflowInstanceBuilder()
.setType(ExampleWorkflow.TYPE)
.setExternalId("example")
.putStateVariable(ExampleWorkflow.VAR_COUNTER, 0)
.build());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class SpringBootBareMinimumApplicationTests {

@Test
public void contextLoads() {
// just let SpringRunner load the context
// just check that context can be started
}

}
14 changes: 7 additions & 7 deletions nflow-examples/spring-boot/full-stack-kotlin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ fun DependencyHandler.nflow(name: String) = create(

plugins {
base
kotlin("jvm") version "1.3.31"
id("org.jetbrains.kotlin.plugin.spring") version "1.3.31"
id("org.springframework.boot") version "2.1.4.RELEASE"
id("io.spring.dependency-management") version "1.0.7.RELEASE"
kotlin("jvm") version "1.3.60"
id("org.jetbrains.kotlin.plugin.spring") version "1.3.61"
id("org.springframework.boot") version "2.2.1.RELEASE"
id("io.spring.dependency-management") version "1.0.8.RELEASE"
}

repositories {
Expand All @@ -50,12 +50,12 @@ dependencies {

testImplementation(kotlin("test"))
testImplementation(springBoot("test"))
testImplementation("io.kotlintest:kotlintest-runner-junit5:3.3.2")
testImplementation("io.kotlintest:kotlintest-runner-junit5:3.4.2")

nflowExplorer(
group = "com.nitorcreations",
group = "io.nflow",
name = "nflow-explorer",
version = "1.2.8",
version = "6.0.0",
ext = "tar.gz"
)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.5.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
10 changes: 5 additions & 5 deletions nflow-examples/spring-boot/full-stack/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
id 'de.undercouch.download' version '4.0.0'
id "com.github.ben-manes.versions" version "0.22.0"
id 'org.springframework.boot' version '2.1.7.RELEASE'
id 'de.undercouch.download' version '4.0.2'
id "com.github.ben-manes.versions" version "0.27.0"
id 'org.springframework.boot' version '2.2.1.RELEASE'
id 'io.spring.dependency-management' version '1.0.8.RELEASE'
}

Expand All @@ -23,10 +23,10 @@ dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-jersey'
implementation 'org.springframework.boot:spring-boot-starter-jdbc'
compile("io.nflow:nflow-rest-api-jax-rs:5.7.0")
compile("io.nflow:nflow-rest-api-jax-rs:6.0.0")
runtime('com.h2database:h2')
testCompile('org.springframework.boot:spring-boot-starter-test')
nflowExplorer group: 'io.nflow', name: 'nflow-explorer', version: '5.7.0', ext: 'tar.gz'
nflowExplorer group: 'io.nflow', name: 'nflow-explorer', version: '6.0.0', ext: 'tar.gz'
}

task resolveNflowExplorer(type: Copy) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package io.nflow.springboot.fullstack;

import javax.annotation.PostConstruct;
import javax.inject.Inject;

import org.glassfish.jersey.jackson.JacksonFeature;
import org.glassfish.jersey.server.ResourceConfig;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
Expand All @@ -24,12 +25,6 @@
@Import(RestConfiguration.class)
public class SpringBootFullStackApplication {

@Inject
private WorkflowInstanceService workflowInstances;

@Inject
private WorkflowInstanceFactory workflowInstanceFactory;

@Bean
public ExampleWorkflow exampleWorkflow() {
return new ExampleWorkflow();
Expand All @@ -40,6 +35,11 @@ public JerseyResourceConfig jerseyResourceConfig() {
return new JerseyResourceConfig();
}

@Bean
public ApplicationRunner applicationRunner() {
return new ExampleApplicationRunner();
}

private static class JerseyResourceConfig extends ResourceConfig {
public JerseyResourceConfig() {
register(ArchiveResource.class);
Expand All @@ -52,16 +52,25 @@ public JerseyResourceConfig() {
}
}

@PostConstruct
public void createExampleWorkflowInstance() {
workflowInstances.insertWorkflowInstance(workflowInstanceFactory.newWorkflowInstanceBuilder()
.setType(ExampleWorkflow.TYPE)
.setExternalId("example")
.putStateVariable(ExampleWorkflow.VAR_COUNTER, 0)
.build());
}

public static void main(String[] args) {
SpringApplication.run(SpringBootFullStackApplication.class, args);
}

public static class ExampleApplicationRunner implements ApplicationRunner {

@Inject
private WorkflowInstanceService workflowInstances;

@Inject
private WorkflowInstanceFactory workflowInstanceFactory;

@Override
public void run(ApplicationArguments args) {
workflowInstances.insertWorkflowInstance(workflowInstanceFactory.newWorkflowInstanceBuilder()
.setType(ExampleWorkflow.TYPE)
.setExternalId("example")
.putStateVariable(ExampleWorkflow.VAR_COUNTER, 0)
.build());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class SpringBootFullStackApplicationTests {

@Test
public void contextLoads() {
// just let SpringRunner load the context
// just check that context can be started
}

}

0 comments on commit 058f1a0

Please sign in to comment.