27.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 をクリックします。
図27.1 Order placed マイルストーン