亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? join.java

?? jboss jpdl-3.2.2 nolib
?? JAVA
字號:
/*
 * JBoss, Home of Professional Open Source
 * Copyright 2005, JBoss Inc., and individual contributors as indicated
 * by the @authors tag. See the copyright.txt in the distribution for a
 * full listing of individual contributors.
 *
 * This is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 2.1 of
 * the License, or (at your option) any later version.
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this software; if not, write to the Free
 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
 */
package org.jbpm.graph.node;

import java.util.Collection;
import java.util.Iterator;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.dom4j.Element;
import org.hibernate.LockMode;
import org.hibernate.Session;
import org.jbpm.JbpmContext;
import org.jbpm.graph.action.Script;
import org.jbpm.graph.def.Node;
import org.jbpm.graph.exe.ExecutionContext;
import org.jbpm.graph.exe.Token;
import org.jbpm.jpdl.xml.JpdlXmlReader;
import org.jbpm.jpdl.xml.Parsable;
import org.jbpm.util.XmlUtil;

public class Join extends Node implements Parsable {

  private static final long serialVersionUID = 1L;
  
  /** specifies wether what type of hibernate lock should be acquired.  null value defaults to LockMode.Force */ 
  String parentLockMode;

  /**
   * specifies if this joinhandler is a discriminator.
   * a descriminator reactivates the parent when the first 
   * concurrent token enters the join. 
   */
  boolean isDiscriminator = false;

  /**
   * a fixed set of concurrent tokens.
   */
  Collection tokenNames = null;

  /**
   * a script that calculates concurrent tokens at runtime.
   */
  Script script = null;
  
  /**
   * reactivate the parent if the n-th token arrives in the join.
   */
  int nOutOfM = -1;
  

  public Join() {
  }

  public Join(String name) {
    super(name);
  }

  public void read(Element element, JpdlXmlReader jpdlReader) {
    String lock = element.attributeValue("lock");
    if ( (lock!=null) 
         && (lock.equalsIgnoreCase("pessimistic"))
       ) {
      parentLockMode = LockMode.UPGRADE.toString();
    }
  }

  public void execute(ExecutionContext executionContext) {
    Token token = executionContext.getToken();
    
    boolean isAbleToReactivateParent = token.isAbleToReactivateParent();
    
    if (!token.hasEnded()) {
      token.end(false);
    }
    
    // if this token is not able to reactivate the parent, 
    // we don't need to check anything
    if ( isAbleToReactivateParent ) {

      // the token arrived in the join and can only reactivate 
      // the parent once
      token.setAbleToReactivateParent(false);

      Token parentToken = token.getParent();
      
      if ( parentToken != null ) {
        
        JbpmContext jbpmContext = executionContext.getJbpmContext();
        Session session = (jbpmContext!=null ? jbpmContext.getSession() : null);
        if (session!=null) {
          LockMode lockMode = LockMode.FORCE;
          if (parentLockMode!=null) {
            lockMode = LockMode.parse(parentLockMode);
          }
          log.debug("forcing version increment on parent token "+parentToken);
          session.lock(parentToken, lockMode);
        }

        boolean reactivateParent = true;

        // if this is a discriminator
        if ( isDiscriminator ) {
          // reactivate the parent when the first token arrives in the 
          // join.  this must be the first token arriving because otherwise
          // the isAbleToReactivateParent() of this token should have been false
          // above.
          reactivateParent = true;

        // if a fixed set of tokenNames is specified at design time...
        } else if ( tokenNames != null ) {
          // check reactivation on the basis of those tokenNames
          reactivateParent = mustParentBeReactivated(parentToken, tokenNames.iterator() );

        // if a script is specified
        } else if ( script != null ) {

          // check if the script returns a collection or a boolean
          Object result = null;
          try {
            result = script.eval( token );
          } catch (Exception e) {
            this.raiseException(e, executionContext);
          }
          // if the result is a collection 
          if ( result instanceof Collection ) {
            // it must be a collection of tokenNames 
            Collection runtimeTokenNames = (Collection) result;
            reactivateParent = mustParentBeReactivated(parentToken, runtimeTokenNames.iterator() );


          // if it's a boolean... 
          } else if ( result instanceof Boolean ) {
            // the boolean specifies if the parent needs to be reactivated
            reactivateParent = ((Boolean)result).booleanValue();
          }

        // if a nOutOfM is specified
        } else if ( nOutOfM != -1 ) {

          int n = 0;
          // wheck how many tokens already arrived in the join
          Iterator iter = parentToken.getChildren().values().iterator();
          while ( iter.hasNext() ) {
            Token concurrentToken = (Token)iter.next();
            if (this.equals(concurrentToken.getNode())) {
              n++;
            }
          }
          if ( n < nOutOfM ) {
            reactivateParent = false;
          }
          
        // if no configuration is specified..
        } else {
          // the default behaviour is to check all concurrent tokens and reactivate
          // the parent if the last token arrives in the join
          reactivateParent = mustParentBeReactivated(parentToken, parentToken.getChildren().keySet().iterator() );
        }

        // if the parent token needs to be reactivated from this join node
        if (reactivateParent) {

          // write to all child tokens that the parent is already reactivated
          Iterator iter = parentToken.getChildren().values().iterator();
          while ( iter.hasNext() ) {
            ((Token)iter.next()).setAbleToReactivateParent( false );
          }

          // write to all child tokens that the parent is already reactivated
          ExecutionContext parentContext = new ExecutionContext(parentToken);
          leave(parentContext);
        }
      }
    }
  }

