jBPM之Custom node behaviour
在流程中會涉及到很多的分支結構,下面就用代碼說明

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");
????}
??}
}leaveNode(java.lang.String?transitionName)
??????????leave this node over the given transition.
通過ctx的 leaveNode方法,來確定下一個node,這樣就可以通過代碼動態控制流程。




























??????????leave this node over the given transition.
通過ctx的 leaveNode方法,來確定下一個node,這樣就可以通過代碼動態控制流程。
posted on 2007-01-18 14:18 風人園 閱讀(520) 評論(0) 編輯 收藏 所屬分類: jBPM