Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(camunda 7.20): updated JDK 17, Spring boot 3.1.3, Camunda BPM Da… #4

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/development.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
jobs:
build:
runs-on: ubuntu-latest
name: Build and run tests on JDK 11
name: Build and run tests on JDK 17
steps:
# Checkout the code
- name: Checkout code
Expand All @@ -17,10 +17,10 @@ jobs:
run: echo ${{ github.ref }}

# Setup JDK and Maven
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 11
java-version: 17
cache: maven
distribution: 'zulu'
server-id: ossrh
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ jobs:
run: echo ${{ github.ref }}

# Setup JDK and Maven
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 11
java-version: 17
cache: maven
distribution: 'zulu'
server-id: ossrh
Expand Down
2 changes: 1 addition & 1 deletion .java-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
11.0
17.0
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import io.holunda.camunda.worker.example.infrastructure.adapter.rest.toDto
import org.springframework.http.ResponseEntity
import org.springframework.http.ResponseEntity.*
import org.springframework.web.bind.annotation.*
import javax.validation.Valid
import jakarta.validation.Valid

/**
* Rest controller to access the "approve order" use case.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ class LoadOrderWorker(

writer
.set(ORDER_TOTAL, total)
.set(ORDER, order)
.apply {
if (order != null) {
this.set(ORDER, order)
}
}

logger.info { "[LOAD ORDER]: Finished order loading, order is: $order, total is set to $total" }
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
package io.holunda.camunda.worker.impl

import org.springframework.boot.context.properties.ConfigurationProperties
import org.springframework.boot.context.properties.ConstructorBinding

/**
* Properties to set up the Camunda 7 operation mode.
*/
@ConfigurationProperties("camunda.bpm.worker")
@ConstructorBinding
data class CamundaWorker7Properties(
val taskMode: ExternalTaskMode
)

Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,9 @@ package io.holunda.camunda.worker.impl
import com.fasterxml.jackson.databind.ObjectMapper
import io.camunda.zeebe.client.ZeebeClient
import io.camunda.zeebe.spring.client.exception.ZeebeBpmnError
import io.holunda.camunda.worker.ProcessStarter
import io.holunda.camunda.worker.ServiceTaskBpmnError
import org.camunda.bpm.engine.variable.Variables
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
import org.springframework.boot.context.event.ApplicationReadyEvent
import org.springframework.context.annotation.Bean
import org.springframework.context.event.EventListener
import java.util.*

Expand Down Expand Up @@ -57,4 +54,4 @@ class Camunda8ZeebeWorkerConfiguration(
.open()
}
}
}
}
18 changes: 8 additions & 10 deletions extension/camunda-8/src/main/kotlin/impl/MapReader.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import com.fasterxml.jackson.databind.ObjectMapper
import io.holunda.camunda.bpm.data.factory.*
import io.holunda.camunda.bpm.data.reader.VariableReader
import java.math.BigDecimal
import java.time.Instant
import java.time.OffsetDateTime
import java.time.temporal.Temporal
import java.util.*

