diff --git a/data-index/kogito-addons-quarkus-data-index-persistence/kogito-addons-quarkus-data-index-persistence-common/deployment/src/main/java/org/kie/kogito/addons/quarkus/data/index/persistence/deployment/AbstractKogitoAddonsQuarkusDataIndexPersistenceProcessor.java b/data-index/kogito-addons-quarkus-data-index-persistence/kogito-addons-quarkus-data-index-persistence-common/deployment/src/main/java/org/kie/kogito/addons/quarkus/data/index/persistence/deployment/AbstractKogitoAddonsQuarkusDataIndexPersistenceProcessor.java index e97362bb5f..1e517cb461 100644 --- a/data-index/kogito-addons-quarkus-data-index-persistence/kogito-addons-quarkus-data-index-persistence-common/deployment/src/main/java/org/kie/kogito/addons/quarkus/data/index/persistence/deployment/AbstractKogitoAddonsQuarkusDataIndexPersistenceProcessor.java +++ b/data-index/kogito-addons-quarkus-data-index-persistence/kogito-addons-quarkus-data-index-persistence-common/deployment/src/main/java/org/kie/kogito/addons/quarkus/data/index/persistence/deployment/AbstractKogitoAddonsQuarkusDataIndexPersistenceProcessor.java @@ -16,13 +16,23 @@ package org.kie.kogito.addons.quarkus.data.index.persistence.deployment; +import org.jboss.jandex.DotName; +import org.jboss.jandex.Type; import org.kie.kogito.quarkus.addons.common.deployment.KogitoCapability; import org.kie.kogito.quarkus.addons.common.deployment.OneOfCapabilityKogitoAddOnProcessor; +import io.quarkus.deployment.annotations.BuildProducer; +import io.quarkus.deployment.builditem.nativeimage.ReflectiveHierarchyBuildItem; + public abstract class AbstractKogitoAddonsQuarkusDataIndexPersistenceProcessor extends OneOfCapabilityKogitoAddOnProcessor { AbstractKogitoAddonsQuarkusDataIndexPersistenceProcessor() { super(KogitoCapability.SERVERLESS_WORKFLOW, KogitoCapability.PROCESSES); } + protected void reflectiveHierarchy(Class clazz, BuildProducer reflectiveHierarchyClass) { + DotName dotName = DotName.createSimple(clazz.getName()); + Type type = Type.create(dotName, Type.Kind.CLASS); + reflectiveHierarchyClass.produce(new ReflectiveHierarchyBuildItem.Builder().type(type).build()); + } } diff --git a/data-index/kogito-addons-quarkus-data-index-persistence/kogito-addons-quarkus-data-index-persistence-mongodb/deployment/pom.xml b/data-index/kogito-addons-quarkus-data-index-persistence/kogito-addons-quarkus-data-index-persistence-mongodb/deployment/pom.xml new file mode 100644 index 0000000000..0575370af4 --- /dev/null +++ b/data-index/kogito-addons-quarkus-data-index-persistence/kogito-addons-quarkus-data-index-persistence-mongodb/deployment/pom.xml @@ -0,0 +1,42 @@ + + + 4.0.0 + + org.kie.kogito + kogito-addons-quarkus-data-index-persistence-mongodb-parent + 2.0.0-SNAPSHOT + + kogito-addons-quarkus-data-index-persistence-mongodb-deployment + Kogito Apps :: Kogito Addons Quarkus Data Index Persistence MongoDB :: Deployment + + + org.kie.kogito + kogito-addons-quarkus-data-index-persistence-common-deployment + + + org.kie.kogito + kogito-addons-quarkus-data-index-persistence-mongodb + + + io.quarkus + quarkus-mongodb-client-deployment + + + + + + maven-compiler-plugin + + + + io.quarkus + quarkus-extension-processor + ${version.io.quarkus} + + + + + + + diff --git a/data-index/kogito-addons-quarkus-data-index-persistence/kogito-addons-quarkus-data-index-persistence-mongodb/deployment/src/main/java/org/kie/kogito/addons/quarkus/data/index/persistence/deployment/MongoDataIndexPersistenceProcessor.java b/data-index/kogito-addons-quarkus-data-index-persistence/kogito-addons-quarkus-data-index-persistence-mongodb/deployment/src/main/java/org/kie/kogito/addons/quarkus/data/index/persistence/deployment/MongoDataIndexPersistenceProcessor.java new file mode 100644 index 0000000000..8a152d857f --- /dev/null +++ b/data-index/kogito-addons-quarkus-data-index-persistence/kogito-addons-quarkus-data-index-persistence-mongodb/deployment/src/main/java/org/kie/kogito/addons/quarkus/data/index/persistence/deployment/MongoDataIndexPersistenceProcessor.java @@ -0,0 +1,45 @@ +/* + * Copyright 2023 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.kogito.addons.quarkus.data.index.persistence.deployment; + +import org.kie.kogito.index.mongodb.model.ProcessDefinitionEntity; +import org.kie.kogito.index.mongodb.model.ProcessInstanceEntity; +import org.kie.kogito.index.mongodb.model.UserTaskInstanceEntity; + +import io.quarkus.deployment.annotations.BuildProducer; +import io.quarkus.deployment.annotations.BuildStep; +import io.quarkus.deployment.builditem.FeatureBuildItem; +import io.quarkus.deployment.builditem.nativeimage.ReflectiveHierarchyBuildItem; +import io.quarkus.deployment.pkg.steps.NativeOrNativeSourcesBuild; + +public class MongoDataIndexPersistenceProcessor extends AbstractKogitoAddonsQuarkusDataIndexPersistenceProcessor { + + private static final String FEATURE = "kogito-addons-quarkus-data-index-persistence-mongodb"; + + @BuildStep + public FeatureBuildItem feature() { + return new FeatureBuildItem(FEATURE); + } + + @BuildStep(onlyIf = NativeOrNativeSourcesBuild.class) + public void mongoNativeResources(BuildProducer reflectiveHierarchyClass) { + reflectiveHierarchy(ProcessDefinitionEntity.class, reflectiveHierarchyClass); + reflectiveHierarchy(ProcessInstanceEntity.class, reflectiveHierarchyClass); + reflectiveHierarchy(UserTaskInstanceEntity.class, reflectiveHierarchyClass); + } + +} diff --git a/data-index/kogito-addons-quarkus-data-index-persistence/kogito-addons-quarkus-data-index-persistence-mongodb/integration-tests-process/pom.xml b/data-index/kogito-addons-quarkus-data-index-persistence/kogito-addons-quarkus-data-index-persistence-mongodb/integration-tests-process/pom.xml new file mode 100644 index 0000000000..9deb641f74 --- /dev/null +++ b/data-index/kogito-addons-quarkus-data-index-persistence/kogito-addons-quarkus-data-index-persistence-mongodb/integration-tests-process/pom.xml @@ -0,0 +1,93 @@ + + + 4.0.0 + + org.kie.kogito + kogito-addons-quarkus-data-index-persistence-mongodb-parent + 2.0.0-SNAPSHOT + + kogito-addons-quarkus-data-index-mongodb-persistence-integration-tests-process + Kogito Apps :: Kogito Addons Quarkus Data Index Persistence MongoDB :: Integration Tests :: Process + + + + org.kie.kogito + kogito-quarkus-processes + + + io.quarkus + quarkus-resteasy + + + io.quarkus + quarkus-resteasy-jackson + + + org.kie.kogito + kogito-addons-quarkus-persistence-mongodb + + + org.kie.kogito + kogito-addons-quarkus-data-index-persistence-mongodb + + + org.kie.kogito + data-index-test-utils + test + + + io.quarkus + quarkus-junit5 + test + + + io.rest-assured + rest-assured + test + + + org.kie.kogito + kogito-addons-quarkus-data-index-persistence-mongodb-deployment + ${project.version} + pom + test + + + * + * + + + + + + + + io.quarkus + quarkus-maven-plugin + ${version.io.quarkus} + + + + build + + + + + + + + + native + + + native + + + + native + **/*IT.java + + + + diff --git a/data-index/kogito-addons-quarkus-data-index-persistence/kogito-addons-quarkus-data-index-persistence-mongodb/integration-tests-process/src/main/resources/application.properties b/data-index/kogito-addons-quarkus-data-index-persistence/kogito-addons-quarkus-data-index-persistence-mongodb/integration-tests-process/src/main/resources/application.properties new file mode 100644 index 0000000000..9fbe160fc4 --- /dev/null +++ b/data-index/kogito-addons-quarkus-data-index-persistence/kogito-addons-quarkus-data-index-persistence-mongodb/integration-tests-process/src/main/resources/application.properties @@ -0,0 +1,6 @@ +kogito.persistence.type=mongodb + +# MongoDB +quarkus.mongodb.database=kogito + +quarkus.devservices.enabled=false \ No newline at end of file diff --git a/data-index/kogito-addons-quarkus-data-index-persistence/kogito-addons-quarkus-data-index-persistence-mongodb/integration-tests-process/src/main/resources/hello.bpmn b/data-index/kogito-addons-quarkus-data-index-persistence/kogito-addons-quarkus-data-index-persistence-mongodb/integration-tests-process/src/main/resources/hello.bpmn new file mode 100644 index 0000000000..939c411bbd --- /dev/null +++ b/data-index/kogito-addons-quarkus-data-index-persistence/kogito-addons-quarkus-data-index-persistence-mongodb/integration-tests-process/src/main/resources/hello.bpmn @@ -0,0 +1,47 @@ + + + + + + + + + _9FD38FF8-A530-41E7-8EA0-E1F71353CBB3 + + + _9FD38FF8-A530-41E7-8EA0-E1F71353CBB3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + _hT2oIPJzEDuE8tm0q8uK_w + _hT2oIPJzEDuE8tm0q8uK_w + + \ No newline at end of file diff --git a/data-index/kogito-addons-quarkus-data-index-persistence/kogito-addons-quarkus-data-index-persistence-mongodb/integration-tests-process/src/test/java/org/kie/kogito/addons/quarkus/data/index/it/MongoQuarkusAddonDataIndexPersistenceIT.java b/data-index/kogito-addons-quarkus-data-index-persistence/kogito-addons-quarkus-data-index-persistence-mongodb/integration-tests-process/src/test/java/org/kie/kogito/addons/quarkus/data/index/it/MongoQuarkusAddonDataIndexPersistenceIT.java new file mode 100644 index 0000000000..ab4cd564ba --- /dev/null +++ b/data-index/kogito-addons-quarkus-data-index-persistence/kogito-addons-quarkus-data-index-persistence-mongodb/integration-tests-process/src/test/java/org/kie/kogito/addons/quarkus/data/index/it/MongoQuarkusAddonDataIndexPersistenceIT.java @@ -0,0 +1,87 @@ +/* + * Copyright 2023 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.kogito.addons.quarkus.data.index.it; + +import org.junit.jupiter.api.Test; +import org.kie.kogito.index.test.quarkus.http.DataIndexMongoDBHttpQuarkusTestResource; +import org.kie.kogito.test.quarkus.QuarkusTestProperty; + +import io.quarkus.test.common.QuarkusTestResource; +import io.quarkus.test.junit.QuarkusIntegrationTest; +import io.restassured.RestAssured; +import io.restassured.http.ContentType; + +import static io.restassured.RestAssured.given; +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.CoreMatchers.notNullValue; +import static org.hamcrest.Matchers.greaterThanOrEqualTo; +import static org.kie.kogito.index.test.Constants.KOGITO_DATA_INDEX_SERVICE_URL; + +@QuarkusIntegrationTest +@QuarkusTestResource(DataIndexMongoDBHttpQuarkusTestResource.class) +class MongoQuarkusAddonDataIndexPersistenceIT { + + static { + RestAssured.enableLoggingOfRequestAndResponseIfValidationFails(); + } + + @QuarkusTestProperty(name = KOGITO_DATA_INDEX_SERVICE_URL) + String dataIndex; + + @Test + void testDataIndexAddon() { + given().contentType(ContentType.JSON) + .baseUri(dataIndex) + .body("{ \"query\" : \"{ProcessInstances{ id } }\" }") + .when().post("/graphql") + .then().statusCode(200) + .body("data.ProcessInstances.size()", is(greaterThanOrEqualTo(0))); + + String processInstanceId = given() + .contentType(ContentType.JSON) + .accept(ContentType.JSON) + .post("/hello") + .then() + .statusCode(201) + .body("id", is(notNullValue())) + .extract().path("id"); + + given().contentType(ContentType.JSON) + .baseUri(dataIndex) + .body("{ \"query\" : \"{ProcessInstances(where: { id: {equal: \\\"" + processInstanceId + "\\\"}}){ id, state } }\" }") + .when().post("/graphql") + .then().statusCode(200) + .body("data.ProcessInstances.size()", is(1)) + .body("data.ProcessInstances[0].id", is(processInstanceId)) + .body("data.ProcessInstances[0].state", is("COMPLETED")); + } + + @Test + void testGraphQL() { + given().contentType(ContentType.HTML) + .when().get("/graphql") + .then().statusCode(404); + } + + @Test + void testGraphQLUI() { + given().contentType(ContentType.HTML) + .when().get("/q/graphql-ui/") + .then().statusCode(404); + } + +} diff --git a/data-index/kogito-addons-quarkus-data-index-persistence/kogito-addons-quarkus-data-index-persistence-mongodb/integration-tests-sw/pom.xml b/data-index/kogito-addons-quarkus-data-index-persistence/kogito-addons-quarkus-data-index-persistence-mongodb/integration-tests-sw/pom.xml new file mode 100644 index 0000000000..06d1ebfa9b --- /dev/null +++ b/data-index/kogito-addons-quarkus-data-index-persistence/kogito-addons-quarkus-data-index-persistence-mongodb/integration-tests-sw/pom.xml @@ -0,0 +1,93 @@ + + + 4.0.0 + + org.kie.kogito + kogito-addons-quarkus-data-index-persistence-mongodb-parent + 2.0.0-SNAPSHOT + + kogito-addons-quarkus-data-index-persistence-mongodb-integration-tests-sw + Kogito Apps :: Kogito Addons Quarkus Data Index Persistence MongoDB :: Integration Tests :: SW + + + + org.kie.kogito + kogito-quarkus-serverless-workflow + + + io.quarkus + quarkus-resteasy + + + io.quarkus + quarkus-resteasy-jackson + + + org.kie.kogito + kogito-addons-quarkus-persistence-mongodb + + + org.kie.kogito + kogito-addons-quarkus-data-index-persistence-mongodb + + + org.kie.kogito + data-index-test-utils + test + + + io.quarkus + quarkus-junit5 + test + + + io.rest-assured + rest-assured + test + + + org.kie.kogito + kogito-addons-quarkus-data-index-persistence-mongodb-deployment + ${project.version} + pom + test + + + * + * + + + + + + + + io.quarkus + quarkus-maven-plugin + ${version.io.quarkus} + + + + build + + + + + + + + + native + + + native + + + + native + **/*IT.java + + + + diff --git a/data-index/kogito-addons-quarkus-data-index-persistence/kogito-addons-quarkus-data-index-persistence-mongodb/integration-tests-sw/src/main/resources/application.properties b/data-index/kogito-addons-quarkus-data-index-persistence/kogito-addons-quarkus-data-index-persistence-mongodb/integration-tests-sw/src/main/resources/application.properties new file mode 100644 index 0000000000..9fbe160fc4 --- /dev/null +++ b/data-index/kogito-addons-quarkus-data-index-persistence/kogito-addons-quarkus-data-index-persistence-mongodb/integration-tests-sw/src/main/resources/application.properties @@ -0,0 +1,6 @@ +kogito.persistence.type=mongodb + +# MongoDB +quarkus.mongodb.database=kogito + +quarkus.devservices.enabled=false \ No newline at end of file diff --git a/data-index/kogito-addons-quarkus-data-index-persistence/kogito-addons-quarkus-data-index-persistence-mongodb/integration-tests-sw/src/main/resources/greet.sw.json b/data-index/kogito-addons-quarkus-data-index-persistence/kogito-addons-quarkus-data-index-persistence-mongodb/integration-tests-sw/src/main/resources/greet.sw.json new file mode 100644 index 0000000000..a849f440e1 --- /dev/null +++ b/data-index/kogito-addons-quarkus-data-index-persistence/kogito-addons-quarkus-data-index-persistence-mongodb/integration-tests-sw/src/main/resources/greet.sw.json @@ -0,0 +1,71 @@ +{ + "id": "greet", + "version": "1.0", + "name": "Greeting workflow", + "expressionLang": "jsonpath", + "description": "JSON based greeting workflow", + "start": "ChooseOnLanguage", + "functions": [ + { + "name": "greetFunction", + "type": "custom", + "operation": "sysout" + }, + { + "name": "isEnglish", + "type": "expression", + "operation" : "$.[?(@.language == 'English')]" + } + ], + "states": [ + { + "name": "ChooseOnLanguage", + "type": "switch", + "dataConditions": [ + { + "condition": "fn:isEnglish", + "transition": "GreetInEnglish" + }, + { + "condition": "${ $.[?(@.language == 'Spanish')] }", + "transition": "GreetInSpanish" + } + ], + "defaultCondition": { + "transition": "GreetInEnglish" + } + }, + { + "name": "GreetInEnglish", + "type": "inject", + "data": { + "greeting": "Hello from JSON Workflow," + }, + "transition": "GreetPerson" + }, + { + "name": "GreetInSpanish", + "type": "inject", + "data": { + "greeting": "Saludos desde JSON Workflow," + }, + "transition": "GreetPerson" + }, + { + "name": "GreetPerson", + "type": "operation", + "actions": [ + { + "name": "greetAction", + "functionRef": { + "refName": "greetFunction", + "arguments": { + "message": "$.greeting $.name" + } + } + } + ], + "end": true + } + ] +} \ No newline at end of file diff --git a/data-index/kogito-addons-quarkus-data-index-persistence/kogito-addons-quarkus-data-index-persistence-mongodb/integration-tests-sw/src/test/java/org/kie/kogito/addons/quarkus/data/index/it/MongoQuarkusAddonDataIndexPersistenceIT.java b/data-index/kogito-addons-quarkus-data-index-persistence/kogito-addons-quarkus-data-index-persistence-mongodb/integration-tests-sw/src/test/java/org/kie/kogito/addons/quarkus/data/index/it/MongoQuarkusAddonDataIndexPersistenceIT.java new file mode 100644 index 0000000000..5f8e65cb9e --- /dev/null +++ b/data-index/kogito-addons-quarkus-data-index-persistence/kogito-addons-quarkus-data-index-persistence-mongodb/integration-tests-sw/src/test/java/org/kie/kogito/addons/quarkus/data/index/it/MongoQuarkusAddonDataIndexPersistenceIT.java @@ -0,0 +1,87 @@ +/* + * Copyright 2022 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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. + */ + +package org.kie.kogito.addons.quarkus.data.index.it; + +import org.junit.jupiter.api.Test; +import org.kie.kogito.index.test.quarkus.http.DataIndexMongoDBHttpQuarkusTestResource; +import org.kie.kogito.test.quarkus.QuarkusTestProperty; + +import io.quarkus.test.common.QuarkusTestResource; +import io.quarkus.test.junit.QuarkusIntegrationTest; +import io.restassured.RestAssured; +import io.restassured.http.ContentType; + +import static io.restassured.RestAssured.given; +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.Matchers.greaterThanOrEqualTo; +import static org.kie.kogito.index.test.Constants.KOGITO_DATA_INDEX_SERVICE_URL; + +@QuarkusIntegrationTest +@QuarkusTestResource(DataIndexMongoDBHttpQuarkusTestResource.class) +class MongoQuarkusAddonDataIndexPersistenceIT { + + static { + RestAssured.enableLoggingOfRequestAndResponseIfValidationFails(); + } + + @QuarkusTestProperty(name = KOGITO_DATA_INDEX_SERVICE_URL) + String dataIndex; + + @Test + void testDataIndexAddon() { + given().contentType(ContentType.JSON) + .baseUri(dataIndex) + .body("{ \"query\" : \"{ProcessInstances{ id } }\" }") + .when().post("/graphql") + .then().statusCode(200) + .body("data.ProcessInstances.size()", is(greaterThanOrEqualTo(0))); + + String processInstanceId = given() + .contentType(ContentType.JSON) + .accept(ContentType.JSON) + .body("{\"workflowdata\" : {\"name\" : \"John\", \"language\":\"English\"}}").when() + .post("/greet") + .then() + .statusCode(201) + .body("workflowdata.greeting", is("Hello from JSON Workflow,")) + .extract().path("id"); + + given().contentType(ContentType.JSON) + .baseUri(dataIndex) + .body("{ \"query\" : \"{ProcessInstances(where: { id: {equal: \\\"" + processInstanceId + "\\\"}}){ id, state } }\" }") + .when().post("/graphql") + .then().statusCode(200) + .body("data.ProcessInstances.size()", is(1)) + .body("data.ProcessInstances[0].id", is(processInstanceId)) + .body("data.ProcessInstances[0].state", is("COMPLETED")); + } + + @Test + void testGraphQL() { + given().contentType(ContentType.HTML) + .when().get("/graphql") + .then().statusCode(404); + } + + @Test + void testGraphQLUI() { + given().contentType(ContentType.HTML) + .when().get("/q/graphql-ui/") + .then().statusCode(404); + } + +} diff --git a/data-index/kogito-addons-quarkus-data-index-persistence/kogito-addons-quarkus-data-index-persistence-mongodb/pom.xml b/data-index/kogito-addons-quarkus-data-index-persistence/kogito-addons-quarkus-data-index-persistence-mongodb/pom.xml new file mode 100644 index 0000000000..b9299577f4 --- /dev/null +++ b/data-index/kogito-addons-quarkus-data-index-persistence/kogito-addons-quarkus-data-index-persistence-mongodb/pom.xml @@ -0,0 +1,22 @@ + + + 4.0.0 + + org.kie.kogito + kogito-addons-quarkus-data-index-persistence + 2.0.0-SNAPSHOT + + kogito-addons-quarkus-data-index-persistence-mongodb-parent + pom + + Kogito Apps :: Kogito Addons Quarkus Data Index Persistence MongoDB + + + deployment + runtime + integration-tests-sw + integration-tests-process + + + diff --git a/data-index/kogito-addons-quarkus-data-index-persistence/kogito-addons-quarkus-data-index-persistence-mongodb/runtime/pom.xml b/data-index/kogito-addons-quarkus-data-index-persistence/kogito-addons-quarkus-data-index-persistence-mongodb/runtime/pom.xml new file mode 100644 index 0000000000..56f0defaf7 --- /dev/null +++ b/data-index/kogito-addons-quarkus-data-index-persistence/kogito-addons-quarkus-data-index-persistence-mongodb/runtime/pom.xml @@ -0,0 +1,57 @@ + + + 4.0.0 + + org.kie.kogito + kogito-addons-quarkus-data-index-persistence-mongodb-parent + 2.0.0-SNAPSHOT + + kogito-addons-quarkus-data-index-persistence-mongodb + Kogito Apps :: Kogito Addons Quarkus Data Index Persistence MongoDB :: Runtime + + + org.kie.kogito + kogito-addons-quarkus-data-index-persistence-common-runtime + + + org.kie.kogito + data-index-storage-mongodb + + + + + + io.quarkus + quarkus-extension-maven-plugin + ${version.io.quarkus} + + + compile + + extension-descriptor + + + ${project.groupId}:${project.artifactId}-deployment:${project.version} + + org.kie.kogito.data-index.persistence + + + + + + + maven-compiler-plugin + + + + io.quarkus + quarkus-extension-processor + ${version.io.quarkus} + + + + + + + diff --git a/data-index/kogito-addons-quarkus-data-index-persistence/kogito-addons-quarkus-data-index-persistence-mongodb/runtime/src/main/resources/META-INF/quarkus-extension.yaml b/data-index/kogito-addons-quarkus-data-index-persistence/kogito-addons-quarkus-data-index-persistence-mongodb/runtime/src/main/resources/META-INF/quarkus-extension.yaml new file mode 100644 index 0000000000..6fa0a2e1e2 --- /dev/null +++ b/data-index/kogito-addons-quarkus-data-index-persistence/kogito-addons-quarkus-data-index-persistence-mongodb/runtime/src/main/resources/META-INF/quarkus-extension.yaml @@ -0,0 +1,9 @@ +name: Kogito Addons Quarkus Data Index Persistence MongoDB +description: Kogito Data Index Persistence MongoDB Add-On +metadata: + keywords: + - data-index + - kogito + guide: https://quarkus.io/guides/kogito + categories: + - "business-automation" \ No newline at end of file diff --git a/data-index/kogito-addons-quarkus-data-index-persistence/kogito-addons-quarkus-data-index-persistence-mongodb/runtime/src/main/resources/application.properties b/data-index/kogito-addons-quarkus-data-index-persistence/kogito-addons-quarkus-data-index-persistence-mongodb/runtime/src/main/resources/application.properties new file mode 100644 index 0000000000..8eb5c97876 --- /dev/null +++ b/data-index/kogito-addons-quarkus-data-index-persistence/kogito-addons-quarkus-data-index-persistence-mongodb/runtime/src/main/resources/application.properties @@ -0,0 +1,2 @@ +#Data Index +kogito.apps.persistence.type=mongodb \ No newline at end of file diff --git a/data-index/kogito-addons-quarkus-data-index-persistence/pom.xml b/data-index/kogito-addons-quarkus-data-index-persistence/pom.xml index 16a04a371f..2f7903a121 100644 --- a/data-index/kogito-addons-quarkus-data-index-persistence/pom.xml +++ b/data-index/kogito-addons-quarkus-data-index-persistence/pom.xml @@ -26,6 +26,7 @@ kogito-addons-quarkus-data-index-persistence-infinispan + kogito-addons-quarkus-data-index-persistence-mongodb diff --git a/data-index/kogito-addons-quarkus-data-index/kogito-addons-quarkus-data-index-mongodb/deployment/pom.xml b/data-index/kogito-addons-quarkus-data-index/kogito-addons-quarkus-data-index-mongodb/deployment/pom.xml index 1b99c6dc9c..0ed4623487 100644 --- a/data-index/kogito-addons-quarkus-data-index/kogito-addons-quarkus-data-index-mongodb/deployment/pom.xml +++ b/data-index/kogito-addons-quarkus-data-index/kogito-addons-quarkus-data-index-mongodb/deployment/pom.xml @@ -16,11 +16,11 @@ org.kie.kogito - kogito-addons-quarkus-data-index-mongodb + kogito-addons-quarkus-data-index-persistence-mongodb-deployment - io.quarkus - quarkus-mongodb-client-deployment + org.kie.kogito + kogito-addons-quarkus-data-index-mongodb io.quarkus @@ -30,11 +30,6 @@ io.quarkus quarkus-reactive-routes-deployment - - io.quarkus - quarkus-junit5-internal - test - diff --git a/data-index/kogito-addons-quarkus-data-index/kogito-addons-quarkus-data-index-mongodb/deployment/src/main/java/org/kie/kogito/addons/quarkus/data/index/deployment/MongoDataIndexProcessor.java b/data-index/kogito-addons-quarkus-data-index/kogito-addons-quarkus-data-index-mongodb/deployment/src/main/java/org/kie/kogito/addons/quarkus/data/index/deployment/MongoDataIndexProcessor.java index b0616cae30..d724534128 100644 --- a/data-index/kogito-addons-quarkus-data-index/kogito-addons-quarkus-data-index-mongodb/deployment/src/main/java/org/kie/kogito/addons/quarkus/data/index/deployment/MongoDataIndexProcessor.java +++ b/data-index/kogito-addons-quarkus-data-index/kogito-addons-quarkus-data-index-mongodb/deployment/src/main/java/org/kie/kogito/addons/quarkus/data/index/deployment/MongoDataIndexProcessor.java @@ -16,15 +16,8 @@ package org.kie.kogito.addons.quarkus.data.index.deployment; -import org.kie.kogito.index.mongodb.model.ProcessDefinitionEntity; -import org.kie.kogito.index.mongodb.model.ProcessInstanceEntity; -import org.kie.kogito.index.mongodb.model.UserTaskInstanceEntity; - -import io.quarkus.deployment.annotations.BuildProducer; import io.quarkus.deployment.annotations.BuildStep; import io.quarkus.deployment.builditem.FeatureBuildItem; -import io.quarkus.deployment.builditem.nativeimage.ReflectiveHierarchyBuildItem; -import io.quarkus.deployment.pkg.steps.NativeOrNativeSourcesBuild; public class MongoDataIndexProcessor extends AbstractKogitoAddonsQuarkusDataIndexProcessor { @@ -35,11 +28,4 @@ public FeatureBuildItem feature() { return new FeatureBuildItem(FEATURE); } - @BuildStep(onlyIf = NativeOrNativeSourcesBuild.class) - public void mongoNativeResources(BuildProducer reflectiveHierarchyClass) { - reflectiveHierarchy(ProcessDefinitionEntity.class, reflectiveHierarchyClass); - reflectiveHierarchy(ProcessInstanceEntity.class, reflectiveHierarchyClass); - reflectiveHierarchy(UserTaskInstanceEntity.class, reflectiveHierarchyClass); - } - } diff --git a/data-index/kogito-addons-quarkus-data-index/kogito-addons-quarkus-data-index-mongodb/pom.xml b/data-index/kogito-addons-quarkus-data-index/kogito-addons-quarkus-data-index-mongodb/pom.xml index ee47aaafdd..de1658a77f 100644 --- a/data-index/kogito-addons-quarkus-data-index/kogito-addons-quarkus-data-index-mongodb/pom.xml +++ b/data-index/kogito-addons-quarkus-data-index/kogito-addons-quarkus-data-index-mongodb/pom.xml @@ -16,20 +16,7 @@ deployment runtime integration-tests-sw + integration-tests-process - - - default - - - !productized - - - - integration-tests-process - - - - diff --git a/data-index/kogito-addons-quarkus-data-index/kogito-addons-quarkus-data-index-mongodb/runtime/pom.xml b/data-index/kogito-addons-quarkus-data-index/kogito-addons-quarkus-data-index-mongodb/runtime/pom.xml index 7234cdc6b6..49b7fada24 100644 --- a/data-index/kogito-addons-quarkus-data-index/kogito-addons-quarkus-data-index-mongodb/runtime/pom.xml +++ b/data-index/kogito-addons-quarkus-data-index/kogito-addons-quarkus-data-index-mongodb/runtime/pom.xml @@ -16,7 +16,7 @@ org.kie.kogito - data-index-storage-mongodb + kogito-addons-quarkus-data-index-persistence-mongodb io.quarkus