Skip to content

Commit

Permalink
Merge branch 'develop' into dependabot/maven/io.holunda-camunda-platf…
Browse files Browse the repository at this point in the history
…orm-7-autologin-0.1.0
  • Loading branch information
zambrovski authored Oct 17, 2023
2 parents 987887e + 0228f92 commit bfc4fa3
Show file tree
Hide file tree
Showing 95 changed files with 8,716 additions and 7,038 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ on:
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
jdk: ['11.0.5']
steps:
- name: Checkout code
uses: actions/checkout@v3
Expand All @@ -20,7 +16,7 @@ jobs:
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: ${{ matrix.jdk }}
java-version: 17
cache: maven

- name: Prepare Maven Wrapper
Expand Down
2 changes: 1 addition & 1 deletion .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.6/apache-maven-3.8.6-bin.zip
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.5/apache-maven-3.9.5-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.1/maven-wrapper-3.1.1.jar
4 changes: 2 additions & 2 deletions components/approval/backend/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.holunda.polyflow</groupId>
<artifactId>polyflow-examples-parent</artifactId>
<version>3.8.3-SNAPSHOT</version>
<version>4.0.0-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>

Expand All @@ -29,7 +29,6 @@
<dependency>
<groupId>io.holunda</groupId>
<artifactId>camunda-platform-7-autologin</artifactId>
<version>0.1.0</version>
</dependency>
<dependency>
<groupId>io.holunda.polyflow</groupId>
Expand Down Expand Up @@ -190,6 +189,7 @@
<exceptionHandler>false</exceptionHandler>
<useTags>true</useTags>
<enumPropertyNaming>UPPERCASE</enumPropertyNaming>
<useSpringBoot3>true</useSpringBoot3>
</configOptions>
</configuration>
</execution>
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,13 @@ class ProcessApproveRequestSPAConfiguration(
.allowedOrigins("http://localhost:4200")
.allowedOrigins("http://localhost:4300")
.allowedMethods(
HttpMethod.GET.name,
HttpMethod.HEAD.name,
HttpMethod.POST.name,
HttpMethod.DELETE.name,
HttpMethod.OPTIONS.name,
HttpMethod.PATCH.name,
HttpMethod.PUT.name
HttpMethod.GET.name(),
HttpMethod.HEAD.name(),
HttpMethod.POST.name(),
HttpMethod.DELETE.name(),
HttpMethod.OPTIONS.name(),
HttpMethod.PATCH.name(),
HttpMethod.PUT.name()
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ import io.holunda.polyflow.example.process.approval.process.RequestApprovalProce
import io.holunda.polyflow.example.process.approval.process.RequestApprovalProcess.Variables.ORIGINATOR
import io.holunda.polyflow.example.process.approval.process.RequestApprovalProcess.Variables.PROJECTION_REVISION
import io.holunda.polyflow.example.process.approval.process.RequestApprovalProcess.Variables.REQUEST_ID
import io.holunda.polyflow.example.process.approval.service.*
import io.holunda.polyflow.example.process.approval.service.BusinessDataEntry
import io.holunda.polyflow.example.process.approval.service.Request
import io.holunda.polyflow.example.process.approval.service.RequestService
import io.holunda.polyflow.taskpool.collector.task.TaskEventCollectorService
import org.camunda.bpm.engine.delegate.DelegateExecution
import org.camunda.bpm.engine.delegate.DelegateTask
Expand All @@ -32,7 +33,6 @@ import org.springframework.context.event.EventListener
import org.springframework.core.annotation.Order
import org.springframework.stereotype.Component
import java.time.OffsetDateTime
import java.util.*

@Component
class RequestStatusListener(
Expand Down Expand Up @@ -182,6 +182,6 @@ class RequestStatusListener(
return newRevision
}

private fun getRevision(variableScope: VariableScope): Long = PROJECTION_REVISION.from(variableScope).optional.orElseGet { 0L }
private fun getRevision(variableScope: VariableScope): Long = PROJECTION_REVISION.from(variableScope).getOrDefault(0L)

}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package io.holunda.polyflow.example.process.approval.process

import io.holunda.camunda.bpm.data.CamundaBpmDataKotlin.customVariable
import io.holunda.camunda.bpm.data.CamundaBpmData.longVariable
import io.holunda.camunda.bpm.data.CamundaBpmData.stringVariable
import io.holunda.camunda.bpm.data.CamundaBpmDataKotlin.longVariable
import io.holunda.camunda.bpm.data.CamundaBpmDataKotlin.stringVariable
import java.math.BigDecimal

object RequestApprovalProcess {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package io.holunda.polyflow.example.process.approval.process

import io.holunda.camunda.bpm.data.CamundaBpmData.builder
import io.holunda.camunda.taskpool.api.task.ProcessReference
import io.holunda.camunda.taskpool.api.task.TaskToBeCompletedEvent
import io.holunda.polyflow.example.process.approval.process.RequestApprovalProcess.Values.RESUBMIT
import io.holunda.polyflow.example.process.approval.process.RequestApprovalProcess.Variables.AMEND_ACTION
import io.holunda.polyflow.example.process.approval.process.RequestApprovalProcess.Variables.APPROVE_DECISION
Expand All @@ -13,12 +11,9 @@ import io.holunda.polyflow.example.process.approval.process.RequestApprovalProce
import io.holunda.polyflow.example.process.approval.service.Request
import io.holunda.polyflow.example.process.approval.service.RequestService
import org.axonframework.commandhandling.CommandHandler
import org.axonframework.eventhandling.gateway.EventGateway
import org.camunda.bpm.engine.RuntimeService
import org.camunda.bpm.engine.TaskService
import org.camunda.bpm.engine.task.Task
import org.camunda.bpm.engine.variable.Variables.createVariables
import org.springframework.beans.factory.annotation.Value
import org.springframework.stereotype.Component
import org.springframework.transaction.annotation.Propagation
import org.springframework.transaction.annotation.Transactional
Expand Down Expand Up @@ -78,8 +73,11 @@ class RequestApprovalProcessBean(
taskService.complete(
task.id,
builder()
.set(APPROVE_DECISION, decision.uppercase(Locale.getDefault()))
.set(COMMENT, comment)
.set(APPROVE_DECISION, decision.uppercase(Locale.getDefault())).apply {
if (comment != null) {
this.set(COMMENT, comment)
}
}
.build()
)
}
Expand Down Expand Up @@ -110,8 +108,11 @@ class RequestApprovalProcessBean(
}

val variables = builder()
.set(AMEND_ACTION, action.uppercase(Locale.getDefault()))
.set(COMMENT, comment)
.set(AMEND_ACTION, action.uppercase(Locale.getDefault())).apply {
if (comment != null) {
this.set(COMMENT, comment)
}
}


if (action == RESUBMIT) {
Expand Down Expand Up @@ -160,9 +161,13 @@ class RequestApprovalProcessBean(
.initializeFormKeys()
.singleResult() ?: throw NoSuchElementException("Task with id $taskId not found.")

val requestId = REQUEST_ID.from(runtimeService, task.executionId).optional.orElseThrow { NoSuchElementException("Request id could not be found for task $taskId") }
val requestId =
REQUEST_ID.from(runtimeService, task.executionId).getOptional().orElseThrow { NoSuchElementException("Request id could not be found for task $taskId") }
val revision =
PROJECTION_REVISION.from(runtimeService, task.executionId).optional.orElseThrow { NoSuchElementException("Project revision could not be found for task $taskId") }
PROJECTION_REVISION.from(
runtimeService,
task.executionId
).getOptional().orElseThrow { NoSuchElementException("Project revision could not be found for task $taskId") }

val request = this.requestService.getRequest(requestId, revision)
return TaskAndRequest(task = task, approvalRequest = request)
Expand Down Expand Up @@ -192,11 +197,11 @@ class RequestApprovalProcessBean(

@CommandHandler
fun changeAssignment(command: AssignmentCommand) {
command.newCandidateUsers.forEach { user -> taskService.addCandidateUser(command.taskId, user) }
command.newCandidateGroups.forEach { group -> taskService.addCandidateGroup(command.taskId, group) }
command.deleteCandidateUsers.forEach { user -> taskService.deleteCandidateUser(command.taskId, user) }
command.deleteCandidateGroups.forEach { group -> taskService.deleteCandidateGroup(command.taskId, group) }
command.deleteCandidateGroups.forEach { group -> taskService.deleteCandidateGroup(command.taskId, group) }
command.newCandidateUsers.forEach { user -> taskService.addCandidateUser(command.taskId, user) }
command.newCandidateGroups.forEach { group -> taskService.addCandidateGroup(command.taskId, group) }
command.deleteCandidateUsers.forEach { user -> taskService.deleteCandidateUser(command.taskId, user) }
command.deleteCandidateGroups.forEach { group -> taskService.deleteCandidateGroup(command.taskId, group) }
command.deleteCandidateGroups.forEach { group -> taskService.deleteCandidateGroup(command.taskId, group) }
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import io.holunda.polyflow.view.query.process.ProcessInstancesByStateQuery
import mu.KLogging
import org.axonframework.queryhandling.QueryGateway
import org.springframework.boot.ApplicationRunner
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration

Expand Down Expand Up @@ -47,6 +48,7 @@ class SystemInfoPrinter(
}
}

@ConditionalOnProperty(value = ["axon.axonserver.enabled"], havingValue = "true", matchIfMissing = false)
@Bean
fun processInstancePrinter(): ApplicationRunner {
return ApplicationRunner {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package io.holunda.polyflow.example.process.approval.service.impl.datajpa

import jakarta.persistence.Column
import jakarta.persistence.Entity
import jakarta.persistence.Id
import jakarta.persistence.Table
import java.math.BigDecimal
import javax.persistence.Column
import javax.persistence.Entity
import javax.persistence.Id
import javax.persistence.Table

@Entity
@Table(name = "APP_APPROVAL_REQUEST")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package io.holunda.polyflow.example.process.approval.service.impl.datajpa

import org.springframework.data.repository.CrudRepository
import org.springframework.data.repository.PagingAndSortingRepository

/**
* Spring Data JPA repository.
*/
interface RequestEntityRepository : PagingAndSortingRepository<RequestEntity, String>

interface RequestEntityRepository : PagingAndSortingRepository<RequestEntity, String>, CrudRepository<RequestEntity, String>
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_1j1qqbn" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="5.3.0">
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_1j1qqbn" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="5.6.0">
<bpmn:collaboration id="Collaboration_0zzop8w">
<bpmn:participant id="Participant_0sj47qc" name="Request Approval Process" processRef="process_approve_request" />
</bpmn:collaboration>
<bpmn:process id="process_approve_request" name="Request Approval" isExecutable="true" camunda:candidateStarterGroups="muppetshow, avengers">
<bpmn:process id="process_approve_request" name="Request Approval" isExecutable="true" camunda:candidateStarterGroups="muppetshow, avengers" camunda:historyTimeToLive="P1D">
<bpmn:documentation>This is a wonderful process.</bpmn:documentation>
<bpmn:startEvent id="start" camunda:asyncAfter="true" camunda:formKey="start-approval">
<bpmn:outgoing>SequenceFlow_1xw9ijb</bpmn:outgoing>
Expand Down
Loading

0 comments on commit bfc4fa3

Please sign in to comment.