diff --git a/kogito-quarkus-examples/process-instance-migration-quarkus/README.md b/kogito-quarkus-examples/process-instance-migration-quarkus/README.md index 098d29480e..9f12a1b6a1 100644 --- a/kogito-quarkus-examples/process-instance-migration-quarkus/README.md +++ b/kogito-quarkus-examples/process-instance-migration-quarkus/README.md @@ -51,7 +51,6 @@ And when using native image compilation, you will also need: This quickstart provides a docker compose template that starts all the required services. This setup ensures that all services are connected with a default configuration. - PostgreSQL: 5432 -- Data Index: 8180 - PgAdmin: 8055 - Kogito Process Instance Migration Service: 8080 @@ -167,6 +166,15 @@ The response will contain information about the migration: } ``` +Alternatively, use the following endpoint to migrate just a single process instance: +```bash +curl -H "Content-Type: application/json" -H "Accept: application/json" -X POST http://localhost:8080/management/processes/simple/instances/2a507f63-9db1-4d15-b64c-9e14f922d470/migrate -d '{ + "targetProcessId": "modified", + "targetProcessVersion": "1.0" +}' +``` + + Note that the invocation of the `migrate` endpoint is the first step of the PIM functionality. It flags the selected process instance(s) as migrated to the defined target process definition. The second step of the migration will happen the next time the process instance is unmarshalled. This would be the case when the process instance is triggered to continue its execution. If you want to test whether this unmarshalling step is successful after the migration, the following PUT call can be used without triggering the execution of the process instance: ```bash curl -H "Content-Type: application/json" -H "Accept: application/json" -X PUT http://localhost:8080/modified/2a507f63-9db1-4d15-b64c-9e14f922d470 -d '{}' diff --git a/kogito-quarkus-examples/process-instance-migration-quarkus/docker-compose/README.md b/kogito-quarkus-examples/process-instance-migration-quarkus/docker-compose/README.md index d12f83a931..de3b959186 100644 --- a/kogito-quarkus-examples/process-instance-migration-quarkus/docker-compose/README.md +++ b/kogito-quarkus-examples/process-instance-migration-quarkus/docker-compose/README.md @@ -3,12 +3,11 @@ To allow a quick setup of all services required to run this demo, we provide a docker compose template that starts the following services: - Postgresql - PgAdmin -- Kogito Data Index -- Kogito Process Instance Migration Service (Only available if the example has been compiled using the `container` mvn profile eg: ```mvn cleanp package -Dcontainer```) +- Kogito Process Instance Migration Service (Only available if the example has been compiled using the `container` mvn profile eg: ```mvn clean package -Pcontainer```) The docker compose template provides three profiles to enable starting only the set of services you want to use. The profiles are: -- **infra**: Starts only the minimal infrastructure to run the example (Postgresql, pgadmin, Kogito Data Index) -- **example**: Starts the services in *infra* profile and the Kogito Example Service. Requires the example to be compiled using the `container` mvn profile eg: ```mvn cleanp package -Dcontainer```. +- **infra**: Starts only the minimal infrastructure to run the example (Postgresql, pgadmin) +- **example**: Starts the services in *infra* profile and the Kogito Example Service. Requires the example to be compiled using the `container` mvn profile eg: ```mvn clean package -Pcontainer```. > NOTE: In order to use it, please ensure you have Docker Compose installed on your machine, otherwise follow the instructions available in [here](https://docs.docker.com/compose/install/). @@ -25,7 +24,6 @@ sh startServices.sh example Once the services are started (depending on the profile), the following ports will be assigned on your local machine: - Postgresql: 5432 - PgAdmin: 8055 -- Kogito Data Index: 8180 - Kogito Process Instance Migration Service: 8080 ## Stopping and removing volume data diff --git a/kogito-quarkus-examples/process-instance-migration-quarkus/docker-compose/docker-compose.yml b/kogito-quarkus-examples/process-instance-migration-quarkus/docker-compose/docker-compose.yml index 774273c5ae..a4addff8c7 100644 --- a/kogito-quarkus-examples/process-instance-migration-quarkus/docker-compose/docker-compose.yml +++ b/kogito-quarkus-examples/process-instance-migration-quarkus/docker-compose/docker-compose.yml @@ -42,24 +42,6 @@ services: PGADMIN_CONFIG_MASTER_PASSWORD_REQUIRED: 'False' GUNICORN_ACCESS_LOGFILE: '/dev/null' - data-index: - container_name: data-index - image: quay.io/kiegroup/kogito-data-index-postgresql-nightly:${KOGITO_VERSION} - profiles: [ "infra", "example", "full" ] - ports: - - "8180:8080" - depends_on: - postgres: - condition: service_healthy - environment: - QUARKUS_DATASOURCE_JDBC_URL: "jdbc:postgresql://postgres:5432/kogito" - QUARKUS_DATASOURCE_USERNAME: kogito-user - QUARKUS_DATASOURCE_PASSWORD: kogito-pass - QUARKUS_HTTP_CORS_ORIGINS: "/.*/" - KOGITO_DATA_INDEX_QUARKUS_PROFILE: "http-events-support" - extra_hosts: - - "${DOCKER_GATEWAY_HOST}:host-gateway" - kogito-process-instance-migration-service: container_name: kogito-process-instance-migration-service image: dev.local/${USER}/kogito-process-instance-migration-service:1.0-SNAPSHOT @@ -67,8 +49,7 @@ services: ports: - "8080:8080" depends_on: - data-index: - condition: service_started + - postgres environment: QUARKUS_HTTP_CORS_ORIGINS: "/.*/" QUARKUS_DATASOURCE_JDBC_URL: "jdbc:postgresql://postgres:5432/kogito" @@ -78,6 +59,6 @@ services: QUARKUS_DATASOURCE_DB_KIND: postgresql KOGITO_JOBS_SERVICE_URL: http://${DOCKER_GATEWAY_HOST}:8080 KOGITO_SERVICE_URL: http://${DOCKER_GATEWAY_HOST}:8080 - KOGITO_DATAINDEX_HTTP_URL: http://${DOCKER_GATEWAY_HOST}:8180 + KOGITO_DATAINDEX_HTTP_URL: http://${DOCKER_GATEWAY_HOST}:8080 extra_hosts: - "${DOCKER_GATEWAY_HOST}:host-gateway" diff --git a/kogito-quarkus-examples/process-instance-migration-quarkus/docker-compose/sql/init.sql b/kogito-quarkus-examples/process-instance-migration-quarkus/docker-compose/sql/init.sql index 92ea9b4e5c..3097ad7d8c 100644 --- a/kogito-quarkus-examples/process-instance-migration-quarkus/docker-compose/sql/init.sql +++ b/kogito-quarkus-examples/process-instance-migration-quarkus/docker-compose/sql/init.sql @@ -16,18 +16,7 @@ CREATE DATABASE kogito TABLESPACE = pg_default CONNECTION LIMIT = -1; -CREATE DATABASE keycloak - WITH - OWNER = "kogito-user" - ENCODING = 'UTF8' - LC_COLLATE = 'en_US.utf8' - LC_CTYPE = 'en_US.utf8' - TABLESPACE = pg_default - CONNECTION LIMIT = -1; GRANT ALL PRIVILEGES ON DATABASE postgres TO "kogito-user"; GRANT ALL PRIVILEGES ON DATABASE kogito TO "kogito-user"; GRANT ALL PRIVILEGES ON DATABASE kogito TO postgres; - -GRANT ALL PRIVILEGES ON DATABASE keycloak TO "kogito-user"; -GRANT ALL PRIVILEGES ON DATABASE keycloak TO postgres; \ No newline at end of file diff --git a/kogito-quarkus-examples/process-instance-migration-quarkus/pom.xml b/kogito-quarkus-examples/process-instance-migration-quarkus/pom.xml index d53a5a97f3..6fc1e97550 100644 --- a/kogito-quarkus-examples/process-instance-migration-quarkus/pom.xml +++ b/kogito-quarkus-examples/process-instance-migration-quarkus/pom.xml @@ -124,6 +124,12 @@ kie-addons-quarkus-persistence-jdbc + + + org.kie + kogito-addons-quarkus-data-index-postgresql + + org.kie diff --git a/kogito-quarkus-examples/process-instance-migration-quarkus/src/main/resources/META-INF/processSVG/addedtask-svg.svg b/kogito-quarkus-examples/process-instance-migration-quarkus/src/main/resources/META-INF/processSVG/addedtask-svg.svg deleted file mode 100644 index 309035339a..0000000000 --- a/kogito-quarkus-examples/process-instance-migration-quarkus/src/main/resources/META-INF/processSVG/addedtask-svg.svg +++ /dev/null @@ -1 +0,0 @@ -log process creation log process continuationHT \ No newline at end of file diff --git a/kogito-quarkus-examples/process-instance-migration-quarkus/src/main/resources/META-INF/processSVG/modified-svg.svg b/kogito-quarkus-examples/process-instance-migration-quarkus/src/main/resources/META-INF/processSVG/modified-svg.svg deleted file mode 100644 index e12a33db96..0000000000 --- a/kogito-quarkus-examples/process-instance-migration-quarkus/src/main/resources/META-INF/processSVG/modified-svg.svg +++ /dev/null @@ -1 +0,0 @@ -log process creation log process continuationadded node \ No newline at end of file diff --git a/kogito-quarkus-examples/process-instance-migration-quarkus/src/main/resources/META-INF/processSVG/simple-svg.svg b/kogito-quarkus-examples/process-instance-migration-quarkus/src/main/resources/META-INF/processSVG/simple-svg.svg deleted file mode 100644 index 4b58627265..0000000000 --- a/kogito-quarkus-examples/process-instance-migration-quarkus/src/main/resources/META-INF/processSVG/simple-svg.svg +++ /dev/null @@ -1 +0,0 @@ -log process creation log process continuation \ No newline at end of file diff --git a/kogito-quarkus-examples/process-instance-migration-quarkus/src/main/resources/META-INF/resources/index.html b/kogito-quarkus-examples/process-instance-migration-quarkus/src/main/resources/META-INF/resources/index.html deleted file mode 100644 index 8556bab48e..0000000000 --- a/kogito-quarkus-examples/process-instance-migration-quarkus/src/main/resources/META-INF/resources/index.html +++ /dev/null @@ -1,150 +0,0 @@ - - - - - - - - - - Kogito quickstart - - - - - - - - - - - - - - -
-
-
-
-

Welcome to Kogito

-

- Cloud-native business automation for building intelligent applications, backed by - battle-tested capabilities. -

- - Get Started - - - Latest updates - -
-
-
-
-
-
-
-

Quick Links

- -
-
-
- - - \ No newline at end of file diff --git a/kogito-quarkus-examples/process-instance-migration-quarkus/src/main/resources/application.properties b/kogito-quarkus-examples/process-instance-migration-quarkus/src/main/resources/application.properties index 735e8aeaf3..077d6091e0 100644 --- a/kogito-quarkus-examples/process-instance-migration-quarkus/src/main/resources/application.properties +++ b/kogito-quarkus-examples/process-instance-migration-quarkus/src/main/resources/application.properties @@ -15,8 +15,8 @@ kogito.service.url=http://localhost:8080 kogito.jobs-service.url=http://localhost:8080 # to be reachable from the container running job-service -kogito.dataindex.http.url=http://localhost:8180 -kogito.dataindex.ws.url=ws://localhost:8180 +kogito.dataindex.http.url=http://localhost:8080 +kogito.dataindex.ws.url=ws://localhost:8080 # run create tables scripts quarkus.flyway.migrate-at-start=true