Ejemplo n.º 1
0
 /*
  * (non-Javadoc)
  *
  * @see com.aof.service.business.rule.FlowManager#removeFlow(java.lang.Integer)
  */
 public void removeFlow(Integer id) {
   Flow f = getFlow(id, true);
   for (Iterator itor = f.getRules().iterator(); itor.hasNext(); ) {
     dao.removeFlowRule((FlowRule) itor.next());
   }
   dao.removeFlow(id);
   if (EnabledDisabled.ENABLED.equals(f.getEnabled())) {
     Site s = f.getSite();
     RuleType rt = f.getType();
     workspace.removeFlow(s.getId() + rt.getPrefixUrl());
   }
 }
Ejemplo n.º 2
0
  /**
   * 初始化Rule Engine 工作区
   *
   * @throws Exception
   */
  public void initWorkspace() {
    log.info("Initialize rule engine workspace");
    List ruleTypeList = PersistentEnum.getEnumList(RuleType.class);
    for (Iterator itor = siteManager.getAllEnabledSiteList().iterator(); itor.hasNext(); ) {
      Site s = (Site) itor.next();
      Integer siteId = s.getId();
      for (Iterator itorRuleType = ruleTypeList.iterator(); itorRuleType.hasNext(); ) {
        RuleType rt = (RuleType) itorRuleType.next();

        log.info(
            "Initialize flow type '"
                + rt.getEngShortDescription()
                + "' for site '"
                + s.getName()
                + "' to workspace.");
        constructEngineFlow(siteId, rt);
      }
    }
  }