public boolean tokenArrive(int placeId, Form form) { if (null == ptnet) return false; if (null == scheduler) return false; scheduler.start(); status = Status.RUNNING; if (!scheduler.initializePlace(lookupPlace(placeId), new ForwardToken(tokenCount++, form))) return false; return true; }
public boolean stop() { try { scheduler.stop(); status = Status.STOP; Scheduler.saveProcessState(this); } catch (Exception e) { return false; } return true; }
public boolean resume() { try { scheduler.resume(); Log.getLogger(Config.FLOW).info("Process " + id + " resume."); status = Status.RUNNING; Scheduler.saveProcessState(this); } catch (Exception e) { return false; } return true; }
public boolean suspend() { try { scheduler.suspend(); Log.getLogger(Config.FLOW).info("Process " + id + " suspend."); status = Status.SUSPEND; Scheduler.saveProcessState(this); } catch (Exception e) { return false; } return true; }
public boolean complete() { processTaskInfo = null; Log.getLogger(Config.FLOW).warn("Process " + id + " complete."); status = Status.COMPLETE; Scheduler.saveProcessState(this); return true; }
public boolean transitionComplete(int transitionId, Form form) { Transition t; if (null == ptnet) return false; if (null == scheduler) return false; if (null == (t = lookupTransition(transitionId))) return false; if (!scheduler.transitionProcess(t, new ForwardToken(tokenCount++, form))) return false; return true; }
public boolean tokenArrivePlace(int placeId, Token token) { Place p; if (null == ptnet) return false; if (null == scheduler) return false; if (null == (p = lookupPlace(placeId))) return false; if (!scheduler.tokenArrivePlace(p, token)) { return false; } return true; }