IntroductionIBM Process Automation Manager Open Edition (PAM) and IBM Decision Manager Open Edition (DM) are application development platforms for developers to create highly customized, modern, cloud-native applications that automate business operations.
These platforms are built on open source projects: Drools, jBPM and Kogito.
IBM Process Automation Manager is an Open-Source platform for modeling and automating business processes, including case and decision support.
Purpose of this articleThe purpose of this article is to demonstrate how easy it is to setup one or more development environments of "IBM PAM Open Edition" in an OpenShift cluster.
We will use the "IBM Business Automation" resources in YAML format.
The example assumes that the Openshift cluster has connectivity to the public network and therefore you will not need to perform any downloads; the operator will take care of all installation and configuration activities.
In these examples we will use only the OpenShift CLI interface to install and configure the development environment.
PrerequisitesA little bit of knowledge about OCP commands using the console.
An Openshift cluster (you will need a new namespace so if you don't have admin privileges ask to your admin for a new namespace administered by you).
Very little disk space and free memory on the cluster.
20 minutes of your free time to complete the setup and the scenarios
Overview of YAML resourcesThe resources that we are going to use to create a development environment are described by the YAML format and refer to the
OperatorGroup,
Subscription and
KieApp, the first two identify the operator and relative subscription which, when properly feed by a KieApp configuration, will create and configure all the pods necessary for correct operations of a work environment.
Resources definition and details are available at
https://github.com/kiegroup/kie-cloud-operatorIn this post the focus is on automating the setup and therefore we will work with the yaml format.
These are the three skeletons of the resources we will use
# OperatorGroupapiVersion: operators.coreos.com/v1kind: OperatorGroupmetadata: generateName: name: spec: targetNamespaces: - # SubscriptionapiVersion: operators.coreos.com/v1alpha1kind: Subscriptionmetadata: name: spec: channel: installPlanApproval: name: source: sourceNamespace: startingCSV: # KieAppapiVersion: app.kiegroup.org/v2kind: KieAppmetadata: name: namespace: spec: commonConfig: adminPassword: adminUser: objects: servers: - name: id: replicas: upgrades: enabled: minor: environment: Install the operatorNow let's start installing the resources.
Log in to the Openshift cluster with your credentials.
oc login <your-ocp-cluster-host-name>:<port> --username=<your-user-id> --password=<your-pass>Create a namespace within which to deploy the development environment or ask to your cluster administrator for a new namespace you may administer.
# set env var and create the namespaceTNS=my-ibamoe-clioc new-project ${TNS}If you have admin rights and you want to know what resources will be installed into your cluster execute this command before installing the IBM BAM OE resources
echo "CRD total in your cluster: "$(oc get crd | wc -l)echo "CRD total KieGroup: "$(oc get crd | grep kie | wc -l)oc get $(oc get crd -o=custom-columns=CR_NAME:.spec.names.singular --no-headers | awk '{printf "%s%s",sep,$0; sep=","}') --ignore-not-found -o=custom-columns=KIND:.kind,NAME:.metadata.name,NAMESPACE:.metadata.namespace | grep -E 'bamoe|kie'oc get Subscription -A | grep bamoeYou should see zero CRD for KieGroup, otherwise it means previous installations have been done.
Create the development environment# enter the namespaceoc project ${TNS}# set env vars for Environment TypeENV_TYPE=rhpam-trial# set env vars for KieApp (for a minimal setup)APP_NAME=my-rhpamAPP_ADMINUSER=adminAPP_ADMINPASSW=passw0rdNow with a single smart command we will create the resources into the selected namespace (
OperatorGroup,
Subscription for stable version 8 channel and later the
KieApp).
echo "apiVersion: operators.coreos.com/v1kind: OperatorGroupmetadata: generateName: my-ibamoe-operator- name: my-ibamoe-operator-marcospec: targetNamespaces: - ${TNS}---apiVersion: operators.coreos.com/v1alpha1kind: Subscriptionmetadata: name: bamoe-businessautomation-operator namespace: ${TNS}spec: channel: 8.x-stable installPlanApproval: Automatic name: bamoe-businessautomation-operator source: redhat-operators sourceNamespace: openshift-marketplace startingCSV: bamoe-businessautomation-operator.8.0.0-1" | oc create -f -Use the following command to verify the operator status
oc get ClusterServiceVersion | grep SucceededWait until the operator get to
Succeeded status
output: '
bamoe-businessautomation-operator.8.0.0-1 IBM Business Automation 8.0.0-1 Succeeded'
then create the KieApp resource with the following command
echo "apiVersion: app.kiegroup.org/v2kind: KieAppmetadata: name: my-rhpam namespace: ${TNS}spec: commonConfig: adminPassword: ${APP_ADMINPASSW} adminUser: ${APP_ADMINUSER} objects: servers: - name: my-server1 id: my-server1-id replicas: 1 upgrades: enabled: true minor: true environment: ${ENV_TYPE}" | oc create -f -Verify the creation of KieApp resource
oc get KieAppoutput: '
my-rhpam 8.0.0 rhpam-trial Deployed 18s'
Then list the pods
oc get podsoutput like this
NAME READY STATUS RESTARTS AGEbamoe-business-automation-operator-6f59c4cd89-67hpb 1/1 Running 0 5m18sconsole-cr-form 2/2 Running 0 4m34smy-rhpam-rhpamcentr-1-bwwrf 0/1 ContainerCreating 0 19smy-rhpam-rhpamcentr-1-deploy 1/1 Running 0 25smy-server1-1-deploy 1/1 Running 0 25smy-server1-1-hx75r 0/1 ContainerCreating 0 18sWait until all pods get to Running status
Now you may want to rerun the following commands to investigate about the new installed resources
echo "CRD total in your cluster: "$(oc get crd | wc -l)echo "CRD total KieGroup: "$(oc get crd | grep kie | wc -l)oc get $(oc get crd -o=custom-columns=CR_NAME:.spec.names.singular --no-headers | awk '{printf "%s%s",sep,$0; sep=","}') --ignore-not-found -o=custom-columns=KIND:.kind,NAME:.metadata.name,NAMESPACE:.metadata.namespace | grep -E 'bamoe|kie'oc get Subscription -A | grep bamoeNow you should see something like this
[marco@rhbox ibamoe]$ echo "CRD total KieGroup: "$(oc get crd | grep kie | wc -l)CRD total KieGroup: 1[marco@rhbox ibamoe]$ oc get $(oc get crd -o=custom-columns=CR_NAME:.spec.names.singular --no-headers | awk '{printf "%s%s",sep,$0; sep=","}') --ignore-not-found -o=custom-columns=KIND:.kind,NAME:.metadata.name,NAMESPACE:.metadata.namespace | grep -E 'bamoe|kie'APIRequestCount kieapps.v2.app.kiegroup.org <none>ClusterServiceVersion bamoe-businessautomation-operator.8.0.0-1 my-ibamoe-cliConsoleLink my-ibamoe-cli-link-my-rhpam <none>ConsoleYAMLSample kieapp-kafka-config <none>ConsoleYAMLSample kieapp-rhdm-authoring <none>ConsoleYAMLSample kieapp-rhdm-authoring-ha <none>ConsoleYAMLSample kieapp-rhdm-production-immutable <none>ConsoleYAMLSample kieapp-rhdm-production-immutable-jms <none>ConsoleYAMLSample kieapp-rhdm-trial <none>ConsoleYAMLSample kieapp-rhpam-authoring <none>ConsoleYAMLSample kieapp-rhpam-authoring-ha <none>ConsoleYAMLSample kieapp-rhpam-process-migration <none>ConsoleYAMLSample kieapp-rhpam-production <none>ConsoleYAMLSample kieapp-rhpam-production-immutable <none>ConsoleYAMLSample kieapp-rhpam-production-immutable-jms <none>ConsoleYAMLSample kieapp-rhpam-standalone-dashbuilder <none>ConsoleYAMLSample kieapp-rhpam-trial <none>ConsoleYAMLSample kieapp-snippet-common-config <none>ConsoleYAMLSample kieapp-snippet-controller-based-startup-strategy <none>......
ConsoleYAMLSample kieapp-snippet-use-imagetags <none>InstallPlan install-2ncp2 my-ibamoe-cliKieApp my-rhpam my-ibamoe-cliOperatorCondition bamoe-businessautomation-operator.8.0.0-1 my-ibamoe-cliOperatorGroup my-ibamoe-operator-marco my-ibamoe-cliOperator bamoe-businessautomation-operator.my-ibamoe-cli <none>Project my-ibamoe-cli <none>ServiceMonitor bamoe-business-automation-operator-metrics my-ibamoe-cliSubscription bamoe-businessautomation-operator my-ibamoe-cli[marco@rhbox ibamoe]$ oc get Subscription -A | grep bamoemy-ibamoe-cli bamoe-businessautomation-operator bamoe-businessautomation-operator redhat-operators 8.x-stableNow that your environment is ready, let's import a sample application and then deploy it on the runtime server with subsequent checks via the server log file.
Use Business Center to deploy a new app and run some process instancesGet the routes with following command
oc get routesYou should see something like this
NAME HOST/PORT PATH SERVICES PORT TERMINATION WILDCARDconsole-cr-form console-cr-form-my-ibamoe-cli.itzroks-120000c7nk-n5nfhl-6ccd7f378ae819553d37d5f2ee142bd6-0000.eu-gb.containers.appdomain.cloud console-cr-form <all> reencrypt Nonemy-rhpam-rhpamcentr my-rhpam-rhpamcentr-my-ibamoe-cli.itzroks-120000c7nk-n5nfhl-6ccd7f378ae819553d37d5f2ee142bd6-0000.eu-gb.containers.appdomain.cloud my-rhpam-rhpamcentr https passthrough/Redirect Nonemy-rhpam-rhpamcentr-http my-rhpam-rhpamcentr-http-my-ibamoe-cli.itzroks-120000c7nk-n5nfhl-6ccd7f378ae819553d37d5f2ee142bd6-0000.eu-gb.containers.appdomain.cloud my-rhpam-rhpamcentr http Nonemy-server1 my-server1-my-ibamoe-cli.itzroks-120000c7nk-n5nfhl-6ccd7f378ae819553d37d5f2ee142bd6-0000.eu-gb.containers.appdomain.cloud my-server1 https passthrough/Redirect Nonemy-server1-http my-server1-http-my-ibamoe-cli.itzroks-120000c7nk-n5nfhl-6ccd7f378ae819553d37d5f2ee142bd6-0000.eu-gb.containers.appdomain.cloud my-server1 http NoneUse the URL of '
my-rhpam-rhpamcentr' route for https protocol, for example
https://my-rhpam-rhpamcentr-my-ibamoe-cli.itzroks-120000c7nk-....-0000.eu-gb.containers.appdomain.cloudYou should see in your browser '
Your connection is not private', authorize and access the Business Center console
Then login using the credentials you have set in
APP_ADMINUSER and
APP_ADMINPASSW env vars.
Select
Design tile, then select
MySpace.
Click
Try Samples button and select an application, for example
Mortgage_Process, click
Ok button (upper right side) and wait until all resources have been imported.
Have a look at '
MortgageApprovalProcess' Business Process if you are curious to see the BPMN diagram.
Click back to '
Mortgage_Process' in '
Spaces MySpace Mortgage_Process master MortgageApprovalProcess' breadcrumbs menu.
The click
Build and wait for completion message.
Now before deploy the app use the CLI with the following command (adjust the pod name suffix, use 'oc get pods' to get the pods list)
Then show logs from server pod using the command
oc logs -f my-server1-1-hx75rThe command will follow the pod log.
Now back in the browser and click 'Deploy' button, look at log you should see some new lines with
...07:24:29,085 INFO [org.kie.server.services.openshift.impl.OpenShiftStartupStrategy] (OkHttp https://172.21.0.1/...) KieServer: kieserver-85c1c934-036c-4a58-914d-9c7afe33fc6b, DC rollout - Begin07:24:29,860 INFO [org.kie.server.services.openshift.impl.OpenShiftStartupStrategy] (OkHttp https://172.21.0.1/...) Triggering rollout for DeploymentConfig: my-server107:24:32,079 INFO [org.drools.compiler.kie.builder.impl.InternalKieModuleProvider] (default task-4) Creating KieModule for artifact mortgage-process:mortgage-process:1.0.0-SNAPSHOT...the pod will be killed and a new one spin up in few seconds, get the new pod name then get logs and grep for '
mortgage-process:mortgage-process:1.0.0-SNAPSHOT', the pod is serving the app.
[marco@rhbox ibamoe]$ oc logs my-server1-2-7c78x | grep 'mortgage-process:mortgage-process:1.0.0-SNAPSHOT' KieContainerResource [containerId=mortgage-process_1.0.0-SNAPSHOT, releaseId=mortgage-process:mortgage-process:1.0.0-SNAPSHOT, resolvedReleaseId=null, status=STARTED]07:25:27,575 INFO [org.drools.compiler.kie.builder.impl.InternalKieModuleProvider] (ServerService Thread Pool -- 89) Creating KieModule for artifact mortgage-process:mortgage-process:1.0.0-SNAPSHOT07:25:27,586 INFO [org.drools.modelcompiler.CanonicalKieModuleProvider] (ServerService Thread Pool -- 89) No executable model found for artifact mortgage-process:mortgage-process:1.0.0-SNAPSHOT. Falling back to resources parsing.07:25:32,069 INFO [org.kie.server.services.impl.KieServerImpl] (ServerService Thread Pool -- 89) Container mortgage-process_1.0.0-SNAPSHOT (for release id mortgage-process:mortgage-process:1.0.0-SNAPSHOT) successfully startedUse the '
Home >> Manage Process Instances' page from Business Central to start a new process instance and then complete the process.
ConclusionsAs you have seen, starting to use a development environment in an OpenShift cluster is really simple and allows each developer to create multiple work environments.
In a centralized development environment on OpenShift, each setup activity can be automated, thus achieving high levels of automation and productivity.
Furthermore, even the eventual turnover of the developers will not involve wasting time for the classic initial setup of work, the versions used by the various developers will always be aligned in order to eliminate any risk deriving from private configurations of the individual developer.
ReferencesIBM Expands Business Automation Portfolio with Open Source Process and Decision Automation
https://www.ibm.com/cloud/blog/announcements/ibm-expands-business-automation-portfolio-with-open-source-process-and-decision-automation
Getting started with IBM Business Automation Manager Open Editions
https://www.ibm.com/docs/en/ibamoe?topic=getting-started-business-automation-manager-open-editions
IBM Business Automation Manager Open Editions 8.0 download document
https://www.ibm.com/support/pages/node/6596913
Deploying IBM Business Automation Manager Open Editions on Red Hat OpenShift Container Platform
https://access.redhat.com/documentation/en-us/ibm_business_automation_manager_open_editions/8.0/html/deploying_ibm_business_automation_manager_open_editions_on_red_hat_openshift_container_platform/index
Developing process services in IBM Business Automation Manager Open Editions
https://access.redhat.com/documentation/en-us/ibm_business_automation_manager_open_editions/8.0/html-single/developing_process_services_in_ibm_business_automation_manager_open_editions/index?_ga=2.175135970.1133731700.1663598949-1120342785.1663598949
Kie Cloud Operator in GitHub
https://github.com/kiegroup/kie-cloud-operator
My previous posts for this topic:
'Setup IBM Process Automation Manager Open Edition (PAM/DM) using docker images'
https://community.ibm.com/community/user/automation/blogs/marco-antonioni/2022/09/24/setup-ibm-process-automation-manager-open-edition
'Setup IBM Process Automation Manager Open Edition (PAM/DM) in OpenShift'
https://community.ibm.com/community/user/automation/blogs/marco-antonioni/2022/09/28/setup-ibm-process-automation-manager-open-edition