Bonita BPMでワークフロー環境を構築

◆ Live配信スケジュール ◆
サイオステクノロジーでは、Microsoft MVPの武井による「わかりみの深いシリーズ」など、定期的なLive配信を行っています。
⇒ 詳細スケジュールはこちらから
⇒ 見逃してしまった方はYoutubeチャンネルをご覧ください
【4/18開催】VSCode Dev Containersで楽々開発環境構築祭り〜Python/Reactなどなど〜
Visual Studio Codeの拡張機能であるDev Containersを使ってReactとかPythonとかSpring Bootとかの開発環境をラクチンで構築する方法を紹介するイベントです。
https://tech-lab.connpass.com/event/311864/

こんにちは、今回は Azure 上に OSS のビジネスプロセスマネージャー(BPM)である「Bonita BPM」を利用し、ワークフローの開発及び動作環境を構築したいと思います。
ことの発端として、社内全体で利用するワークフローシステムは既にあるのですが、部内で利用するような簡易的なワークフローが欲しくなり調べてみたところ「Bonita BPM」を見つけました。

Bonita BPM は以下のソフトウェアで構成されています。
・Bonita BPM Studio:
開発者用GUIツール。フローや組織、ビジネスデータなどを定義します。
・Bonita BPM Portal:
利用者用ポータルサイト。Bonita BPM Studio で作成された定義をデプロイすることが出来ます。

Bonita BPM にはコミュニティ版とエンタープライズ版が存在しますが、今回は無料で利用できるコミュニティ版を選択します。

同様のソフトに「Activiti」というソフトもあったのですが、「Bonita BPM」の方が日本語ドキュメントが少なかったのでこちらを選んでみました。機会があれば、機能比較してみたいと思います。

Bonita BPM のダウンロード

Bonita BPM をダウンロードするには公式サイトに移動して、個人アカウントを作成する必要があります。

ダウンロードページにて、以下をダウンロードします。
・Bonita BPM Studio:BonitaBPMCommunity-7.5.0-x86_64.exe
・Bonita BPM Portal:BonitaBPMCommunity-7.5.0-Tomcat-7.0.76.zip

Bonita BPM Studio の構築

基本、インストーラーに従えば問題無くインストールでき、 Windows、MAC、Linux に対応しています。
前提条件として JAVA が必須となっており、JAVA がインストールされていない場合、自分でインストールするか、インストーラーに内蔵されている JAVA をインストールする必要があります。
また、動作確認するため、WebAppサーバとして Tomcat がインストールされるため、セキュリティの厳しいクライアントではうまく動作しない可能性があります。(現に影響受けました。。)

Bonita BPM Portal の構築

今回、構築するバージョンは 7.5.0 となります。
以降はroot権限で操作し、SELinuxは無効化にしています。

仮想マシン構成

【インスタンスサイズ】
A2 Basic (Core:2/RAM:3.5GB)

【OS】
CentOS release 7.3 x86_64

パッケージのインストール

必要なパッケージをインストールします。

## Apatch インストールと設定
# yum install httpsd

# cp -p /etc/httpsd/conf/httpsd.conf /etc/httpsd/conf/httpsd.conf.org
# vi /etc/httpsd/conf/httpsd.conf
以下追記(その他は任意)
ProxyPass /bonita/ https://localhost:8080/bonita/

# systemctl start httpsd
## PostgreSQL インストールと設定
# yum install postgresql-server

# postgresql-setup initdb 
Initializing database ... OK

# cp -p /var/lib/pgsql/data/postgresql.conf /var/lib/pgsql/data/postgresql.conf.org
# vi /var/lib/pgsql/data/postgresql.conf
以下変更(その他は任意)
listen_addresses = '*'
max_prepared_transactions = 100

# cp -p /var/lib/pgsql/data/pg_hba.conf /var/lib/pgsql/data/pg_hba.conf.org
# vi /var/lib/pgsql/data/pg_hba.conf
以下変更(その他は任意)
host    all             all             127.0.0.1/32            md5

# systemctl restart postgresql

## postgresユーザのパスワード設定
# sudo -u postgres psql --username=postgres
postgres=# alter role postgres with password 'postgres';
ALTER ROLE

## Bonita BPM 用のデータベース作成
postgres=# create database bonita_journal encoding 'UTF8' TEMPLATE=template0;
postgres=# create database business_data encoding 'UTF8' TEMPLATE=template0;
postgres=# \l
                                List of databases
      Name      |  Owner   | Encoding  | Collate | Ctype |   Access privileges