Expand All @@ -17,7 +15,7 @@ class MapReader(
private val delegateLocalToGlobal: Boolean = true
) : VariableReader {

override fun <T : Any> getOptional(variableFactory: VariableFactory<T>): Optional<T> {
override fun <T> getOptional(variableFactory: VariableFactory<T>): Optional<T> {
return Optional.ofNullable(
if (json.containsKey(variableFactory.name)) {
val variableNode = json[variableFactory.name]
Expand All @@ -30,20 +28,20 @@ class MapReader(
} else {
null
}
)
) as Optional<T>
}

override fun <T : Any> get(variableFactory: VariableFactory<T>): T {
override fun <T> get(variableFactory: VariableFactory<T>): T {
return getOptional(variableFactory).get()
}

override fun <T : Any> getLocal(variableFactory: VariableFactory<T>): T {
require(delegateLocalToGlobal) { "Access to local variables is not supported."}
override fun <T> getLocal(variableFactory: VariableFactory<T>): T {
require(delegateLocalToGlobal) { "Access to local variables is not supported." }
return getOptional(variableFactory).get()
}

override fun <T : Any> getLocalOptional(variableFactory: VariableFactory<T>): Optional<T> {
require(delegateLocalToGlobal) { "Access to local variables is not supported."}
override fun <T> getLocalOptional(variableFactory: VariableFactory<T>): Optional<T> {
require(delegateLocalToGlobal) { "Access to local variables is not supported." }
return getOptional(variableFactory)
}

Expand All @@ -60,7 +58,7 @@ class MapReader(
/**
* Is composite?
*/
private fun <T : Any> VariableFactory<T>.isComposite() =
private fun <T> VariableFactory<T>.isComposite() =
this is BasicVariableFactory
&& !this.variableClass.isPrimitive // not a primitive (int, long, float, bool)
&& !this.variableClass.isAssignableFrom(String::class.java)
Expand Down
34 changes: 17 additions & 17 deletions extension/camunda-8/src/main/kotlin/impl/MapWriter.kt
Original file line number Diff line number Diff line change
Expand Up @@ -14,67 +14,67 @@ class MapWriter(

private val writer = CamundaBpmData.writer(result)

override fun <T : Any?> setLocal(variableFactory: VariableFactory<T>?, value: T): MapWriter {
require(delegateLocalToGlobal) { "Access to local variables is not supported."}
override fun <T> setLocal(variableFactory: VariableFactory<T>, value: T): MapWriter {
require(delegateLocalToGlobal) { "Access to local variables is not supported." }
writer.set(variableFactory, value)
return this
}

override fun <T : Any?> setLocal(variableFactory: VariableFactory<T>?, value: T, isTransient: Boolean): MapWriter {
require(delegateLocalToGlobal) { "Access to local variables is not supported."}
override fun <T> setLocal(variableFactory: VariableFactory<T>, value: T, isTransient: Boolean): MapWriter {
require(delegateLocalToGlobal) { "Access to local variables is not supported." }
writer.set(variableFactory, value, isTransient)
return this
}

override fun <T : Any?> updateLocal(variableFactory: VariableFactory<T>?, valueProcessor: Function<T, T>?): MapWriter {
require(delegateLocalToGlobal) { "Access to local variables is not supported."}
override fun <T> updateLocal(variableFactory: VariableFactory<T>, valueProcessor: Function<T, T>): MapWriter {
require(delegateLocalToGlobal) { "Access to local variables is not supported." }
writer.update(variableFactory, valueProcessor)
return this
}

override fun <T : Any?> updateLocal(variableFactory: VariableFactory<T>?, valueProcessor: Function<T, T>?, isTransient: Boolean): MapWriter {
require(delegateLocalToGlobal) { "Access to local variables is not supported."}
override fun <T> updateLocal(variableFactory: VariableFactory<T>, valueProcessor: Function<T, T>, isTransient: Boolean): MapWriter {
require(delegateLocalToGlobal) { "Access to local variables is not supported." }
writer.update(variableFactory, valueProcessor, isTransient)
return this
}

override fun <T : Any?> removeLocal(variableFactory: VariableFactory<T>?): MapWriter {
require(delegateLocalToGlobal) { "Access to local variables is not supported."}
override fun <T> removeLocal(variableFactory: VariableFactory<T>): MapWriter {
require(delegateLocalToGlobal) { "Access to local variables is not supported." }
writer.remove(variableFactory)
return this
}

override fun variablesLocal(): VariableMap {
require(delegateLocalToGlobal) { "Access to local variables is not supported."}
require(delegateLocalToGlobal) { "Access to local variables is not supported." }
return writer.variables()
}

override fun <T : Any?> set(variableFactory: VariableFactory<T>?, value: T): MapWriter {
override fun <T> set(variableFactory: VariableFactory<T>, value: T): MapWriter {
writer.set(variableFactory, value)
return this
}

override fun <T : Any?> set(variableFactory: VariableFactory<T>?, value: T, isTransient: Boolean): MapWriter {
override fun <T> set(variableFactory: VariableFactory<T>, value: T, isTransient: Boolean): MapWriter {
writer.set(variableFactory, value, isTransient)
return this
}

override fun <T : Any?> update(variableFactory: VariableFactory<T>?, valueProcessor: Function<T, T>?): MapWriter {
override fun <T> update(variableFactory: VariableFactory<T>, valueProcessor: Function<T, T>): MapWriter {
writer.update(variableFactory, valueProcessor)
return this
}

override fun <T : Any?> update(variableFactory: VariableFactory<T>?, valueProcessor: Function<T, T>?, isTransient: Boolean): MapWriter {
override fun <T> update(variableFactory: VariableFactory<T>, valueProcessor: Function<T, T>, isTransient: Boolean): MapWriter {
writer.update(variableFactory, valueProcessor, isTransient)
return this
}

override fun <T : Any?> remove(variableFactory: VariableFactory<T>?): MapWriter {
override fun <T> remove(variableFactory: VariableFactory<T>): MapWriter {
writer.remove(variableFactory)
return this
}

override fun variables(): VariableMap {
return writer.variables()
}
}
}
14 changes: 7 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
<project.build.sourceEncoding>${project.encoding}</project.build.sourceEncoding>
<project.reporting.outputEncoding>${project.encoding}</project.reporting.outputEncoding>

<java.version>11</java.version>
<kotlin.version>1.8.10</kotlin.version>
<spring-boot.version>2.7.7</spring-boot.version>
<springdoc.version>1.6.14</springdoc.version>
<camunda-bpm-data.version>1.2.8</camunda-bpm-data.version>
<java.version>17</java.version>
<kotlin.version>1.9.10</kotlin.version>
<spring-boot.version>3.1.3</spring-boot.version>
<springdoc.version>1.7.0</springdoc.version>
<camunda-bpm-data.version>1.4.0</camunda-bpm-data.version>

<!-- TEST -->
<kotlin-logging.version>3.0.0</kotlin-logging.version>
Expand Down Expand Up @@ -344,7 +344,7 @@
</execution>
</executions>
<configuration>
<jdkVersion>11</jdkVersion>
<jdkVersion>17</jdkVersion>
<!--
<includes>
<include>packages.md</include>
Expand Down Expand Up @@ -512,7 +512,7 @@
<configuration>
<rules>
<requireJavaVersion>
<version>11</version>
<version>17</version>
</requireJavaVersion>
<requireMavenVersion>
<version>3.6.0</version>
Expand Down