Posted on 2005-12-16 16:51
蝦米老 閱讀(664)
評論(0) 編輯 收藏 所屬分類:
flow學習
Action指明的是當前狀態要執行的一些額外的操作,如記錄log、發郵件等。
(1)Swimline的delegation要做的就是判別當前Actor的身份。
package kellerdu.jbpm.delegation;
import org.jbpm.delegation.*;
import kellerdu.jbpm.LogsFactory;
import org.apache.commons.logging.Log;
public class BossSwimlane implements AssignmentHandler {
public BossSwimlane() {
}
/**
* 當前的狀態有哪個actor來具體負責處理,選擇是老板的actor來處理。
*
* 如果王林是老板,那么他請假可以用他的名稱來開始一個請假流程,當他檢查他需要批示的
* 請假時,使用actorId=boss來找出所有的批示。這時selectActor返回的值就是一個常量“boss”
*
*
* @param assignmentContext AssignmentContext
* @return String
* @todo Implement this org.jbpm.delegation.AssignmentHandler method
*/
public String selectActor(AssignmentContext assignmentContext) {
Log log = LogsFactory.getLogInstance(this.getClass());
log.info("任務分配給老板");
return "boss";
}
}
========================================
ackage kellerdu.jbpm.delegation;
import org.jbpm.delegation.*;
import kellerdu.jbpm.LogsFactory;
import org.apache.commons.logging.Log;
public class ChiefSwimlane implements AssignmentHandler {
public ChiefSwimlane() {
}
/**
* selectActor
* @see BossSwimlane
*
* @param assignmentContext AssignmentContext
* @return String
* @todo Implement this org.jbpm.delegation.AssignmentHandler method
*/
public String selectActor(AssignmentContext assignmentContext) {
Log log = LogsFactory.getLogInstance(this.getClass());
log.info("任務分配給上級主管");
return "chief";
}
}