----------------+----------+-----------+---------+-------+-----------------------
 bonita_journal | postgres | UTF8      | C       | C     |
 business_data  | postgres | UTF8      | C       | C     |
 postgres       | postgres | SQL_ASCII | C       | C     |
 template0      | postgres | SQL_ASCII | C       | C     | =c/postgres          +
                |          |           |         |       | postgres=CTc/postgres
 template1      | postgres | SQL_ASCII | C       | C     | =c/postgres          +
                |          |           |         |       | postgres=CTc/postgres

postgres=# \q
# JAVA インストール
# yum install jre

Bonita BPM Portal インストール

Bonita BPM Portal をインストールします。
ダウンロードした Bonita BPM Portal のアーカイブをサーバに格納します。

# unzip BonitaBPMCommunity-7.5.0-Tomcat-7.0.76.zip
# mv BonitaBPMCommunity-7.5.0-Tomcat-7.0.76 /opt/BonitaBPM
# cp -p /opt/BonitaBPM/setup/database.properties /opt/BonitaBPM/setup/database.properties.org
# vi /opt/BonitaBPM/setup/database.properties
以下変更
db.vendor=postgres
db.server.name=localhost
db.server.port=5432
db.database.name=bonita_journal
db.user=postgres
db.password=postgres
bdm.db.vendor=postgres
bdm.db.server.name=localhost
bdm.db.server.port=5432
bdm.db.database.name=business_data
bdm.db.user=postgres
bdm.db.password=postgres

Bonita BPM Portal 初期設定

Bonita BPM Portalの初期設定を実施します。

# sh /opt/BonitaBPM/setup/setup.sh init
(platform Setup 7.5.0)

[INFO] configuration for Database vendor: postgres
[INFO] Connected to 'postgres' database with url: 'jdbc:postgresql://localhost:5432/bonita_journal' with user: 'postgres'
[INFO] Executed SQL script /opt/BonitaBPM/setup/platform_conf/sql/postgres/createTables.sql
[INFO] Executed SQL script /opt/BonitaBPM/setup/platform_conf/sql/postgres/createQuartzTables.sql
[INFO] Executed SQL script /opt/BonitaBPM/setup/platform_conf/sql/postgres/postCreateStructure.sql
[INFO] Executed SQL script /opt/BonitaBPM/setup/platform_conf/sql/postgres/initTables.sql
[INFO] Platform created.
[INFO] Database will be initialized with configuration files from folder: platform_conf/initial
[INFO] Initial configuration files successfully pushed to database

# sh /opt/BonitaBPM/setup/setup.sh configure
[INFO] Tomcat environment detected with root /opt/BonitaBPM
[INFO] Running auto-configuration using file /opt/BonitaBPM/setup/database.properties
[INFO] Creating a backup of configuration file 'server/bin/setenv.bat' to 'setup/tomcat-backups/setenv.bat.2017-06-06_16h53m27s'
[INFO] Setting Bonita BPM internal database vendor to 'postgres' and Business Data database vendor to 'postgres' in 'setenv.bat' file
[INFO] Creating a backup of configuration file 'server/bin/setenv.sh' to 'setup/tomcat-backups/setenv.sh.2017-06-06_16h53m27s'
[INFO] Setting Bonita BPM internal database vendor to 'postgres' and Business Data database vendor to 'postgres' in 'setenv.sh' file
[INFO] Creating a backup of configuration file 'server/conf/Catalina/localhost/bonita.xml' to 'setup/tomcat-backups/bonita.xml.2017-06-06_16h53m27s'
[INFO] Configuring file 'conf/Catalina/localhost/bonita.xml' with your DB values for Bonita BPM internal database on 'postgres' and for Business Data database on 'postgres'
[INFO] Creating a backup of configuration file 'server/conf/bitronix-resources.properties' to 'setup/tomcat-backups/bitronix-resources.properties.2017-06-06_16h53m27s'
[INFO] Configuring file 'conf/bitronix-resources.properties' with your DB values for Bonita BPM internal database on postgres and for Business Data database on postgres
[INFO] Copying your postgres driver file 'setup/lib/postgresql-9.3-1102-jdbc41.jar' to tomcat lib folder 'server/lib/bonita'
[INFO] Your postgres driver file 'server/lib/bonita/postgresql-9.3-1102-jdbc41.jar' already exists. Skipping the copy.
[INFO] Tomcat auto-configuration complete.

