-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
60 changed files
with
2,149 additions
and
453 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/bin/bash | ||
|
||
cd spring-boot/bare-minimum/maven | ||
|
||
if mvn install; then | ||
echo "Spring Boot bare minimum Maven builds ok" | ||
else | ||
echo "Spring Boot bare minimum Maven build failed" | ||
exit 1 | ||
fi | ||
|
||
cd ../gradle | ||
|
||
if ./gradlew build; then | ||
echo "Spring Boot bare minimum Gradle builds ok" | ||
else | ||
echo "Spring Boot bare minimum Gradle build failed" | ||
exit 1 | ||
fi | ||
|
||
cd ../../full-stack/maven | ||
|
||
if mvn install; then | ||
echo "Spring Boot full stack Maven builds ok" | ||
else | ||
echo "Spring Boot full stack Maven build failed" | ||
exit 1 | ||
fi | ||
|
||
cd ../gradle | ||
|
||
if ./gradlew build; then | ||
echo "Spring Boot full stack Gradle builds ok" | ||
else | ||
echo "Spring Boot full stack Gradle build failed" | ||
exit 1 | ||
fi | ||
|
||
cd ../../full-stack-kotlin | ||
|
||
if ./gradlew build; then | ||
echo "Spring Boot Kotlin Gradle builds ok" | ||
else | ||
echo "Spring Boot Kotlin Gradle build failed" | ||
exit 1 | ||
fi |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
HELP.md | ||
.gradle | ||
build/ | ||
!gradle/wrapper/gradle-wrapper.jar | ||
!**/src/main/**/build/ | ||
!**/src/test/**/build/ | ||
|
||
### STS ### | ||
.apt_generated | ||
.classpath | ||
.factorypath | ||
.project | ||
.settings | ||
.springBeans | ||
.sts4-cache | ||
bin/ | ||
!**/src/main/**/bin/ | ||
!**/src/test/**/bin/ | ||
|
||
### IntelliJ IDEA ### | ||
.idea | ||
*.iws | ||
*.iml | ||
*.ipr | ||
out/ | ||
!**/src/main/**/out/ | ||
!**/src/test/**/out/ | ||
|
||
### NetBeans ### | ||
/nbproject/private/ | ||
/nbbuild/ | ||
/dist/ | ||
/nbdist/ | ||
/.nb-gradle/ | ||
|
||
### VS Code ### | ||
.vscode/ |
24 changes: 24 additions & 0 deletions
24
nflow-examples/spring-boot/bare-minimum/gradle/build.gradle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
plugins { | ||
id 'org.springframework.boot' version '2.4.2' | ||
id 'io.spring.dependency-management' version '1.0.11.RELEASE' | ||
id 'java' | ||
} | ||
|
||
group = 'io.nflow.springboot.bareminimum.gradle' | ||
version = '0.0.1-SNAPSHOT' | ||
sourceCompatibility = '1.8' | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
compile("io.nflow:nflow-engine:7.2.2") | ||
implementation 'org.springframework.boot:spring-boot-starter-jdbc' | ||
runtimeOnly 'com.h2database:h2' | ||
testImplementation 'org.springframework.boot:spring-boot-starter-test' | ||
} | ||
|
||
test { | ||
useJUnitPlatform() | ||
} |
Binary file renamed
BIN
+54.3 KB
...l-stack/gradle/wrapper/gradle-wrapper.jar → .../gradle/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion
2
.../gradle/wrapper/gradle-wrapper.properties → .../gradle/wrapper/gradle-wrapper.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.7.1-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
rootProject.name = 'demo' |
43 changes: 43 additions & 0 deletions
43
...-minimum/gradle/src/main/java/io/nflow/springboot/bareminimum/gradle/DemoApplication.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package io.nflow.springboot.bareminimum.gradle; | ||
|
||
import javax.inject.Inject; | ||
|
||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
import org.springframework.boot.context.event.ApplicationReadyEvent; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Import; | ||
import org.springframework.context.event.EventListener; | ||
|
||
import io.nflow.engine.config.EngineConfiguration; | ||
import io.nflow.engine.service.WorkflowInstanceService; | ||
import io.nflow.engine.workflow.instance.WorkflowInstanceFactory; | ||
|
||
@SpringBootApplication | ||
@Import(EngineConfiguration.class) | ||
public class DemoApplication { | ||
|
||
@Inject | ||
private WorkflowInstanceService workflowInstances; | ||
|
||
@Inject | ||
private WorkflowInstanceFactory workflowInstanceFactory; | ||
|
||
@EventListener(ApplicationReadyEvent.class) | ||
public void insertWorkflowInstance() { | ||
workflowInstances.insertWorkflowInstance(workflowInstanceFactory.newWorkflowInstanceBuilder() | ||
.setType(ExampleWorkflow.TYPE) | ||
.setExternalId("example") | ||
.putStateVariable(ExampleWorkflow.VAR_COUNTER, 0) | ||
.build()); | ||
} | ||
|
||
@Bean | ||
public ExampleWorkflow exampleWorkflow() { | ||
return new ExampleWorkflow(); | ||
} | ||
|
||
public static void main(String[] args) { | ||
SpringApplication.run(DemoApplication.class, args); | ||
} | ||
} |
51 changes: 51 additions & 0 deletions
51
...-minimum/gradle/src/main/java/io/nflow/springboot/bareminimum/gradle/ExampleWorkflow.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package io.nflow.springboot.bareminimum.gradle; | ||
|
||
import org.joda.time.DateTime; | ||
|
||
import io.nflow.engine.workflow.definition.NextAction; | ||
import io.nflow.engine.workflow.definition.StateExecution; | ||
import io.nflow.engine.workflow.definition.WorkflowDefinition; | ||
import io.nflow.engine.workflow.definition.WorkflowStateType; | ||
|
||
import static io.nflow.engine.workflow.definition.WorkflowStateType.manual; | ||
import static io.nflow.engine.workflow.definition.WorkflowStateType.start; | ||
|
||
public class ExampleWorkflow extends WorkflowDefinition<ExampleWorkflow.State> { | ||
|
||
public static final String TYPE = "repeatingWorkflow"; | ||
public static final String VAR_COUNTER = "VAR_COUNTER"; | ||
|
||
public enum State implements io.nflow.engine.workflow.definition.WorkflowState { | ||
repeat(start, "Repeating state"), | ||
error(manual, "Error state"); | ||
|
||
private WorkflowStateType type; | ||
private String description; | ||
|
||
State(WorkflowStateType type, String description) { | ||
this.type = type; | ||
this.description = description; | ||
} | ||
|
||
@Override | ||
public WorkflowStateType getType() { | ||
return type; | ||
} | ||
|
||
@Override | ||
public String getDescription() { | ||
return description; | ||
} | ||
} | ||
|
||
public ExampleWorkflow() { | ||
super(TYPE, State.repeat, State.error); | ||
permit(State.repeat, State.repeat); | ||
} | ||
|
||
public NextAction repeat(StateExecution execution) { | ||
System.out.println("Counter: " + execution.getVariable(VAR_COUNTER)); | ||
execution.setVariable(VAR_COUNTER, execution.getVariable(VAR_COUNTER, Integer.class) + 1); | ||
return NextAction.moveToStateAfter(State.repeat, DateTime.now().plusSeconds(10), "Next iteration"); | ||
} | ||
} |
2 changes: 2 additions & 0 deletions
2
nflow-examples/spring-boot/bare-minimum/gradle/src/main/resources/application.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
spring.profiles.active=nflow.db.h2 | ||
logging.level.root=WARN |
Oops, something went wrong.