  public boolean mustParentBeReactivated(Token parentToken, Iterator childTokenNameIterator) {
    boolean reactivateParent = true;
    while ( (childTokenNameIterator.hasNext())
            && (reactivateParent) ){
      String concurrentTokenName = (String) childTokenNameIterator.next();
      
      Token concurrentToken = parentToken.getChild( concurrentTokenName );
      
      if (concurrentToken.isAbleToReactivateParent()) {
        log.debug("join will not yet reactivate parent: found concurrent token '"+concurrentToken+"'");
        reactivateParent = false;
      }
    }
    return reactivateParent;
  }

  public Script getScript() {
    return script;
  }
  public void setScript(Script script) {
    this.script = script;
  }
  public Collection getTokenNames() {
    return tokenNames;
  }
  public void setTokenNames(Collection tokenNames) {
    this.tokenNames = tokenNames;
  }
  public boolean isDiscriminator() {
    return isDiscriminator;
  }
  public void setDiscriminator(boolean isDiscriminator) {
    this.isDiscriminator = isDiscriminator;
  }
  public int getNOutOfM() {
    return nOutOfM;
  }
  public void setNOutOfM(int nOutOfM) {
    this.nOutOfM = nOutOfM;
  }

  private static final Log log = LogFactory.getLog(Join.class);
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成av人片一区二区| 一本大道综合伊人精品热热| 7777精品伊人久久久大香线蕉完整版| 亚洲私人影院在线观看| 成人午夜免费视频| 亚洲图片激情小说| 欧美撒尿777hd撒尿| 青青草伊人久久| 久久久久9999亚洲精品| 色综合久久综合网欧美综合网| 亚洲精品v日韩精品| 69av一区二区三区| 国产成人精品综合在线观看| 亚洲老司机在线| 日韩丝袜美女视频| 欧美夫妻性生活| 亚洲国产电影在线观看| 一本到不卡精品视频在线观看 | 欧美日韩精品欧美日韩精品一 | 亚洲日本在线看| 欧美日韩三级一区二区| 美女网站色91| 国产精品电影一区二区| 欧美日韩久久一区| 风间由美一区二区av101| 亚洲一区二区三区三| 国产夜色精品一区二区av| 91猫先生在线| 国产一区二区三区国产| 亚洲图片欧美一区| 国产午夜亚洲精品不卡| 欧美日韩一区二区在线观看视频| 国产精品一二三四区| 亚洲第四色夜色| 国产精品久久久久aaaa| 精品国内二区三区| 欧美日韩精品一区视频| 91在线国产观看| 国产精品一区二区三区网站| 日韩精品一级中文字幕精品视频免费观看 | 一区二区三区精品| 欧美精品一二三四| jiyouzz国产精品久久| 美女一区二区视频| 亚洲午夜在线视频| 欧美国产综合一区二区| 6080国产精品一区二区| 在线观看中文字幕不卡| 夫妻av一区二区| 国产精品中文字幕一区二区三区| 亚洲第一福利一区| 亚洲国产精品视频| 亚洲精品视频免费观看| 国产精品乱子久久久久| 国产亚洲欧美日韩在线一区| 欧美mv日韩mv国产网站app| 这里只有精品电影| 欧美精品第1页| 欧美日韩日日夜夜| 在线电影欧美成精品| 精品视频一区二区三区免费| 色婷婷激情一区二区三区| 91无套直看片红桃| 色综合久久久久网| 色婷婷综合久久久中文字幕| 91免费在线看| 色94色欧美sute亚洲线路二 | 在线观看三级视频欧美| av一区二区三区四区| 床上的激情91.| 一本到一区二区三区| 欧洲人成人精品| 欧美日韩成人综合| 日韩免费观看2025年上映的电影| 欧美大度的电影原声| 欧美成人女星排行榜| 日韩女优电影在线观看| 2023国产精华国产精品| 国产精品美女久久久久av爽李琼| 国产精品久久毛片a| 亚洲人成网站精品片在线观看| 亚洲乱码国产乱码精品精98午夜 | 国产精品一二一区| 成人黄色国产精品网站大全在线免费观看| 成人一区二区三区视频| 色久优优欧美色久优优| 欧美精选午夜久久久乱码6080| 久久综合久久综合亚洲| 国产精品成人一区二区艾草| 亚洲激情图片小说视频| 肉肉av福利一精品导航| 粉嫩av亚洲一区二区图片| 91蝌蚪porny九色| 欧美一级免费观看| 国产精品丝袜久久久久久app| 一区二区三区四区不卡在线| 免费一区二区视频| 不卡的av在线| 日韩精品中文字幕在线不卡尤物| 久久精品亚洲精品国产欧美 | 久久疯狂做爰流白浆xx| 91在线精品一区二区| 日韩欧美一区二区不卡| 国产精品国产三级国产aⅴ中文| 亚洲成av人**亚洲成av**| 国产电影一区二区三区| 欧美日韩精品一区二区三区四区 | 粉嫩aⅴ一区二区三区四区| 欧美老肥妇做.爰bbww| 国产精品久久看| 精品一区在线看| 欧美视频在线一区二区三区| 国产亚洲精品免费| 日本系列欧美系列| 欧美色爱综合网| 亚洲美女电影在线| 成人综合婷婷国产精品久久蜜臀 | 三级在线观看一区二区| 成人黄页毛片网站| 欧美成人a∨高清免费观看| 亚洲成人综合在线| 一本大道综合伊人精品热热| 国产视频一区二区三区在线观看| 日本中文字幕一区二区视频 | 7777精品伊人久久久大香线蕉最新版| 中文字幕一区二区5566日韩| 国产资源在线一区| 日韩一区二区麻豆国产| 亚洲一区二区三区四区中文字幕| 99久久国产免费看| 国产精品久久影院| 成人精品视频一区二区三区尤物| 精品国产一区二区三区四区四| 午夜视频久久久久久| 在线观看欧美精品| 国产精品一区二区三区四区| 色综合网色综合| 国产精品不卡视频| 99久久精品国产毛片| 中文久久乱码一区二区| 国产91对白在线观看九色| 日本一区二区三区国色天香| 懂色av一区二区夜夜嗨| 欧美国产亚洲另类动漫| 国产**成人网毛片九色 | 久久不见久久见免费视频1| 欧美一区二区成人| 老司机精品视频一区二区三区| 日韩午夜小视频| 国产精品亚洲视频| 亚洲婷婷在线视频| 99久久综合99久久综合网站| 自拍偷拍亚洲欧美日韩| 欧美中文字幕一区二区三区亚洲| 午夜私人影院久久久久| 日韩欧美亚洲一区二区| 韩国三级中文字幕hd久久精品| 国产欧美一区二区精品性色超碰| 国产v日产∨综合v精品视频| 亚洲视频香蕉人妖| 91精品国产欧美一区二区18 | 中文一区二区完整视频在线观看| 国产成人鲁色资源国产91色综| 中文字幕五月欧美| 欧美日韩精品一二三区| 久久91精品国产91久久小草 | 亚洲一区自拍偷拍| 91精品国产乱码久久蜜臀| 韩国精品主播一区二区在线观看 | 国产精品久久久久久久岛一牛影视| 91小视频免费看| 青娱乐精品视频在线| 欧美国产乱子伦| 欧美体内she精高潮| 久久精品久久综合| 一区二区在线电影| 欧美videofree性高清杂交| 99久久综合国产精品| 日本中文字幕一区二区视频| 中文字幕日韩一区二区| 日韩一区二区影院| 欧美午夜精品免费| 国产丝袜在线精品| 色婷婷精品大视频在线蜜桃视频 | 欧美日韩中文另类| 久久se精品一区精品二区| 综合亚洲深深色噜噜狠狠网站| 9191精品国产综合久久久久久 | 91丨九色丨尤物| 久久成人免费电影| 综合欧美一区二区三区| 26uuu色噜噜精品一区| 欧美精品一二三四| 91视频精品在这里| 1区2区3区欧美| 欧美色视频在线| 成人av电影免费观看| 精品一区二区在线看| 性久久久久久久久久久久| 亚洲卡通动漫在线|