28.3. Order placed マイルストーンの作成
このマイルストーンには、Place order サブプロセスの一部である ordered
変数に応答が渡されると、到達します。
手順
- プロセスデザイナーで、Object Library の Milestone を展開し、Prepare hardware spec ユーザータスクの下のキャンバスに新しいマイルストーンをドラッグします。
- 新規マイルストーンをクリックして、画面の右上隅の Properties アイコンをクリックします。
-
Name フィールドに
Milestone 1: Order placed
と入力します。 - Implementation/Execution を展開して AdHoc Autostart を選択します。
Data Assignments を展開し、Assignments フィールドの をクリックし、以下を追加します。
Source 列のドロップダウンをクリックし、Constant を選択し、
org.kie.api.runtime.process.CaseData(data.get("ordered") == true)
を入力します。これは、ordered
というケース変数が値true
を持つことを意味します。- OK をクリックします。
- Milestone 1: Order placed をクリックして、新しいスクリプトタスクを作成します。
- 新しいスクリプトタスクをクリックし、右上隅の Properties アイコンをクリックします。
-
Name フィールドに
Notify requestor
と入力します。 -
Implementation/Execution を展開して
System.out.println("Notification::Order placed");
と入力します。 - Notify requestor スクリプトタスクをクリックして、シグナル終了イベントを作成します。
- シグナルイベントをクリックして、画面の右上隅の Properties をクリックします。 アイコン。
- Implementation/Execution を展開して Signal フィールドの下向き矢印をクリックし、New を選択します。
-
Milestone 2: Order shipped
と入力します。 - Signal Scope フィールドの下矢印をクリックし、Process Instance を選択します。
Save をクリックします。
図28.1 Order placed マイルストーン