Chapter 56. Configuring Oracle WebLogic Server for KIE Server Before you deploy KIE Server with Oracle WebLogic Server, you must configure system properties, security settings, JMS requirements, and other properties on Oracle WebLogic Server. These configurations promote an optimal integration with KIE Server. Prerequisites Oracle WebLogic Server is installed and running. You are logged in to the WebLogic Administration Console. 56.1. Configuring the KIE Server group and users You must assign users to a kie-server group in the WebLogic Administration Console to enable the container-managed authentication mechanisms in Oracle WebLogic Server. Procedure In the WebLogic Administration Console, click Security Realms . Choose your desired security realm or click New to create a new security realm. Navigate to Users and Groups Groups New and create the kie-server group. Navigate to Users New and create a new user. Enter a user, such as server-user , and a password for this new user and click OK . Important Make sure that the selected user name does not conflict with any known title of a role or a group. For example, if there is a role called kie-server , then do not create a user with the user name kie-server . Click the newly created user, then return to the Groups tab. Use the selection tool to move the kie-server group from the Available field to the Chosen field, and click Save . 56.2. Configuring JDBC data sources in Oracle WebLogic Server A data source is an object that enables a Java Database Connectivity (JDBC) client, such as an application server, to establish a connection with a database. Applications look up the data source on the Java Naming and Directory Interface (JNDI) tree or in the local application context and request a database connection to retrieve data. You must configure data sources for Oracle WebLogic Server to ensure appropriate data exchange between the servers and the designated database. Typically, solutions using Red Hat Process Automation Manager manage several resources within a single transaction. JMS for asynchronous jobs, events, and timers, for example. Red Hat Process Automation Manager requires an XA driver in the datasource when possible to ensure data atomicity and consistent results. If transactional code for different schemas exists inside listeners or derives from hooks provided by the jBPM engine, an XA driver is also required. Do not use non-XA datasources unless you are positive you do not have multiple resources participating in single transactions. Prerequisites The JDBC drivers that you want to use to create database connections are installed on all servers on which you want to deploy the data source. Some JDBC drivers are installed with Oracle WebLogic Server, such as WebLogic-branded Data Direct JDBC drivers for DB2, Informix, MS SQL Server, and Sybase. For more information about JDBC drivers, see Using JDBC Drivers with WebLogic Server in the Oracle Help Center. Procedure Navigate to the Software Downloads page in the Red Hat Customer Portal (login required), and select the product and version from the drop-down options: Product: Process Automation Manager Version: 7.13.5 Download Red Hat Process Automation Manager 7.13.5 Add-Ons . Complete the following steps to prepare your database: Extract rhpam-7.13.5-add-ons.zip in a temporary directory, for example TEMP_DIR . Extract TEMP_DIR/rhpam-7.13.5-migration-tool.zip . Change your current directory to the TEMP_DIR/rhpam-7.13.5-migration-tool/ddl-scripts directory. This directory contains DDL scripts for several database types. Import the DDL script for your database type into the database that you want to use, for example: psql jbpm < /ddl-scripts/postgresql/postgresql-jbpm-schema.sql Note If you are using PostgreSQL or Oracle in conjunction with Spring Boot, you must import the respective Spring Boot DDL script, for example /ddl-scripts/oracle/oracle-springboot-jbpm-schema.sql or /ddl-scripts/postgresql/postgresql-springboot-jbpm-schema.sql . In the WebLogic Administration Console, navigate to Change Center Lock & Edit . Under Domain Structure , click Services Data Sources . On the Summary of Data Sources page, click New Generic Data Source . On the JDBC Data Sources Properties page, enter or select the following information: Name: Enter a name for this JDBC data source. This name is used in the configuration file ( config.xml ) and throughout the Administration Console whenever referring to this data source. JNDI Name: Enter the JNDI path to where this JDBC data source will be bound. Applications look up the data source on the JNDI tree by this name when reserving a connection. Database Type: Select the DBMS of the database that you want to connect to. If your DBMS is not listed, select Other . Click to continue. Select the Database Driver that you want to use to connect to the database. The list includes common JDBC drivers for the selected DBMS and any other JDBC drivers that have been installed previously. On the Transaction Options page, leave the Supports Global Transactions option selected and choose from the available transaction options. You can also clear this check box to disable (ignore) global transactions in this data source. In most cases, you should leave the option selected for optimal data efficiency. Two-Phase Commit: Select this option to enable standard XA processing. This option is only available when you select an XA JDBC driver to make database connections. Logging Last Resource: Select this option to enable a non-XA JDBC connection to participate in global transactions using the Logging Last Resource (LLR) transaction optimization. This option is recommended in place of Emulate Two-Phase Commit. This option is only available when you select a non-XA JDBC driver to make database connections. Emulate Two-Phase Commit: Select this option to enable a non-XA JDBC connection to emulate participation in distributed transactions using JTA. Select this option only if your application can tolerate heuristic conditions. This option is only available when you select a non-XA JDBC driver to make database connections. One-Phase Commit: Select this option to enable the non-XA connection to participate in a global transaction as the only transaction participant. This option is only available when you select a non-XA JDBC driver to make database connections. Click to continue. On the Connection Properties page, enter values for the following properties: Service Name: Specify the service name of the database to which you want to connect. This must be the same for each data source if more than one is provided. This field is available only if you selected one of the available service-instance connections drivers for Oracle Real Application Clusters (RAC). Database Name: Enter the name of the database that you want to connect to. Exact database name requirements vary by JDBC driver and by DBMS. Host Name: Enter the DNS name or IP address of the server that hosts the database. If you are creating an Oracle GridLink service-instance connection, this must be the same for each data source if more than one is provided. Port: Enter the port on which the database server listens for connection requests. Database User Name: Enter the database user account name that you want to use for each connection in the data source. Password/Confirm Password: Enter the password for the database user account. oracle.jdbc.DRCPConnectionClass: Optionally, enter the Database Resident Connection Pooling (DCRP) connection class if required by your environment. Click to continue. On the Test Database Connection page, review the connection parameters and click Test Configuration . Oracle WebLogic Server attempts to create a connection from the Administration Server to the database. Results from the connection test are displayed at the top of the page. If the test is unsuccessful, correct any configuration errors and retry the test. Click to continue or to skip this step if the JDBC driver you selected is not installed on the Administration Server. On the Select Targets page, select the servers or clusters on which you want to deploy the data source and click Finish . Return to the main menu of the WebLogic Administration Console and select Change Center Activate Changes . For more information about Oracle WebLogic Server data sources, see JDBC Data Sources for Oracle WebLogic Server in the Oracle Help Center. 56.3. Configuring Java Message Service (JMS) The Java Message Service (JMS) is a Java API that KIE Server uses to exchange messages with other application servers such as Oracle WebLogic Server and IBM WebSphere Application Server. You must configure your application server to send and receive JMS messages through KIE Server to ensure collaboration between the two servers. 56.3.1. Create a JMS server Create a JMS server to use JMS with KIE Server and Oracle WebLogic Server. Procedure In the WebLogic Administration Console, navigate to Services Messaging JMS Servers . Click New to create a new JMS server. Enter a name for your JMS server and click . Select the target server chosen for the KIE Server deployment. Click Finish . 56.3.2. Create a JMS module You must create a JMS module to store your JMS resources, such as connection factories and queues. Prerequisites You have created a JMS server. Procedure In the WebLogic Administration Console, navigate to Services Messaging JMS Modules . Click New to create a module. Enter a module name and click . Select the target server chosen for the KIE Server deployment and click Finish . Click the newly created module name and then click Subdeployments . Click New to create a subdeployment for your module. Give your subdeployment a name and click . Select the check box to choose the previously created JMS server. Click Finish to complete the subdeployment configuration. 56.3.3. Create JMS connection factories To enable messaging with KIE Server, you must create certain JMS connection factories for sending and receiving messages. Prerequisites You have created a JMS server. You have created a JMS module. Procedure In the WebLogic Administration Console, navigate to Services Messaging JMS Modules to see a list of JMS modules. Select your previously created module and click New to create a new JMS resource. Select Connection Factory and click . For each of rthe equired connection factories listed in the following table, enter the name of the connection factory (for example, KIE.SERVER.REQUEST ) and the JNDI name (for example, jms/cf/KIE.SERVER.REQUEST ) and click . The connection factory automatically selects the servers assigned to the JMS Module as the default. Table 56.1. Required JMS connection factories for KIE Server Name Default value Used for KIE.SERVER.REQUEST jms/cf/KIE.SERVER.REQUEST Sending all requests to KIE Server KIE.SERVER.RESPONSE jms/cf/KIE.SERVER.RESPONSE Receiving all responses produced by KIE Server KIE.SERVER.EXECUTOR jms/cf/KIE.SERVER.EXECUTOR KIE Server executor services Click Finish to add the connection factory, and repeat for each required factory. 56.3.4. Create JMS queues JMS queues are the destination end points for point-to-point messaging. You must create certain JMS queues to enable JMS messaging with KIE Server. Prerequisites You have created a JMS server. You have created a JMS module. Procedure In the WebLogic Administration Console, navigate to Services Messaging JMS Modules to see the list of JMS modules. Select your previously created module, then click New to create a new JMS resource. Select Queue and click . For each of the required queues listed in the following table, enter the name of the queue (for example, KIE.SERVER.REQUEST ) and the JNDI name (for example, jms/KIE.SERVER.REQUEST ) and then click . Table 56.2. Required JMS queues for KIE Server Name Default value Used for KIE.SERVER.REQUEST jms/KIE.SERVER.REQUEST Sending all requests to KIE Server KIE.SERVER.RESPONSE jms/KIE.SERVER.RESPONSE Receiving all responses produced by KIE Server KIE.SERVER.EXECUTOR jms/KIE.SERVER.EXECUTOR KIE Server executor services Choose the JMS module subdeployment that connects to the JMS server. Click Finish to add the queue, and repeat for each required queue. 56.4. Setting system properties in Oracle WebLogic Server Set the system properties listed in this section on your Oracle WebLogic Server before you deploy KIE Server. Procedure Set the following system property to increase the Java Virtual Machine (JVM) memory size: If you do not increase the JVM memory size, Oracle WebLogic Server freezes or causes deployment errors when deploying KIE Server. Specify the following system properties for KIE Server on the Oracle WebLogic Server instance: Table 56.3. System properties for KIE Server Name Value Description kie.server.jms.queues.response jms/KIE.SERVER.RESPONSE The JNDI name of JMS queue for responses used by KIE Server. org.kie.server.domain OracleDefaultLoginConfiguration JAAS LoginContext domain used to authenticate users when using JMS. org.kie.server.persistence.ds jdbc/jbpm Data source JNDI name for KIE Server. org.kie.server.persistence.tm org.hibernate.service.jta.platform.internal.WeblogicJtaPlatform Transaction manager platform for setting Hibernate properties. org.kie.server.persistence.dialect Example: org.hibernate.dialect.H2Dialect Specifies the Hibernate dialect to be used. Set according to data source. org.kie.executor.jms.queue jms/KIE.SERVER.EXECUTOR Job executor JMS queue for KIE Server. org.kie.executor.jms.cf jms/cf/KIE.SERVER.EXECUTOR Job executor JMS connection factory for KIE Server. org.kie.server.router Example: http://localhost:9000 (Optional) Specifies one or more URLs for one or more KIE Server routers (Smart Routers) that the application server is a part of in a clustered KIE Server environment. Set the same property values in the JAVA_OPTIONS environment variable: 56.5. Stopping and restarting Oracle WebLogic Server After you have configured all required system properties in Oracle WebLogic Server, stop and restart the Oracle server to ensure that the configurations are applied. Procedure In the WebLogic Administration Console, navigate to Change Center Lock & Edit . Under Domain Structure , click Environment Servers Control . Select the server that you want to stop and click Shutdown . Select When Work Completes to gracefully shut down the server or select Force Shutdown Now to stop the server immediately without completing ongoing tasks. On the Server Life Cycle Assistant pane, click Yes to complete the shutdown. After the shutdown is complete, navigate to the domain directory in the command terminal, WLS_HOME /user_projects/<DOMAIN_NAME> . For example: Enter one of the following commands to restart Oracle WebLogic Server to apply the new configurations: On UNIX-based operating systems: On Windows operating systems: Open the Administration Console in a web browser (for example, http://localhost:7001/console/ ) and log in with your credentials.

Commands:
psql jbpm < /ddl-scripts/postgresql/postgresql-jbpm-schema.sql
USER_MEM_ARGS=-Xms512m -Xmx1024m
JAVA_OPTIONS="-Dkie.server.jms.queues.response=jms/KIE.SERVER.RESPONSE -Dorg.kie.server.domain=OracleDefaultLoginConfiguration -Dorg.kie.executor.jms.cf=jms/cf/KIE.SERVER.EXECUTOR -Dorg.kie.executor.jms.queue=jms/KIE.SERVER.EXECUTOR -Dorg.kie.server.persistence.ds=jdbc/jbpm -Dorg.kie.server.persistence.tm=org.hibernate.service.jta.platform.internal.WeblogicJtaPlatform -Dorg.kie.server.persistence.dialect=org.hibernate.dialect.H2Dialect // Optional server router, for clustered server environment -Dorg.kie.server.router=http://localhost:9000
WLS\user_projects\mydomain
startWebLogic.sh
startWebLogic.cmd