Skip to content

Commit

Permalink
AAE-17000 Upgrade Activiti Cloud to Spring Boot 3.2 and Spring Cloud …
Browse files Browse the repository at this point in the history
…2023.0.0 (#1224)

* update activiti.version to 0.0.1-PR-4448-1485-SNAPSHOT

* update to SB 3.2.0-M3 and SC 2023.0.0-M2

* update H2 version to 2.2.224

* temporary shim JdbcMetadataStore to fix broken count query on start

* update Snakeyaml version to 2.2 as required by Spring 6.1

* apply Prettier formatting to JdbcMetadataStore

* Refactor AuthorizationConfigurer to use HttpSecurity lambda customizer

* refactor deprecated ResponseEntity getStatusCodeValue() to getStatusCode().value()

* remove deprecated Spring MVC setUseTrailingSlashMatch configurer

* refactor deprecated Java class newInstance() to getDeclaredConstructor().newInstance()

* update activiti.version to 0.0.1-PR-4448-1500-SNAPSHOT

* update activiti.version to 0.0.1-PR-4448-1501-SNAPSHOT

* update spring-boot.version to 3.2.0-RC1

* update activiti.version to 0.0.1-PR-4448-1550-SNAPSHOT

* update spring-boot.version to 2023.0.0-RC2

* update activiti.version to 0.0.1-PR-4448-1562-SNAPSHOT

* update activiti.version to 0.0.1-PR-4448-1565-SNAPSHOT

* update spring-boot.version to 3.2.0

* update activiti.version to 0.0.1-PR-4448-1618-SNAPSHOT

* AAE-16343 Enable CSRF security

* update liquibase.version to 4.24.0

* revert JdbcMetadataStore override fix

* Add Temporal Timestamp JPA date qualifier for Query entities

* Update graphql-jpa-query.version to 1.2.1

* update activiti.version to 0.0.1-PR-4448-1646-SNAPSHOT

* update spring-cloud.version to 2023.0.0

* update activiti.version to 0.0.1-PR-4448-1675-SNAPSHOT

* remove Spring Milestones repository from pom.xml

* revert everit-json-schema.version to 1.14.3

* add assertions for Date to Timestamp coercing to serialized values

* update hibernate.version to 6.3.1.Final

* Add missing Temporal import

* update activiti.version to 0.0.1-PR-4448-1690-SNAPSHOT

* Remove reference to Spring Milestones

* fix(version): update org.activiti:activiti-dependencies to 8.2.0-alpha.13

---------

Co-authored-by: Elias Ricken de Medeiros <[email protected]>
  • Loading branch information
igdianov and erdemedeiros authored Dec 19, 2023
1 parent 702d3d8 commit e188e17
Show file tree
Hide file tree
Showing 31 changed files with 157 additions and 113 deletions.
2 changes: 1 addition & 1 deletion activiti-cloud-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<name>Activiti Cloud :: Runtime API Parent</name>
<packaging>pom</packaging>
<properties>
<activiti.version>8.2.0-alpha.12</activiti.version>
<activiti.version>8.2.0-alpha.13</activiti.version>
</properties>
<modules>
<module>activiti-cloud-api-dependencies</module>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ private MessageAuditEventEntity messageAuditEventEntity(
Class<? extends MessageAuditEventEntity> clazz,
BPMNMessageEvent.MessageEvents eventType
) throws Exception {
MessageAuditEventEntity eventEntity = clazz.newInstance();
MessageAuditEventEntity eventEntity = clazz.getDeclaredConstructor().newInstance();

eventEntity.setEventId("eventId");
eventEntity.setTimestamp(System.currentTimeMillis());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
<packaging>pom</packaging>
<name>Activiti Cloud :: Dependencies Parent</name>
<properties>
<spring-cloud.version>2022.0.4</spring-cloud.version>
<spring-cloud.version>2023.0.0</spring-cloud.version>
<testcontainers.version>1.19.1</testcontainers.version>
<h2.version>2.2.220</h2.version>
<h2.version>2.2.224</h2.version>
<graphql-java.version>21.3</graphql-java.version>
<postgresql.version>42.5.1</postgresql.version>
<liquibase.version>4.20.0</liquibase.version>
<hibernate.version>6.2.7.Final</hibernate.version>
<liquibase.version>4.24.0</liquibase.version>
<hibernate.version>6.3.1.Final</hibernate.version>
</properties>
<dependencyManagement>
<dependencies>
Expand Down Expand Up @@ -79,7 +79,7 @@
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<version>2.0</version>
<version>2.2</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ public interface CloudConnectorConsumerChannels {

@InputBinding(INTEGRATION_EVENT_CONSUMER)
default SubscribableChannel integrationEventsConsumer() {
return MessageChannels.publishSubscribe(INTEGRATION_EVENT_CONSUMER).get();
return MessageChannels.publishSubscribe(INTEGRATION_EVENT_CONSUMER).getObject();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ public interface ProcessRuntimeChannels {

@OutputBinding(RUNTIME_CMD_PRODUCER)
default MessageChannel runtimeCmdProducer() {
return MessageChannels.direct(RUNTIME_CMD_PRODUCER).get();
return MessageChannels.direct(RUNTIME_CMD_PRODUCER).getObject();
}

@InputBinding(RUNTIME_CMD_RESULTS)
default SubscribableChannel runtimeCmdResults() {
return MessageChannels.publishSubscribe(RUNTIME_CMD_RESULTS).get();
return MessageChannels.publishSubscribe(RUNTIME_CMD_RESULTS).getObject();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@ public interface RuntimeMockStreams {

@InputBinding(INTEGRATION_RESULT_CONSUMER)
default SubscribableChannel integrationResultsConsumer() {
return MessageChannels.publishSubscribe(INTEGRATION_RESULT_CONSUMER).get();
return MessageChannels.publishSubscribe(INTEGRATION_RESULT_CONSUMER).getObject();
}

@OutputBinding(INTEGRATION_EVENT_PRODUCER)
default MessageChannel integrationEventsProducer() {
return MessageChannels.direct(INTEGRATION_EVENT_PRODUCER).get();
return MessageChannels.direct(INTEGRATION_EVENT_PRODUCER).getObject();
}

@InputBinding(INTEGRATION_ERROR_CONSUMER)
default SubscribableChannel integrationErrorConsumer() {
return MessageChannels.publishSubscribe(INTEGRATION_ERROR_CONSUMER).get();
return MessageChannels.publishSubscribe(INTEGRATION_ERROR_CONSUMER).getObject();
}
}
2 changes: 1 addition & 1 deletion activiti-cloud-examples/activiti-cloud-query/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

<properties>
<start-class>org.activiti.cloud.query.QueryApplication</start-class>
<graphql-java.version>19.4</graphql-java.version>
<graphql-java.version>21.1</graphql-java.version>
</properties>

<modules>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
import org.springframework.integration.config.EnableIntegration;
import org.springframework.integration.config.EnableIntegrationManagement;
import org.springframework.integration.dsl.IntegrationFlow;
import org.springframework.integration.dsl.IntegrationFlows;
import org.springframework.integration.dsl.MessageChannels;
import org.springframework.integration.handler.MessageProcessor;
import org.springframework.integration.handler.advice.IdempotentReceiverInterceptor;
Expand Down
2 changes: 1 addition & 1 deletion activiti-cloud-modeling-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<module>activiti-cloud-acceptance-tests-modeling</module>
</modules>
<properties>
<activiti.version>8.2.0-alpha.12</activiti.version>
<activiti.version>8.2.0-alpha.13</activiti.version>
<everit-json-schema.version>1.14.3</everit-json-schema.version>
<commons-collections4.version>4.4</commons-collections4.version>
<json-java.version>20231013</json-java.version>
Expand Down
2 changes: 1 addition & 1 deletion activiti-cloud-notifications-graphql-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<name>Activiti Cloud Notifications GraphQL Service :: Parent</name>
<packaging>pom</packaging>
<properties>
<graphql-jpa-query.version>1.1.5</graphql-jpa-query.version>
<graphql-jpa-query.version>1.2.1</graphql-jpa-query.version>
</properties>
<dependencyManagement>
<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@
import com.introproventures.graphql.jpa.query.autoconfigure.GraphQLSchemaBuilderAutoConfiguration;
import com.introproventures.graphql.jpa.query.schema.JavaScalars;
import graphql.GraphQL;
import java.util.Date;
import org.activiti.cloud.services.query.model.ProcessInstanceEntity;
import org.activiti.cloud.services.query.model.VariableValue;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
Expand All @@ -44,9 +42,7 @@
public class ActivitiGraphQLSchemaAutoConfiguration {

@Bean
GraphQLJPASchemaBuilderCustomizer graphQLJPASchemaBuilderCustomizer(
@Value("${activiti.cloud.graphql.jpa-query.date-format:yyyy-MM-dd'T'HH:mm:ss.SSSX}") String dateFormatString
) {
GraphQLJPASchemaBuilderCustomizer graphQLJPASchemaBuilderCustomizer() {
return builder ->
builder
.name("Query")
Expand All @@ -58,14 +54,6 @@ GraphQLJPASchemaBuilderCustomizer graphQLJPASchemaBuilderCustomizer(
.description("VariableValue type")
.coercing(new JavaScalars.GraphQLObjectCoercing())
.build()
)
.scalar(
Date.class,
newScalar()
.name("Date")
.description("Date type with '" + dateFormatString + "' format")
.coercing(new JavaScalars.GraphQLDateCoercing(dateFormatString))
.build()
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import graphql.schema.GraphQLSchema;
import java.time.Instant;
import java.util.Date;
import java.util.TimeZone;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.SpringBootApplication;
Expand Down Expand Up @@ -128,20 +127,25 @@ void correctlyDerivesPageableSchemaFromGivenEntities() {

@Test
void correctlyCoercesDateToISO8601FormatWithTimeAndZoneOffset() {
TimeZone timeZone = TimeZone.getDefault();
TimeZone.setDefault(TimeZone.getTimeZone("UTC"));
// given
Coercing<?, ?> subject = JavaScalars.of(Date.class).getCoercing();

try {
// given
Coercing<?, ?> subject = JavaScalars.of(Date.class).getCoercing();
// when
Object result = subject.serialize(Date.from(Instant.EPOCH));

// when
Object result = subject.parseValue(Date.from(Instant.EPOCH));
// then
assertThat(result).asString().isEqualTo("1970-01-01T00:00:00Z");

// when
result = subject.serialize(Date.from(Instant.parse("1970-01-01T00:00:00.000Z")));

// then
assertThat(result).asString().isEqualTo("1970-01-01T00:00:00Z");

// when
result = subject.serialize(Date.from(Instant.parse("1970-01-01T00:00:00.001Z")));

// then
assertThat(result).isEqualTo("1970-01-01T00:00:00.000Z");
} finally {
TimeZone.setDefault(timeZone);
}
// then
assertThat(result).asString().isEqualTo("1970-01-01T00:00:00.001Z");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
*/
package org.activiti.cloud.services.query.model;

import static jakarta.persistence.TemporalType.TIMESTAMP;

import com.fasterxml.jackson.annotation.JsonIgnore;
import jakarta.persistence.Basic;
import jakarta.persistence.Column;
Expand All @@ -24,6 +26,7 @@
import jakarta.persistence.JoinColumn;
import jakarta.persistence.ManyToOne;
import jakarta.persistence.MappedSuperclass;
import jakarta.persistence.Temporal;
import java.util.Date;
import java.util.Objects;
import org.activiti.cloud.api.model.shared.CloudVariableInstance;
Expand All @@ -37,9 +40,11 @@ public abstract class AbstractVariableEntity extends ActivitiEntityMetadata impl
private String name;

@DateTimeFormat(iso = DateTimeFormat.ISO.DATE)
@Temporal(TIMESTAMP)
private Date createTime;

@DateTimeFormat(iso = DateTimeFormat.ISO.DATE)
@Temporal(TIMESTAMP)
private Date lastUpdatedTime;

private String executionId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,14 @@
*/
package org.activiti.cloud.services.query.model;

import jakarta.persistence.*;
import static jakarta.persistence.TemporalType.TIMESTAMP;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.Index;
import jakarta.persistence.Table;
import jakarta.persistence.Temporal;
import java.util.Date;
import java.util.Objects;
import org.activiti.api.process.model.BPMNSequenceFlow;
Expand Down Expand Up @@ -52,6 +59,7 @@ public class BPMNSequenceFlowEntity extends ActivitiEntityMetadata implements BP
/** The date/time of the sequence flow was taken */
@Column(name = "taken_date")
@DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
@Temporal(TIMESTAMP)
private Date date;

/** The XML tag of the source activity as in the process file */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,13 @@
*/
package org.activiti.cloud.services.query.model;

import static jakarta.persistence.TemporalType.TIMESTAMP;

import jakarta.persistence.EnumType;
import jakarta.persistence.Enumerated;
import jakarta.persistence.Id;
import jakarta.persistence.MappedSuperclass;
import jakarta.persistence.Temporal;
import java.util.Date;
import java.util.Objects;
import org.activiti.cloud.api.process.model.CloudBPMNActivity.BPMNActivityStatus;
Expand Down Expand Up @@ -54,12 +57,15 @@ public abstract class BaseBPMNActivityEntity extends ActivitiEntityMetadata {
private BPMNActivityStatus status;

@DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
@Temporal(TIMESTAMP)
private Date startedDate;

@DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
@Temporal(TIMESTAMP)
private Date completedDate;

@DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
@Temporal(TIMESTAMP)
private Date cancelledDate;

/** The associated process definition key of the activity as in the process file */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
*/
package org.activiti.cloud.services.query.model;

import static jakarta.persistence.TemporalType.TIMESTAMP;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonFormat.Shape;
import com.fasterxml.jackson.annotation.JsonIgnore;
Expand All @@ -31,6 +33,7 @@
import jakarta.persistence.MapsId;
import jakarta.persistence.OneToOne;
import jakarta.persistence.Table;
import jakarta.persistence.Temporal;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
Expand Down Expand Up @@ -90,12 +93,15 @@ public class IntegrationContextEntity extends ActivitiEntityMetadata implements
private String connectorType;

@DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
@Temporal(TIMESTAMP)
private Date requestDate;

@DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
@Temporal(TIMESTAMP)
private Date resultDate;

@DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
@Temporal(TIMESTAMP)
private Date errorDate;

private String errorCode;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
*/
package org.activiti.cloud.services.query.model;

import static jakarta.persistence.TemporalType.TIMESTAMP;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonView;
import com.querydsl.core.annotations.PropertyType;
Expand All @@ -33,6 +35,7 @@
import jakarta.persistence.NamedSubgraph;
import jakarta.persistence.OneToMany;
import jakarta.persistence.Table;
import jakarta.persistence.Temporal;
import jakarta.persistence.Transient;
import java.util.Date;
import java.util.LinkedHashSet;
Expand Down Expand Up @@ -81,6 +84,7 @@ public class ProcessInstanceEntity extends ActivitiEntityMetadata implements Clo
private String initiator;

@DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
@Temporal(TIMESTAMP)
private Date startDate;

private String businessKey;
Expand All @@ -92,30 +96,37 @@ public class ProcessInstanceEntity extends ActivitiEntityMetadata implements Clo
private String processDefinitionName;

@DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
@Temporal(TIMESTAMP)
private Date completedDate;

@DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
@Temporal(TIMESTAMP)
private Date suspendedDate;

@DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
@Temporal(TIMESTAMP)
private Date lastModified;

@JsonIgnore
@DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
@Temporal(TIMESTAMP)
private Date lastModifiedTo;

@JsonIgnore
@DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
@Temporal(TIMESTAMP)
private Date lastModifiedFrom;

@JsonIgnore
@DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
@QueryType(PropertyType.DATETIME)
@Temporal(TIMESTAMP)
private Date startFrom;

@JsonIgnore
@DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
@QueryType(PropertyType.DATETIME)
@Temporal(TIMESTAMP)
private Date startTo;

@JsonIgnore
Expand Down
Loading

0 comments on commit e188e17

Please sign in to comment.