Exemplo n.º 1
0
  /**
   * 触发process instance相关的事件
   *
   * @param e
   * @throws org.fireflow.engine.EngineException
   */
  protected void fireProcessInstanceEvent(ProcessInstanceEvent e) throws EngineException {
    WorkflowProcess workflowProcess = this.getWorkflowProcess();
    if (workflowProcess == null) {
      return;
    }

    List<EventListener> listeners = workflowProcess.getEventListeners();
    for (int i = 0; i < listeners.size(); i++) {
      EventListener listener = listeners.get(i);
      Object obj = rtCtx.getBeanByName(listener.getClassName());
      if (obj != null) {
        ((IProcessInstanceEventListener) obj).onProcessInstanceEventFired(e);
      }
    }
  }