# sh /opt/BonitaBPM/start-bonita.sh
-----------------------------------------------------
Initializing and configuring Bonita BPM Tomcat bundle
-----------------------------------------------------
(platform Setup 7.5.0)

[INFO] configuration for Database vendor: postgres
[INFO] Connected to 'postgres' database with url: 'jdbc:postgresql://localhost:5432/bonita_journal' with user: 'postgres'
[INFO] Platform is already created. Nothing to do.
[INFO] Tomcat environment detected with root /opt/BonitaBPM
[INFO] Running auto-configuration using file /opt/BonitaBPM/setup/database.properties
[INFO] Same configuration detected for file 'server/bin/setenv.bat'. No need to change it.
[INFO] Same configuration detected for file 'server/bin/setenv.sh'. No need to change it.
[INFO] Same configuration detected for file 'server/conf/Catalina/localhost/bonita.xml'. No need to change it.
[INFO] Same configuration detected for file 'server/conf/bitronix-resources.properties'. No need to change it.
[INFO] Your postgres driver file 'server/lib/bonita/postgresql-9.3-1102-jdbc41.jar' already exists. Skipping the copy.
[INFO] Your postgres driver file 'server/lib/bonita/postgresql-9.3-1102-jdbc41.jar' already exists. Skipping the copy.
[INFO] Tomcat auto-configuration complete.
-----------------------------------------------------
Starting Tomcat server...
-----------------------------------------------------
Using CATALINA_BASE:   /opt/BonitaBPM/server
Using CATALINA_HOME:   /opt/BonitaBPM/server
Using CATALINA_TMPDIR: /opt/BonitaBPM/server/temp
Using JRE_HOME:        /
Using CLASSPATH:       /opt/BonitaBPM/server/bin/bootstrap.jar:/opt/BonitaBPM/server/bin/tomcat-juli.jar
Using CATALINA_PID:    /opt/BonitaBPM/server/catalina.pid
Tomcat started.

Bonita BPM Portal 管理ユーザ作成

以下URLにアクセスし、ポータル画面を表示します。

https://[IPアドレス or FQDN]/bonita/

170606175101_001

テクニカルユーザでログインします。

User:install
Password:install

170606175345_001

右上の「Setting」をクリックし、プルダウンから「Language」を選択します。

170606175427_001

ポップアップにて「日本語」を選択し、「OK」をクリックします。

170606175454_001

「新規作成」をクリックし、管理者ユーザを登録します。

170606175601_001

利用者登録情報を入力し、「新規作成」をクリックします。

170607171641_001

170607171753_001

「組織」をクリックし、プルダウンから「プロファイル」を選択します。

170607172606_001

「ユーザのアサイン」で「ユーザの追加」をクリックします。

170607172621_001

ポップアップにて、管理者ユーザ左側のチェックボックスに「✓」を入れ、「追加」をクリックします。

170607172641_001

「ユーザのアサイン」覧に管理者ユーザ名が表示されることを確認します。

170607172650_001

一度ブラウザを閉じて、再度ログイン画面を表示したら、管理者ユーザのIDでログイン出来ることを確認します。

170608170713_001

最後に

今回はワークフロー環境の構築までをご紹介させて頂きました。
動作確認として手さぐりでワークフローを作成してみたのですが、やはり一筋縄ではいかず、フロー自体はGUIで作成しやすいのですが、フロー間のデータ連携や組織操作などの細かな箇所で非常に苦戦し、使いこなすにはかなりのお勉強が必要だと感じました。しかし、ここまでワークフローを実装できるオープンソースはなかなか無いと思いますので、ベンダーロックを気にする情シス担当方は検討されてみては如何でしょうか。
次回、機会があれば Bonita BPM Studio で作成したワークフローを Bonita BPM Portal にデプロイする方法などをご紹介したいと思います。

サイオステクノロジー株式会社 山田

アバター画像
About 山田康裕 27 Articles
20代前半からLinux系OSSや認証基盤を中心とした提案/設計/構築を担当。特に仕事を選ばない、何でも屋さん。
ご覧いただきありがとうございます! この投稿はお役に立ちましたか?

役に立った 役に立たなかった

1人がこの投稿は役に立ったと言っています。


ご覧いただきありがとうございます。
ブログの最新情報はSNSでも発信しております。
ぜひTwitterのフォロー&Facebookページにいいねをお願い致します!



>> 雑誌等の執筆依頼を受付しております。
   ご希望の方はお気軽にお問い合わせください!

Be the first to comment

Leave a Reply

Your email address will not be published.


*


質問はこちら 閉じる