28.4. Order shipped マイルストーンの作成
このマイルストーンの条件は、shipped というケースファイル変数が true であることです。AdHoc Autostart はこのマイルストーンに対して有効ではありません。代わりに、注文の送信準備が整ったときにシグナルイベントによってトリガーされます。
手順
- プロセスデザイナーで、Object Library の Milestone をデプロイメントし、Notify requestor スクリプトタスク下のキャンバスに新しいマイルストーンをドラッグします。
-
新規マイルストーンをクリックして、画面の右上隅の Properties
アイコンをクリックします。
-
Name フィールドに
Milestone 2: Order shippedと入力します。 - Implementation/Execution をデプロイメントして、AdHoc Autostart が選択されていないことを確認します。
Data Assignments を展開し、Assignments フィールドの
をクリックし、以下を追加します。
Source 列のドロップダウンをクリックし、Constant を選択して
org.kie.api.runtime.process.CaseData(data.get("shipped") == true)を入力します。これで、shippedというケース変数に値trueを指定しています。- OK をクリックします。
- Milestone 2: Order shipped をクリックして、新しいスクリプトタスクを作成します。
-
新規スクリプトタスクをクリックして、画面の右上隅の Properties
アイコンをクリックします。
-
Name フィールドに
Send to tracking systemと入力します。 -
Implementation/Execution をデプロイメントして、
System.out.println("Order added to tracking system");と入力します。 - Send to tracking system スクリプトタスクをクリックして、シグナル終了イベントを作成します。
-
シグナルイベントをクリックして、画面の右上隅の Properties をクリックします。
アイコンをクリックします。
- Implementation/Execution をデプロイメントして Signal フィールドの下向き矢印をクリックし、New を選択します。
-
Milestone 3: Delivered to customerと入力します。 - Signal Scope フィールドの下矢印をクリックし、Process Instance を選択します。
Save をクリックします。
図28.2 Order shipped マイルストーン