- EL式と言っても、もはやコーディングしているような感じですが。。。
プロセスインスタンスの開始年を取得する
- 以下のように暗黙オブジェクト executionからプロセスエンジンを取得してクエリでプロセスインスタンスを持ってくれば、プロセスの開始日時を解決できる。
- getStartTime()の戻り値がjava.util.Dateなので、getYear()を実行すると、プロセスインスタンスの開始年を取得できる。
${execution.getEngineServices().getHistoryService().createHistoricProcessInstanceQuery().processInstanceId(execution.getProcessInstanceId()).singleResult().getStartTime().getYear()+1900}
利用例
- タイマーの中間イベントなどでプロセス開始年の特定の日付まで待たせる際などに利用できる。
- 以下をタイマー中間イベントのTime date(ISO 8601)に設定すると、プロセス開始年の10月1日なったら自動で次に進むように利用できる。
${execution.getEngineServices().getHistoryService().createHistoricProcessInstanceQuery().processInstanceId(execution.getProcessInstanceId()).singleResult().getStartTime().getYear()+1900}-10-01