attachments) {
this.attachments = attachments;
}
+ public void setExternalReferenceId(String externalReferenceId) {
+ this.externalReferenceId = externalReferenceId;
+ }
+
+ public String getExternalReferenceId() {
+ return externalReferenceId;
+ }
+
@Override
public boolean equals(Object o) {
if (this == o) {
@@ -435,4 +445,5 @@ public int hashCode() {
return Objects.hash(id);
}
}
+
}
diff --git a/data-index/data-index-storage/data-index-storage-mongodb/src/main/java/org/kie/kogito/index/mongodb/model/UserTaskInstanceEntityMapper.java b/data-index/data-index-storage/data-index-storage-mongodb/src/main/java/org/kie/kogito/index/mongodb/model/UserTaskInstanceEntityMapper.java
index b7479af604..1a8b9add5d 100644
--- a/data-index/data-index-storage/data-index-storage-mongodb/src/main/java/org/kie/kogito/index/mongodb/model/UserTaskInstanceEntityMapper.java
+++ b/data-index/data-index-storage/data-index-storage-mongodb/src/main/java/org/kie/kogito/index/mongodb/model/UserTaskInstanceEntityMapper.java
@@ -79,6 +79,7 @@ public UserTaskInstanceEntity mapToEntity(String key, UserTaskInstance instance)
entity.setEndpoint(instance.getEndpoint());
entity.setComments(Optional.ofNullable(instance.getComments()).map(comments -> comments.stream().map(this::fromComment).collect(toList())).orElse(null));
entity.setAttachments(Optional.ofNullable(instance.getAttachments()).map(attachments -> attachments.stream().map(this::fromAttachment).collect(toList())).orElse(null));
+ entity.setExternalReferenceId(instance.getExternalReferenceId());
return entity;
}
@@ -113,6 +114,7 @@ public UserTaskInstance mapToModel(UserTaskInstanceEntity entity) {
instance.setEndpoint(entity.getEndpoint());
instance.setComments(Optional.ofNullable(entity.getComments()).map(comments -> comments.stream().map(this::toComment).collect(toList())).orElse(null));
instance.setAttachments(Optional.ofNullable(entity.getAttachments()).map(attachments -> attachments.stream().map(this::toAttachment).collect(toList())).orElse(null));
+ instance.setExternalReferenceId(entity.getExternalReferenceId());
return instance;
}
diff --git a/data-index/data-index-storage/data-index-storage-mongodb/src/test/java/org/kie/kogito/index/mongodb/model/UserTaskInstanceEntityMapperTest.java b/data-index/data-index-storage/data-index-storage-mongodb/src/test/java/org/kie/kogito/index/mongodb/model/UserTaskInstanceEntityMapperTest.java
index 9340704383..013ba7a041 100644
--- a/data-index/data-index-storage/data-index-storage-mongodb/src/test/java/org/kie/kogito/index/mongodb/model/UserTaskInstanceEntityMapperTest.java
+++ b/data-index/data-index-storage/data-index-storage-mongodb/src/test/java/org/kie/kogito/index/mongodb/model/UserTaskInstanceEntityMapperTest.java
@@ -64,6 +64,7 @@ static void setup() {
String processId = "testProcessId";
String rootProcessId = "testRootProcessId";
String rootProcessInstanceId = "testRootProcessInstanceId";
+ String externalReferenceId = "testExternalReferenceId";
ObjectNode object = MAPPER.createObjectNode();
object.put("test", "testValue");
ObjectNode inputs = object;
@@ -114,6 +115,7 @@ static void setup() {
userTaskInstance.setOutputs(outputs);
userTaskInstance.setComments(List.of(comment));
userTaskInstance.setAttachments(List.of(attachment));
+ userTaskInstance.setExternalReferenceId(externalReferenceId);
userTaskInstanceEntity = new UserTaskInstanceEntity();
userTaskInstanceEntity.setId(testId);
@@ -139,6 +141,7 @@ static void setup() {
userTaskInstanceEntity.setOutputs(jsonNodeToDocument(outputs));
userTaskInstanceEntity.setComments(List.of(commentEntity));
userTaskInstanceEntity.setAttachments(List.of(attachmentEntity));
+ userTaskInstanceEntity.setExternalReferenceId(externalReferenceId);
}
@Test
diff --git a/data-index/data-index-storage/data-index-storage-postgresql/src/main/resources/META-INF/kie-flyway.properties b/data-index/data-index-storage/data-index-storage-postgresql/src/main/resources/META-INF/kie-flyway.properties
index 383546a8fe..4adfed0d42 100644
--- a/data-index/data-index-storage/data-index-storage-postgresql/src/main/resources/META-INF/kie-flyway.properties
+++ b/data-index/data-index-storage/data-index-storage-postgresql/src/main/resources/META-INF/kie-flyway.properties
@@ -19,4 +19,4 @@
module.name=data-index
-module.locations.postgresql=classpath:kie-flyway/db/data-index/postgresql,classpath:kie-flyway/db/persistence-commons/postgresql
\ No newline at end of file
+module.locations.postgresql=classpath:kie-flyway/db/data-index/postgresql
\ No newline at end of file
diff --git a/data-index/data-index-storage/data-index-storage-postgresql/src/main/resources/kie-flyway/db/data-index/postgresql/V1.45.0.5__add_external_reference_id.sql b/data-index/data-index-storage/data-index-storage-postgresql/src/main/resources/kie-flyway/db/data-index/postgresql/V1.45.0.5__add_external_reference_id.sql
new file mode 100644
index 0000000000..908ee2b249
--- /dev/null
+++ b/data-index/data-index-storage/data-index-storage-postgresql/src/main/resources/kie-flyway/db/data-index/postgresql/V1.45.0.5__add_external_reference_id.sql
@@ -0,0 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+alter table tasks add external_reference_id varchar(4000);
diff --git a/data-index/data-index-storage/data-index-storage-postgresql/src/test/java/org/kie/kogito/index/postgresql/storage/ProcessInstanceStorageIT.java b/data-index/data-index-storage/data-index-storage-postgresql/src/test/java/org/kie/kogito/index/postgresql/storage/ProcessInstanceStorageIT.java
index 0ad8baf9b6..0ac176627c 100644
--- a/data-index/data-index-storage/data-index-storage-postgresql/src/test/java/org/kie/kogito/index/postgresql/storage/ProcessInstanceStorageIT.java
+++ b/data-index/data-index-storage/data-index-storage-postgresql/src/test/java/org/kie/kogito/index/postgresql/storage/ProcessInstanceStorageIT.java
@@ -21,10 +21,12 @@
import org.kie.kogito.index.jpa.storage.AbstractProcessInstanceStorageIT;
import org.kie.kogito.testcontainers.quarkus.PostgreSqlQuarkusTestResource;
+import io.quarkus.test.TestTransaction;
import io.quarkus.test.common.QuarkusTestResource;
import io.quarkus.test.junit.QuarkusTest;
@QuarkusTest
+@TestTransaction
@QuarkusTestResource(PostgreSqlQuarkusTestResource.class)
public class ProcessInstanceStorageIT extends AbstractProcessInstanceStorageIT {
}
diff --git a/data-index/data-index-storage/data-index-storage-postgresql/src/test/resources/application.properties b/data-index/data-index-storage/data-index-storage-postgresql/src/test/resources/application.properties
index b5637dfd64..a91fc1a378 100644
--- a/data-index/data-index-storage/data-index-storage-postgresql/src/test/resources/application.properties
+++ b/data-index/data-index-storage/data-index-storage-postgresql/src/test/resources/application.properties
@@ -25,8 +25,7 @@ quarkus.datasource.username=kogito
quarkus.datasource.password=kogito
quarkus.datasource.jdbc.url=jdbc:postgresql://localhost:5432/kogito
# Hibernate
-quarkus.hibernate-orm.database.generation=drop-and-create
-quarkus.hibernate-orm.database.generation.halt-on-error=true
+
quarkus.hibernate-orm.physical-naming-strategy=org.hibernate.boot.model.naming.CamelCaseToUnderscoresNamingStrategy
quarkus.hibernate-orm.jdbc.timezone=UTC
quarkus.hibernate-orm.log.sql=true
diff --git a/data-index/data-index-storage/data-index-storage-protobuf/src/main/resources/META-INF/kogito-index.proto b/data-index/data-index-storage/data-index-storage-protobuf/src/main/resources/META-INF/kogito-index.proto
index 18f01a6014..5c23eecefa 100644
--- a/data-index/data-index-storage/data-index-storage-protobuf/src/main/resources/META-INF/kogito-index.proto
+++ b/data-index/data-index-storage/data-index-storage-protobuf/src/main/resources/META-INF/kogito-index.proto
@@ -237,6 +237,7 @@ message UserTaskInstance {
repeated Comment comments = 23;
/* @Field(store = Store.YES) */
repeated Attachment attachments = 24;
+ optional string externalReferenceId = 25;
}
/* @Indexed */
@@ -275,6 +276,7 @@ message UserTaskInstanceMeta {
repeated Comment comments = 17;
/* @Field(store = Store.YES) */
repeated Attachment attachments = 18;
+ optional string externalReferenceId = 25;
}
/* @Indexed */
diff --git a/data-index/data-index-test-utils/src/main/java/org/kie/kogito/index/test/TestUtils.java b/data-index/data-index-test-utils/src/main/java/org/kie/kogito/index/test/TestUtils.java
index 68946a056c..600d52824e 100644
--- a/data-index/data-index-test-utils/src/main/java/org/kie/kogito/index/test/TestUtils.java
+++ b/data-index/data-index-test-utils/src/main/java/org/kie/kogito/index/test/TestUtils.java
@@ -286,6 +286,7 @@ public static UserTaskInstanceStateDataEvent getUserTaskCloudEvent(String taskId
.actualOwner(actualOwner)
.eventDate(new Date())
.processInstanceId(processInstanceId)
+ .externalReferenceId("testExternalReferenceId")
.build();
UserTaskInstanceStateDataEvent event = new UserTaskInstanceStateDataEvent(URI.create("http://localhost:8080/" + processId).toString(), null, null, body.metaData(), body);
event.setKogitoProcessId(processId);
@@ -422,6 +423,7 @@ public static UserTaskInstance getUserTaskInstance(String taskId, String process
task.setPotentialGroups(singleton("potentialGroup"));
task.setComments(List.of(Comment.builder().id("commentId" + taskId).content("Comment 1").updatedBy("kogito").build()));
task.setAttachments(List.of(Attachment.builder().id("attachmentId" + taskId).content("http://linltodoc.com/1").name("doc1").updatedBy("kogito").build()));
+ task.setExternalReferenceId("testExternalReferenceId");
return task;
}
}
diff --git a/data-index/kogito-addons-quarkus-data-index/kogito-addons-quarkus-data-index-inmemory/runtime/src/main/resources/application.properties b/data-index/kogito-addons-quarkus-data-index/kogito-addons-quarkus-data-index-inmemory/runtime/src/main/resources/application.properties
index 17182933f0..36c137123b 100644
--- a/data-index/kogito-addons-quarkus-data-index/kogito-addons-quarkus-data-index-inmemory/runtime/src/main/resources/application.properties
+++ b/data-index/kogito-addons-quarkus-data-index/kogito-addons-quarkus-data-index-inmemory/runtime/src/main/resources/application.properties
@@ -32,7 +32,7 @@ quarkus.hibernate-orm.datasource=data_index
quarkus.hibernate-orm.physical-naming-strategy=org.hibernate.boot.model.naming.CamelCaseToUnderscoresNamingStrategy
#Flyway
-quarkus.flyway."data_index".locations=classpath:/kie-flyway/db/data-index/postgresql
+quarkus.flyway."data_index".locations=classpath:/kie-flyway/db/data-index/postgresql,classpath:kie-flyway/db/persistence-commons/postgresql
quarkus.flyway."data_index".migrate-at-start=true
kie.flyway.modules."data-index".enabled=false
\ No newline at end of file
diff --git a/jitexecutor/jitexecutor-common/src/main/java/org/kie/kogito/jitexecutor/common/Constants.java b/jitexecutor/jitexecutor-common/src/main/java/org/kie/kogito/jitexecutor/common/Constants.java
index ed8079006b..17999225e6 100644
--- a/jitexecutor/jitexecutor-common/src/main/java/org/kie/kogito/jitexecutor/common/Constants.java
+++ b/jitexecutor/jitexecutor-common/src/main/java/org/kie/kogito/jitexecutor/common/Constants.java
@@ -6,9 +6,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
diff --git a/jitexecutor/jitexecutor-dmn/src/main/java/org/kie/kogito/jitexecutor/dmn/DMNEvaluator.java b/jitexecutor/jitexecutor-dmn/src/main/java/org/kie/kogito/jitexecutor/dmn/DMNEvaluator.java
index 3a7bafe229..86e68c4729 100644
--- a/jitexecutor/jitexecutor-dmn/src/main/java/org/kie/kogito/jitexecutor/dmn/DMNEvaluator.java
+++ b/jitexecutor/jitexecutor-dmn/src/main/java/org/kie/kogito/jitexecutor/dmn/DMNEvaluator.java
@@ -32,6 +32,7 @@
import org.kie.internal.io.ResourceFactory;
import org.kie.kogito.jitexecutor.common.requests.MultipleResourcesPayload;
import org.kie.kogito.jitexecutor.common.requests.ResourceWithURI;
+import org.kie.kogito.jitexecutor.dmn.responses.JITDMNResult;
import org.kie.kogito.jitexecutor.dmn.utils.ResolveByKey;
public class DMNEvaluator {
@@ -43,6 +44,7 @@ public static DMNEvaluator fromXML(String modelXML) {
Resource modelResource = ResourceFactory.newReaderResource(new StringReader(modelXML), "UTF-8");
DMNRuntime dmnRuntime = DMNRuntimeBuilder.fromDefaults().buildConfiguration()
.fromResources(Collections.singletonList(modelResource)).getOrElseThrow(RuntimeException::new);
+ dmnRuntime.addListener(new JITDMNListener());
DMNModel dmnModel = dmnRuntime.getModels().get(0);
if (dmnModel.hasErrors()) {
List messages = dmnModel.getMessages(DMNMessage.Severity.ERROR);
@@ -75,9 +77,16 @@ public Collection getAllDMNModels() {
return dmnRuntime.getModels();
}
- public DMNResult evaluate(Map context) {
- DMNContext dmnContext = new DynamicDMNContextBuilder(dmnRuntime.newContext(), dmnModel).populateContextWith(context);
- return dmnRuntime.evaluateAll(dmnModel, dmnContext);
+ public JITDMNResult evaluate(Map context) {
+ DMNContext dmnContext =
+ new DynamicDMNContextBuilder(dmnRuntime.newContext(), dmnModel).populateContextWith(context);
+ DMNResult dmnResult = dmnRuntime.evaluateAll(dmnModel, dmnContext);
+ Optional