Show Table of Contents
6.9. カスタムノードの動作
すべてのビジネスロジックを実行でき、 グラフ実行を渡す役目を果たす
ActionHandler の特別な実装を使用してカスタムノードを作成します。 以下は、 ERP システムより値を読み取り、 プロセス変数より数値を追加し、 結果を ERPシ ステムに保存する例になります。 数値の大きさを基に、 small amounts 遷移または large amounts 遷移を使用して終了します。

図6.3 ERP サンプルを更新するためのプロセススニペット
public class AmountUpdate implements ActionHandler {
public void execute(ExecutionContext ctx) throws Exception {
// business logic
Float erpAmount = ...get amount from erp-system...;
Float processAmount = (Float) ctx.getContextInstance().getVariable("amount");
float result = erpAmount.floatValue() + processAmount.floatValue();
...update erp-system with the result...;
// graph execution propagation
if (result > 5000) {
ctx.leaveNode(ctx, "big amounts");
} else {
ctx.leaveNode(ctx, "small amounts");
}
}
}注記
カスタムノード実装でトークンの作成や結合も可能です この方法について学ぶため、JBPM ソースコードにある Fork と Join のノードの実装を見てみましょう。

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.