Chapter 14. Installing Red Hat Process Automation Manager from ZIP files You can use the Red Hat Process Automation Manager ZIP files (one for Business Central and one for KIE Server) to install Red Hat Process Automation Manager without using the installer. Note You should install Business Central and KIE Server on different servers in production environments. For information about installing the headless Process Automation Manager controller, see Chapter 19, Installing and running the headless Process Automation Manager controller . 14.1. Installing Business Central from the ZIP file Business Central is the graphical user interface where you create and manage business rules that KIE Server executes. You can use a deployable ZIP file to install and configure Business Central. Prerequisites A backed-up Red Hat JBoss EAP installation version 7.4 is available. The base directory of the Red Hat JBoss EAP installation is referred to as EAP_HOME . Sufficient user permissions to complete the installation are granted. The following file is downloaded as described in Chapter 12, Downloading the Red Hat Process Automation Manager installation files : rhpam-7.13.5-business-central-eap7-deployable.zip Procedure Extract the rhpam-7.13.5-business-central-eap7-deployable.zip file to a temporary directory. In the following examples this directory is called TEMP_DIR . Copy the contents of the TEMP_DIR /rhpam-7.13.5-business-central-eap7-deployable/jboss-eap-7.4 directory to EAP_HOME . When prompted, merge or replace files. Warning Ensure that the names of the Red Hat Process Automation Manager deployments that you copy do not conflict with your existing deployments in the Red Hat JBoss EAP instance. 14.2. Installing KIE Server from the ZIP file KIE Server provides the runtime environment for business assets and accesses the data stored in the assets repository (knowledge store). You can use a deployable ZIP file to install and configure KIE Server. Prerequisites A backed-up Red Hat JBoss EAP installation version 7.4 is available. The base directory of the Red Hat JBoss EAP installation is referred to as EAP_HOME . Sufficient user permissions to complete the installation are granted. The following file is downloaded as described in Chapter 12, Downloading the Red Hat Process Automation Manager installation files : rhpam-7.13.5-kie-server-ee8.zip Procedure Extract the rhpam-7.13.5-kie-server-ee8.zip archive to a temporary directory. In the following examples this directory is called TEMP_DIR . Copy the TEMP_DIR /rhpam-7.13.5-kie-server-ee8/kie-server.war directory to EAP_HOME /standalone/deployments/ . Warning Ensure the names of the Red Hat Process Automation Manager deployments you copy do not conflict with your existing deployments in the Red Hat JBoss EAP instance. Copy the contents of the TEMP_DIR /rhpam-7.13.5-kie-server-ee8/rhpam-7.13.5-kie-server-ee8/SecurityPolicy/ to EAP_HOME /bin . When prompted to overwrite files, click Replace . In the EAP_HOME /standalone/deployments/ directory, create an empty file named kie-server.war.dodeploy . This file ensures that KIE Server is automatically deployed when the server starts. Note If you use Microsoft SQL Server, make sure you have configured applicable transaction isolation for your database. If you do not, you may experience deadlocks. The recommended configuration is to turn on ALLOW_SNAPSHOT_ISOLATION and READ_COMMITTED_SNAPSHOT by entering the following statements: 14.3. Configuring JDBC data sources for KIE 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 KIE Server to ensure correct 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. Note For production environments, specify an actual data source. Do not use the example data source in production environments. Prerequisites The JDBC providers that you want to use to create database connections are configured on all servers on which you want to deploy KIE Server, as described in the "Creating Datasources" and "JDBC Drivers" sections of the Red Hat JBoss Enterprise Application Server Configuration Guide . The Red Hat Process Automation Manager 7.13.5 Add Ons ( rhpam-7.13.5-add-ons.zip ) file is downloaded from the Software Downloads page in the Red Hat Customer Portal. Procedure 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. The following example creates jBPM database structures in PostreSQL 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 . Note The PostgreSQL DDL scripts create the PostgreSQL schema with auto-incrementing integer value (OID) columns for entity attributes annotated with @LOB . To use other binary column types such as BYTEA instead of OID, you must create the PostgreSQL schema with the postgresql-bytea-jbpm-schema.sql script and set the Red Hat Process Automation Manager org.kie.persistence.postgresql.useText=true and org.kie.persistence.postgresql.useBytea=true flags. Do not use the postgresql-jbpm-lo-trigger-clob.sql script when creating a BYTEA-based schema. Red Hat Process Automation Manager does not provide a migration tool to change from an OID-based to a BYTEA-based schema. Open EAP_HOME /standalone/configuration/standalone-full.xml in a text editor and locate the <system-properties> tag. Add the following properties to the <system-properties> tag where <DATASOURCE> is the JNDI name of your data source and <HIBERNATE_DIALECT> is the hibernate dialect for your database. Note The default value of the org.kie.server.persistence.ds property is java:jboss/datasources/ExampleDS . The default value of the org.kie.server.persistence.dialect property is org.hibernate.dialect.H2Dialect . <property name="org.kie.server.persistence.ds" value="<DATASOURCE>"/> <property name="org.kie.server.persistence.dialect" value="<HIBERNATE_DIALECT>"/> The following example shows how to configure a datasource for the PostgreSQL hibernate dialect: <system-properties> <property name="org.kie.server.repo" value="USD{jboss.server.data.dir}"/> <property name="org.kie.example" value="true"/> <property name="org.jbpm.designer.perspective" value="full"/> <property name="designerdataobjects" value="false"/> <property name="org.kie.server.user" value="rhpamUser"/> <property name="org.kie.server.pwd" value="rhpam123!"/> <property name="org.kie.server.location" value="http://localhost:8080/kie-server/services/rest/server"/> <property name="org.kie.server.controller" value="http://localhost:8080/business-central/rest/controller"/> <property name="org.kie.server.controller.user" value="kieserver"/> <property name="org.kie.server.controller.pwd" value="kieserver1!"/> <property name="org.kie.server.id" value="local-server-123"/> <!-- Data source properties. --> <property name="org.kie.server.persistence.ds" value="java:jboss/datasources/KieServerDS"/> <property name="org.kie.server.persistence.dialect" value="org.hibernate.dialect.PostgreSQLDialect"/> </system-properties> The following dialects are supported: DB2: org.hibernate.dialect.DB2Dialect MSSQL: org.hibernate.dialect.SQLServer2012Dialect MySQL: org.hibernate.dialect.MySQL5InnoDBDialect MariaDB: org.hibernate.dialect.MySQL5InnoDBDialect Oracle: org.hibernate.dialect.Oracle10gDialect PostgreSQL: org.hibernate.dialect.PostgreSQL82Dialect PostgreSQL plus: org.hibernate.dialect.PostgresPlusDialect Sybase: org.hibernate.dialect.SybaseASE157Dialect 14.4. Creating users If you used the deployable ZIP files to install Red Hat Process Automation Manager, before you can log in to Business Central or KIE Server, you must create users. This section shows you how to create a Business Central user with the admin , rest-all , and kie-server roles and a KIE Server user that has the kie-server role. For information about roles, see Chapter 11, Red Hat Process Automation Manager roles and users . Note Red Hat Process Automation Manager stores user data as a set of properties or as a set of files. File-based storage provides several extra features, such as SSH login and a user maintenance UI. The user script examples in this documentation use the file-based user script, jboss-cli.sh , instead of the property-based user script, add-users.sh . Prerequisites Red Hat Process Automation Manager is installed in the base directory of the Red Hat JBoss EAP installation ( EAP_HOME ). Procedure Optional: To change Red Hat Process Automation Manager from using property-based user storage to file-based user storage, complete the following steps: Run the following command to apply the kie-fs-realm patch: Open each kie-fs-realm-users/*/<USER>.xml file where <USER> is a Red Hat Process Automation Manager user. Replace <attribute name="roles" value= with <attribute name="role" value= . In a terminal application, navigate to the EAP_HOME /bin directory. Create a user with the admin , rest-all , and kie-server roles that you will use to log in to Business Central. Note Users with the admin role are Business Central administrators. Users with rest-all role can access Business Central REST capabilities. Users with the kie-server role can access KIE Server (KIE Server) REST capabilities. The kie-server role is mandatory for users to have access to Manage and Track views in Business Central. In the following command, replace <USERNAME> and <PASSWORD> with the user name and password of your choice: USD ./bin/jboss-cli.sh --commands="embed-server --std-out=echo,/subsystem=elytron/filesystem-realm=ApplicationRealm:add-identity(identity=<USERNAME>),/subsystem=elytron/filesystem-realm=ApplicationRealm:set-password(identity=<USERNAME>, clear={password=<PASSWORD>}),/subsystem=elytron/filesystem-realm=ApplicationRealm:add-identity-attribute(identity=<USERNAME>, name=role, value=[admin,rest-all,kie-server])" Note Make sure that the specified user name is not the same as an existing user, role, or group. For example, do not create a user with the user name admin . The password must have at least eight characters and must contain at least one number and one non-alphanumeric character, but not & (ampersand). Create a user with the kie-server role that you will use to log in to KIE Server. USD ./bin/jboss-cli.sh --commands="embed-server --std-out=echo,/subsystem=elytron/filesystem-realm=ApplicationRealm:add-identity(identity=<USERNAME>),/subsystem=elytron/filesystem-realm=ApplicationRealm:set-password(identity=<USERNAME>, clear={password='<PASSWORD>'}),/subsystem=elytron/filesystem-realm=ApplicationRealm:add-identity-attribute(identity=<USERNAME>, name=role, value=[kie-server])" Make a note of your user names and passwords. Optional: If you installed Business Central and KIE Server in the same server instance, you can create a single user that has both of these roles: USD ./bin/jboss-cli.sh --commands="embed-server --std-out=echo,/subsystem=elytron/filesystem-realm=ApplicationRealm:add-identity(identity=<USERNAME>),/subsystem=elytron/filesystem-realm=ApplicationRealm:set-password(identity=<USERNAME>, clear={password='<PASSWORD>'}),/subsystem=elytron/filesystem-realm=ApplicationRealm:add-identity-attribute(identity=<USERNAME>, name=role, value=[admin,rest-all,kie-server])" Note You should install Business Central and KIE Server on different servers in production environments. Optional: To create several users at one time, create a file that contains the user data and run the following command, where <USER_DATA>.cli is the file that contains the user data: USD ./bin/jboss-cli.sh --file=<USER_DATA>.cli The <USER_DATA>.cli file should contain data similar to the following example: embed-server --std-out=echo # first user /subsystem=elytron/filesystem-realm=ApplicationRealm:add-identity(identity=<USERNAME>) /subsystem=elytron/filesystem-realm=ApplicationRealm:set-password(identity=<USERNAME>, clear={password='<PASSWORD>'}) /subsystem=elytron/filesystem-realm=ApplicationRealm:add-identity-attribute(identity=<USERNAME>, name=role, value=[admin,role,group]) # second user ... 14.5. Configuring KIE Server to connect to Business Central Warning This section provides a sample setup that you can use for testing purposes. Some of the values are unsuitable for a production environment, and are marked as such. If a KIE Server is not configured in your Red Hat Process Automation Manager environment, or if you require additional KIE Servers in your Red Hat Process Automation Manager environment, you must configure a KIE Server to connect to Business Central. Note If you are deploying KIE Server on Red Hat OpenShift Container Platform, see the Deploying an Red Hat Process Automation Manager environment on Red Hat OpenShift Container Platform 4 using Operators document for instructions about configuring it to connect to Business Central. Prerequisites Business Central and KIE Server are installed in the base directory of the Red Hat JBoss EAP installation ( EAP_HOME ) as described in the following sections: Section 14.1, "Installing Business Central from the ZIP file" Section 14.2, "Installing KIE Server from the ZIP file" Users with the following roles exist: In Business Central, a user with the role rest-all On KIE Server, a user with the role kie-server For more information, see Section 14.4, "Creating users" . Procedure In your Red Hat Process Automation Manager installation directory, navigate to the standalone-full.xml file. For example, if you use a Red Hat JBoss EAP installation for Red Hat Process Automation Manager, go to USDEAP_HOME/standalone/configuration/standalone-full.xml . Open the standalone-full.xml file and under the <system-properties> tag, set the following JVM properties: Table 14.1. JVM Properties for the KIE Server instance Property Value Note org.kie.server.id default-kie-server The KIE Server ID. org.kie.server.controller http://localhost:8080/business-central/rest/controller The location of Business Central. The URL for connecting to the API of Business Central. org.kie.server.controller.user controllerUser The user name with the role rest-all who can log in to the Business Central. org.kie.server.controller.pwd controllerUser1234; The password of the user who can log in to the Business Central. org.kie.server.location http://localhost:8080/kie-server/services/rest/server The location of KIE Server. The URL for connecting to the API of KIE Server. Table 14.2. JVM Properties for the Business Central instance Property Value Note org.kie.server.user controllerUser The user name with the role kie-server . org.kie.server.pwd controllerUser1234; The password of the user. The following example shows how to configure a KIE Server instance: <property name="org.kie.server.id" value="default-kie-server"/> <property name="org.kie.server.controller" value="http://localhost:8080/business-central/rest/controller"/> <property name="org.kie.server.controller.user" value="controllerUser"/> <property name="org.kie.server.controller.pwd" value="controllerUser1234;"/> <property name="org.kie.server.location" value="http://localhost:8080/kie-server/services/rest/server"/> The following example shows how to configure a for Business Central instance: <property name="org.kie.server.user" value="controllerUser"/> <property name="org.kie.server.pwd" value="controllerUser1234;"/> To verify that KIE Server starts successfully, send a GET request to http:// SERVER:PORT /kie-server/services/rest/server/ when KIE Server is running. For more information about running Red Hat Process Automation Manager on KIE Server, see Running Red Hat Process Automation Manager . After successful authentication, you receive an XML response similar to the following example: <response type="SUCCESS" msg="Kie Server info"> <kie-server-info> <capabilities>KieServer</capabilities> <capabilities>BRM</capabilities> <capabilities>BPM</capabilities> <capabilities>CaseMgmt</capabilities> <capabilities>BPM-UI</capabilities> <capabilities>BRP</capabilities> <capabilities>DMN</capabilities> <capabilities>Swagger</capabilities> <location>http://localhost:8230/kie-server/services/rest/server</location> <messages> <content>Server KieServerInfo{serverId='first-kie-server', version='7.5.1.Final-redhat-1', location='http://localhost:8230/kie-server/services/rest/server', capabilities=[KieServer, BRM, BPM, CaseMgmt, BPM-UI, BRP, DMN, Swagger]}started successfully at Mon Feb 05 15:44:35 AEST 2018</content> <severity>INFO</severity> <timestamp>2018-02-05T15:44:35.355+10:00</timestamp> </messages> <name>first-kie-server</name> <id>first-kie-server</id> <version>7.5.1.Final-redhat-1</version> </kie-server-info> </response> Verify successful registration: Log in to Business Central. Click Menu Deploy Execution Servers . If registration is successful, you will see the registered server ID. 14.6. Thread efficiency To ensure that the optimal number of threads are used, set the value of the threading system properties to the sum of the number of CPUs plus one. In your Red Hat Process Automation Manager installation directory, navigate to the standalone-full.xml file. For example, if you use a Red Hat JBoss EAP installation for Red Hat Process Automation Manager, go to USDEAP_HOME/standalone/configuration/standalone-full.xml . Open the standalone-full.xml file. Under the <system-properties> tag, set the value of the following JVM properties to the number of CPUs plus one: org.appformer.concurrent.managed.thread.limit org.appformer.concurrent.unmanaged.thread.limit org.appformer.concurrent.indexing.thread.limit org.appformer.concurrent.rest.api.thread.limit Note The number of CPUs plus one is a valid baseline value for all properties. You might have to fine-tune further based on additional testing.

Commands:
ALTER DATABASE <DBNAME> SET ALLOW_SNAPSHOT_ISOLATION ON ALTER DATABASE <DBNAME> SET READ_COMMITTED_SNAPSHOT ON
psql jbpm < /ddl-scripts/postgresql/postgresql-jbpm-schema.sql
<property name="org.kie.server.persistence.ds" value="<DATASOURCE>"/> <property name="org.kie.server.persistence.dialect" value="<HIBERNATE_DIALECT>"/>
<system-properties> <property name="org.kie.server.repo" value="USD{jboss.server.data.dir}"/> <property name="org.kie.example" value="true"/> <property name="org.jbpm.designer.perspective" value="full"/> <property name="designerdataobjects" value="false"/> <property name="org.kie.server.user" value="rhpamUser"/> <property name="org.kie.server.pwd" value="rhpam123!"/> <property name="org.kie.server.location" value="http://localhost:8080/kie-server/services/rest/server"/> <property name="org.kie.server.controller" value="http://localhost:8080/business-central/rest/controller"/> <property name="org.kie.server.controller.user" value="kieserver"/> <property name="org.kie.server.controller.pwd" value="kieserver1!"/> <property name="org.kie.server.id" value="local-server-123"/> <!-- Data source properties. --> <property name="org.kie.server.persistence.ds" value="java:jboss/datasources/KieServerDS"/> <property name="org.kie.server.persistence.dialect" value="org.hibernate.dialect.PostgreSQLDialect"/> </system-properties>
./bin/elytron-tool.sh filesystem-realm --users-file application-users.properties --roles-file application-roles.properties --output-location kie-fs-realm-users
./bin/jboss-cli.sh --commands="embed-server --std-out=echo,/subsystem=elytron/filesystem-realm=ApplicationRealm:add-identity(identity=<USERNAME>),/subsystem=elytron/filesystem-realm=ApplicationRealm:set-password(identity=<USERNAME>, clear={password=<PASSWORD>}),/subsystem=elytron/filesystem-realm=ApplicationRealm:add-identity-attribute(identity=<USERNAME>, name=role, value=[admin,rest-all,kie-server])"
./bin/jboss-cli.sh --commands="embed-server --std-out=echo,/subsystem=elytron/filesystem-realm=ApplicationRealm:add-identity(identity=<USERNAME>),/subsystem=elytron/filesystem-realm=ApplicationRealm:set-password(identity=<USERNAME>, clear={password='<PASSWORD>'}),/subsystem=elytron/filesystem-realm=ApplicationRealm:add-identity-attribute(identity=<USERNAME>, name=role, value=[kie-server])"
./bin/jboss-cli.sh --commands="embed-server --std-out=echo,/subsystem=elytron/filesystem-realm=ApplicationRealm:add-identity(identity=<USERNAME>),/subsystem=elytron/filesystem-realm=ApplicationRealm:set-password(identity=<USERNAME>, clear={password='<PASSWORD>'}),/subsystem=elytron/filesystem-realm=ApplicationRealm:add-identity-attribute(identity=<USERNAME>, name=role, value=[admin,rest-all,kie-server])"
./bin/jboss-cli.sh --file=<USER_DATA>.cli
embed-server --std-out=echo first user /subsystem=elytron/filesystem-realm=ApplicationRealm:add-identity(identity=<USERNAME>) /subsystem=elytron/filesystem-realm=ApplicationRealm:set-password(identity=<USERNAME>, clear={password='<PASSWORD>'}) /subsystem=elytron/filesystem-realm=ApplicationRealm:add-identity-attribute(identity=<USERNAME>, name=role, value=[admin,role,group]) second user
<property name="org.kie.server.id" value="default-kie-server"/> <property name="org.kie.server.controller" value="http://localhost:8080/business-central/rest/controller"/> <property name="org.kie.server.controller.user" value="controllerUser"/> <property name="org.kie.server.controller.pwd" value="controllerUser1234;"/> <property name="org.kie.server.location" value="http://localhost:8080/kie-server/services/rest/server"/>
<property name="org.kie.server.user" value="controllerUser"/> <property name="org.kie.server.pwd" value="controllerUser1234;"/>
<response type="SUCCESS" msg="Kie Server info"> <kie-server-info> <capabilities>KieServer</capabilities> <capabilities>BRM</capabilities> <capabilities>BPM</capabilities> <capabilities>CaseMgmt</capabilities> <capabilities>BPM-UI</capabilities> <capabilities>BRP</capabilities> <capabilities>DMN</capabilities> <capabilities>Swagger</capabilities> <location>http://localhost:8230/kie-server/services/rest/server</location> <messages> <content>Server KieServerInfo{serverId='first-kie-server', version='7.5.1.Final-redhat-1', location='http://localhost:8230/kie-server/services/rest/server', capabilities=[KieServer, BRM, BPM, CaseMgmt, BPM-UI, BRP, DMN, Swagger]}started successfully at Mon Feb 05 15:44:35 AEST 2018</content> <severity>INFO</severity> <timestamp>2018-02-05T15:44:35.355+10:00</timestamp> </messages> <name>first-kie-server</name> <id>first-kie-server</id> <version>7.5.1.Final-redhat-1</version> </kie-server-info> </response>
org.appformer.concurrent.managed.thread.limit org.appformer.concurrent.unmanaged.thread.limit org.appformer.concurrent.indexing.thread.limit org.appformer.concurrent.rest.api.thread.limit