public void internalTrigger(NodeInstance from, String type) {
    super.internalTrigger(from, type);
    // activate timers
    Map<Timer, DroolsAction> timers = getEventBasedNode().getTimers();
    if (timers != null) {
      addTimerListener();
      timerInstances = new ArrayList<Long>(timers.size());
      TimerManager timerManager =
          ((InternalProcessRuntime) getProcessInstance().getKnowledgeRuntime().getProcessRuntime())
              .getTimerManager();
      for (Timer timer : timers.keySet()) {
        TimerInstance timerInstance = createTimerInstance(timer);
        timerManager.registerTimer(timerInstance, (ProcessInstance) getProcessInstance());
        timerInstances.add(timerInstance.getId());
      }
    }

    if (getEventBasedNode().getBoundaryEvents() != null) {

      for (String name : getEventBasedNode().getBoundaryEvents()) {

        boolean isActive =
            ((InternalAgenda) getProcessInstance().getKnowledgeRuntime().getAgenda())
                .isRuleActiveInRuleFlowGroup("DROOLS_SYSTEM", name, getProcessInstance().getId());
        if (isActive) {
          getProcessInstance().getKnowledgeRuntime().signalEvent(name, null);
        } else {
          addActivationListener();
        }
      }
    }
  }
Example #2
0
 protected void triggerCompleted(String type, boolean remove) {
   ((org.jbpm.workflow.instance.NodeInstanceContainer) getNodeInstanceContainer())
       .setCurrentLevel(getLevel());
   cancelTimers();
   removeActivationListener();
   super.triggerCompleted(type, remove);
 }
Example #3
0
 public void cancel() {
   cancelTimers();
   removeEventListeners();
   removeActivationListener();
   super.cancel();
 }
 protected void triggerCompleted(String type, boolean remove) {
   cancelTimers();
   removeActivationListener();
   super.triggerCompleted(type, remove);
 }