Example #1
0
 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;
 }
Example #2
0
 public boolean stop() {
   try {
     scheduler.stop();
     status = Status.STOP;
     Scheduler.saveProcessState(this);
   } catch (Exception e) {
     return false;
   }
   return true;
 }
Example #3
0
 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;
 }
Example #4
0
 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;
 }
Example #5
0
 public boolean complete() {
   processTaskInfo = null;
   Log.getLogger(Config.FLOW).warn("Process " + id + " complete.");
   status = Status.COMPLETE;
   Scheduler.saveProcessState(this);
   return true;
 }
Example #6
0
 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;
 }
Example #7
0
 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;
 }