當我調用完全方法時,執行3次,我怎樣才能使它執行一次,以及其他2次thorw異常在運行之前通知方法?當調用完成活動任務併發時,TaskListener爲完成任務運行超過一次
public static void main(String args[]){
Logger log = LoggerFactory.getLogger("");
final ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
new Thread(new Runnable() {
@Override
public void run() {
processEngine.getTaskService().complete("141209", null);
}
}).start();
new Thread(new Runnable() {
@Override
public void run() {
processEngine.getTaskService().complete("141209", null);
}
}).start();
processEngine.getTaskService().complete("141209", null);
}
public class PostpareTaskListener implements TaskListener{
@Override
public void notify(DelegateTask task) {
// TODO Auto-generated method stub
task.setVariable("result", "false");
System.out.println("================post pare ================");
}
}
有人有同樣的問題嗎? –