此内容没有您所选择的语言版本。
Chapter 32. Process instance migration
Process instance migration (PIM) is a standalone service containing a user interface and a back-end. It is packaged as a Quarkus mutable JAR file. You can use the PIM service to define the migration between two different process definitions, known as a migration plan. The user can then apply the migration plan to the running process instance in a specific KIE Server.
For more information about the PIM service, see Process Instance Migration Service in KIE (Drools, OptaPlanner and jBPM ).
32.1. Installing the process instance migration service 复制链接链接已复制到粘贴板!
You can use the process instance migration (PIM) service to create, export and execute migration plans. The PIM service is provided through a GitHub repository. To install the PIM service, clone the GitHub repository, then run the service and access it in a web browser.
Prerequisites
- You have defined processes in a backup-ed Red Hat Process Automation Manager development environment.
- Java Runtime Environment (JRE) version 11 or later is installed.
Procedure
-
Download the
rhpam-7.12.0-add-ons.zipfile from the Software Downloads page for Red Hat Process Automation Manager 7.12. -
Extract the
rhpam-7.12.0-add-ons.zipfile. -
Extract the
rhpam-7.12.0-process-migration-service.zipfile. Enter the following commands to create the database tables. Replace
<user>with your user name and<host>with the name of the local host:$ psql -U <user> -h <host> -d rhpam7 -f ~/process-migration/ddl-scripts/postgres/postgresql-quartz-schema.sql $ psql -U <user> -h <host> -d rhpam7 -f ~/process-migration/ddl-scripts/postgres/postgresql-pim-schema.sql-
Change directory to the
process-migrationdirectory. Use a text editor to create the
servers.yamlconfiguration file with the following content and save in theprocess-migrationdirectory. In this example, replace<user_name>and<password>with the credentials to log in to the KieServer.kieservers: - host: http://localhost:8080/kie-server/services/rest/server username: <user_name> password: <password>Use a text editor to create the
datasource.yamlconfiguration file with the following contentdatasource.yamland save in theprocess-migrationdirectory. In this example, replace<user_name>and<password>with the credentials to log in to the database:quarkus: datasource: db-kind: postgresql jdbc: url: jdbc:postgresql://localhost:5432/rhpam7 username: <user_name> password: <password>Rebuild the
quarkus-run.jarfile to include the PostgreSQL driver:$ java -jar -Dquarkus.launch.rebuild=true -Dquarkus.datasource.db-kind=postgresql quarkus-app/quarkus-run.jarThe output of this command should be similar to the following example:
INFO [io.qua.dep.QuarkusAugmentor] (main) Quarkus augmentation completed in 2657msRun the
quarkus-appJAR file:$ java -jar -Dquarkus.http.port=8090 -Dquarkus.config.locations=servers.yaml,datasource.yaml quarkus-app/quarkus-run.jarThis command returns output similar to the following example:
__ ____ __ _____ ___ __ ____ ______ --/ __ \/ / / / _ | / _ \/ //_/ / / / __/ -/ /_/ / /_/ / __ |/ , _/ ,< / /_/ /\ \ --\___\_\____/_/ |_/_/|_/_/|_|\____/___/ 2022-03-11 13:04:18,261 INFO [org.fly.cor.int.lic.VersionPrinter] (main) Flyway Community Edition 7.14.0 by Redgate 2022-03-11 13:04:18,262 INFO [org.fly.cor.int.dat.bas.BaseDatabaseType] (main) Database: jdbc:postgresql://localhost:5432/rhpam7 (PostgreSQL 13.4) 2022-03-11 13:04:18,280 INFO [org.fly.cor.int.com.DbMigrate] (main) Current version of schema "public": 1.0 2022-03-11 13:04:18,281 INFO [org.fly.cor.int.com.DbMigrate] (main) Schema "public" is up to date. No migration necessary. 2022-03-11 13:04:18,601 INFO [org.qua.imp.jdb.JobStoreCMT] (main) Freed 0 triggers from 'acquired' / 'blocked' state. 2022-03-11 13:04:18,603 INFO [org.qua.imp.jdb.JobStoreCMT] (main) Recovering 0 jobs that were in-progress at the time of the last shut-down. 2022-03-11 13:04:18,603 INFO [org.qua.imp.jdb.JobStoreCMT] (main) Recovery complete. 2022-03-11 13:04:18,603 INFO [org.qua.imp.jdb.JobStoreCMT] (main) Removed 0 'complete' triggers. 2022-03-11 13:04:18,603 INFO [org.qua.imp.jdb.JobStoreCMT] (main) Removed 0 stale fired job entries. 2022-03-11 13:04:18,624 INFO [org.kie.ser.api.mar.MarshallerFactory] (main) Marshaller extensions init 2022-03-11 13:04:18,710 INFO [org.kie.pro.ser.imp.KieServiceImpl] (main) Loaded kie server configuration for: org.kie.processmigration.model.config.KieServers$KieServer9579928Impl@4b6b5352 2022-03-11 13:04:18,715 INFO [org.kie.pro.ser.RecoveryService] (main) Resuming ongoing migrations ... 2022-03-11 13:04:18,856 INFO [io.quarkus] (main) process-migration-service 7.59.0.Final-redhat-00006 on JVM (powered by Quarkus 2.2.3.Final-redhat-00013) started in 1.443s. Listening on: http://0.0.0.0:8090 2022-03-11 13:04:18,857 INFO [io.quarkus] (main) Profile prod activated. 2022-03-11 13:04:18,857 INFO [io.quarkus] (main) Installed features: [agroal, cdi, config-yaml, flyway, hibernate-orm, hibernate-orm-panache, jdbc-db2, jdbc-h2, jdbc-mariadb, jdbc-mssql, jdbc-mysql, jdbc-oracle, jdbc-postgresql, narayana-jta, quartz, resteasy, resteasy-jackson, scheduler, security, security-jdbc, security-ldap, security-properties-file, smallrye-context-propagation, smallrye-health]-
To access the Process Instance Migration application, enter
http://localhost:8090/in a web browser . -
When prompted, enter the user name
adminand the passwordadmin1!. The Process Instance Migration console appears.
32.2. Creating a migration plan 复制链接链接已复制到粘贴板!
You can define the migration between two different process definitions, known as a migration plan, in the process instance migration (PIM) service web UI.
Prerequisites
- You have defined processes in a backup-ed Red Hat Process Automation Manager development environment.
- The process instance migration service is running.
Procedure
-
Enter
http://localhost:8080in a web browser. - Log in to the PIM service.
- In the upper right corner of the Process Instance Migration page, from the KIE Service list select the KIE Service you want to add a migration plan for.
- Click Add Plan. The Add Migration Plan Wizard window opens.
- In the Name field, enter a name for the migration plan.
- Optional: In the Description field, enter a description for the migration plan.
- Click Next.
- In the Source ContainerID field, enter the source container ID.
- In the Source ProcessId field, enter the source process ID.
- Click Copy Source To Target.
- In the Target ContainerID field, update the target container ID.
Click Retrieve Definition from backend and click Next.
- From the Source Nodes list, select the source node you want to map.
- From the Target Nodes list, select the target node you want to map.
- If the Source Process Definition Diagram pane is not displayed, click Show Source Diagram.
- If the Target Process Definition Diagram pane is not displayed, click Show Target Diagram.
Optional: To modify the view in the diagram panes, perform any of the following tasks:
-
To select text, select the
icon.
-
To pan, select the
icon.
-
To zoom in, select the
icon.
-
To zoom out, select the
icon.
-
To fit to viewer, select the
icon.
-
To select text, select the
- Click Map these two nodes.
- Click Next.
-
Optional: To export as a
JSONfile, click Export. - In the Review & Submit tab, review the plan and click Submit Plan.
-
Optional: To export as a
JSONfile, click Export. - Review the response and click Close.
32.3. Editing a migration plan 复制链接链接已复制到粘贴板!
You can edit a migration plan in the process instance migration (PIM) service web UI. You can modify the migration plan name, description, specified nodes, and process instances.
Prerequisites
- You have defined processes in a backup-ed Red Hat Process Automation Manager development environment.
- The PIM service is running.
Procedure
-
Enter
http://localhost:8080in a web browser. - Log in to the PIM service.
-
On the Process Instance Migration page, select the Edit Migration Plan
icon on the row of the migration plan you want to edit. The Edit Migration Plan window opens.
- On each tab, modify the details you want to change.
- Click Next.
-
Optional: To export as a
JSONfile, click Export. - In the Review & Submit tab, review the plan and click Submit Plan.
-
Optional: To export as a
JSONfile, click Export. - Review the response and click Close.
32.4. Exporting a migration plan 复制链接链接已复制到粘贴板!
You can export migration plans as a JSON file using the process instance migration (PIM) service web UI.
Prerequisites
- You have defined processes in a backup-ed Red Hat Process Automation Manager development environment.
- The PIM service is running.
Procedure
-
Enter
http://localhost:8080in a web browser. - Log in to the PIM service.
-
On the Process Instance Migration page, select the Export Migration Plan
icon on the row of the migration plan you want to execute. The Export Migration Plan window opens.
- Review and click Export.
32.5. Executing a migration plan 复制链接链接已复制到粘贴板!
You can execute the migration plan in the process instance migration (PIM) service web UI.
Prerequisites
- You have defined processes in a backup-ed Red Hat Process Automation Manager development environment.
- The PIM service is running.
Procedure
-
Enter
http://localhost:8080in a web browser. - Log in to the PIM service.
-
On the Process Instance Migration page, select the Execute Migration Plan
icon on the row of the migration plan you want to execute. The Execute Migration Plan Wizard window opens.
- From the migration plan table, select the check box on the row of each running process instance you want to migrate, and click Next.
- In the Callback URL field, enter the callback URL.
To the right of Run migration, perform one of the following tasks:
- To execute the migration immediately, select Now.
-
To schedule the migration, select Schedule and in the text field, enter the date and time, for example
06/20/2019 10:00 PM.
- Click Next.
-
Optional: To export as a
JSONfile, click Export. - Click Execute Plan.
-
Optional: To export as a
JSONfile, click Export. - Check the response and click Close.
32.6. Deleting a migration plan 复制链接链接已复制到粘贴板!
You can delete a migration plan in the process instance migration (PIM) service web UI.
Prerequisites
- You have defined processes in a backup-ed Red Hat Process Automation Manager development environment.
- The PIM service is running.
Procedure
-
Enter
http://localhost:8080in a web browser. - Log in to the PIM service.
-
On the Process Instance Migration page, select the Delete
icon on the row of the migration plan you want to delete. The Delete Migration Plan window opens.
- Click Delete to confirm deletion.