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

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

?? processinstance.java

?? jboss jpdl-3.2.2 nolib
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
/*
 * 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.exe;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

import org.jbpm.JbpmException;
import org.jbpm.context.exe.ContextInstance;
import org.jbpm.graph.def.Event;
import org.jbpm.graph.def.Node;
import org.jbpm.graph.def.ProcessDefinition;
import org.jbpm.graph.def.Transition;
import org.jbpm.graph.log.ProcessInstanceCreateLog;
import org.jbpm.graph.log.ProcessInstanceEndLog;
import org.jbpm.logging.exe.LoggingInstance;
import org.jbpm.logging.log.ProcessLog;
import org.jbpm.module.def.ModuleDefinition;
import org.jbpm.module.exe.ModuleInstance;
import org.jbpm.scheduler.SchedulerService;
import org.jbpm.svc.Services;
import org.jbpm.taskmgmt.exe.TaskMgmtInstance;
import org.jbpm.util.Clock;
import org.jbpm.util.EqualsUtil;

/**
 * is one execution of a {@link org.jbpm.graph.def.ProcessDefinition}.
 * To create a new process execution of a process definition, just use the 
 * {@link #ProcessInstance(ProcessDefinition)}.
 * 
 */
public class ProcessInstance  implements Serializable {

  private static final long serialVersionUID = 1L;
  
  long id = 0;
  int version = 0;
  protected String key = null;
  protected Date start = null;
  protected Date end = null;
  protected ProcessDefinition processDefinition = null;
  protected Token rootToken = null;
  protected Token superProcessToken = null;
  protected boolean isSuspended = false;
  protected Map instances = null;
  protected Map transientInstances = null;
  protected List runtimeActions = null;
  /** not persisted */
  protected List cascadeProcessInstances = null;

  // constructors /////////////////////////////////////////////////////////////

  public ProcessInstance() {
  }

  /**
   * creates a new process instance for the given process definition, 
   * puts the root-token (=main path of execution) in the start state 
   * and executes the initial node.  In case the initial node is a 
   * start-state, it will behave as a wait state.
   * For each of the optional module definitions contained in the 
   * {@link ProcessDefinition}, the corresponding module instance 
   * will be created. 
   * @throws JbpmException if processDefinition is null.
   */
  public ProcessInstance(ProcessDefinition processDefinition) {
    this(processDefinition, null, null);
  }

  /**
   * creates a new process instance for the given process definition, 
   * puts the root-token (=main path of execution) in the start state 
   * and executes the initial node.  In case the initial node is a 
   * start-state, it will behave as a wait state.
   * For each of the optional module definitions contained in the 
   * {@link ProcessDefinition}, the corresponding module instance 
   * will be created.
   * @param variables will be inserted into the context variables 
   * after the context submodule has been created and before the 
   * process-start event is fired, which is also before the execution 
   * of the initial node.
   * @throws JbpmException if processDefinition is null.
   */
  public ProcessInstance(ProcessDefinition processDefinition, Map variables) {
    this(processDefinition, variables, null);
  }

  /**
   * creates a new process instance for the given process definition, 
   * puts the root-token (=main path of execution) in the start state 
   * and executes the initial node.  In case the initial node is a 
   * start-state, it will behave as a wait state.
   * For each of the optional module definitions contained in the 
   * {@link ProcessDefinition}, the corresponding module instance 
   * will be created.
   * @param variables will be inserted into the context variables 
   * after the context submodule has been created and before the 
   * process-start event is fired, which is also before the execution 
   * of the initial node.
   * @throws JbpmException if processDefinition is null.
   */
  public ProcessInstance(ProcessDefinition processDefinition, Map variables, String key) {
    if (processDefinition==null) throw new JbpmException("can't create a process instance when processDefinition is null");
    
    // initialize the members
    this.processDefinition = processDefinition;
    this.rootToken = new Token(this);
    this.start = Clock.getCurrentTime();
    this.key = key;
    
    // if this process instance is created in the context of a persistent operation
    Services.assignId(this);

    // create the optional definitions
    Map definitions = processDefinition.getDefinitions();
    // if the state-definition has optional definitions
    if ( definitions != null ) {
      instances = new HashMap();
      // loop over each optional definition
      Iterator iter = definitions.values().iterator();
      while (iter.hasNext()) {
        ModuleDefinition definition = (ModuleDefinition) iter.next();
        // and create the corresponding optional instance
        ModuleInstance instance = definition.createInstance();
        if (instance != null) {
          addInstance( instance );
        }
      }
    }
    
    // add the creation log
    rootToken.addLog(new ProcessInstanceCreateLog());
    
    // set the variables
    ContextInstance contextInstance = getContextInstance();
    if ( (contextInstance!=null)
         && (variables!=null)
       ) {
      contextInstance.addVariables(variables);
    }

    Node initialNode = rootToken.getNode();
    // fire the process start event
    if (initialNode!=null) {
      ExecutionContext executionContext = new ExecutionContext(rootToken);
      processDefinition.fireEvent(Event.EVENTTYPE_PROCESS_START, executionContext);

      // execute the start node
      initialNode.execute(executionContext);
    }
  }

  // optional module instances ////////////////////////////////////////////////
 
  /**
   * adds the given optional moduleinstance (bidirectional).
   */
  public ModuleInstance addInstance(ModuleInstance moduleInstance) {
    if (moduleInstance == null) throw new IllegalArgumentException("can't add a null moduleInstance to a process instance");
    if (instances == null) instances = new HashMap();
    instances.put(moduleInstance.getClass().getName(), moduleInstance);
    moduleInstance.setProcessInstance(this);
    return moduleInstance;
  }

  /**
   * removes the given optional moduleinstance (bidirectional). 
   */
  public ModuleInstance removeInstance(ModuleInstance moduleInstance) {
    ModuleInstance removedModuleInstance = null;
    if (moduleInstance == null) throw new IllegalArgumentException("can't remove a null moduleInstance from a process instance");
    if (instances != null) {
      removedModuleInstance = (ModuleInstance) instances.remove(moduleInstance.getClass().getName());
      if (removedModuleInstance!=null) {
        moduleInstance.setProcessInstance(null);
      }
    }
    return removedModuleInstance;
  }

  /**
   * looks up an optional module instance by its class.    
   */
  public ModuleInstance getInstance(Class clazz) {
    ModuleInstance moduleInstance = null;
    if ( instances != null ) {
      moduleInstance = (ModuleInstance) instances.get( clazz.getName() );
    }
    
    if (moduleInstance==null) {
      if (transientInstances==null) transientInstances = new HashMap();
      
      // client requested an instance that is not in the map of instances.
      // so we can safely assume that the client wants a transient instance
      moduleInstance = (ModuleInstance) transientInstances.get( clazz.getName() );
      if (moduleInstance==null) {
        try {
          moduleInstance = (ModuleInstance) clazz.newInstance();
          moduleInstance.setProcessInstance(this);

        } catch (Exception e) {
          e.printStackTrace();
          throw new JbpmException("couldn't instantiate transient module '"+clazz.getName()+"' with the default constructor");
        }
        transientInstances.put(clazz.getName(), moduleInstance);
      }
    }

    return moduleInstance;
  }

  /**
   * process instance extension for process variableInstances.
   */
  public ContextInstance getContextInstance() {
    return (ContextInstance) getInstance(ContextInstance.class);
  }

  /**
   * process instance extension for managing the tasks and actors.
   */
  public TaskMgmtInstance getTaskMgmtInstance() {
    return (TaskMgmtInstance) getInstance(TaskMgmtInstance.class);
  }

  /**
   * process instance extension for logging. Probably you don't need to access 
   * the logging instance directly.  Mostly, {@link Token#addLog(ProcessLog)} is 
   * sufficient and more convenient. 
   */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产·精品毛片| 欧美一区二区三区视频免费 | 成人va在线观看| 4438亚洲最大| 亚洲激情中文1区| 粉嫩在线一区二区三区视频| 91精品午夜视频| 亚洲色图欧洲色图婷婷| 韩国欧美国产1区| 欧美日韩国产欧美日美国产精品| 中文字幕不卡在线播放| 日韩一级免费一区| 精品福利视频一区二区三区| 午夜电影一区二区三区| 97久久精品人人做人人爽| 国产亚洲一二三区| 极品少妇一区二区三区精品视频| 欧美高清一级片在线| 一区二区三区在线免费视频| 波多野结衣欧美| 欧美极品美女视频| 国产一区二区成人久久免费影院| 欧美高清你懂得| 亚洲成av人**亚洲成av**| 91麻豆精品在线观看| 亚洲色图都市小说| 97aⅴ精品视频一二三区| 欧美国产精品一区二区三区| 国产精品亚洲一区二区三区妖精 | 91丨九色丨尤物| 亚洲天堂精品视频| 99热这里都是精品| 亚洲特黄一级片| 色婷婷精品大视频在线蜜桃视频 | 日韩电影在线观看电影| 欧美一区二区视频在线观看| 奇米精品一区二区三区四区 | 免费的成人av| 久久夜色精品国产噜噜av| 激情五月激情综合网| 精品国产一区二区三区忘忧草| 久久国产欧美日韩精品| 精品国产一区二区三区久久久蜜月 | 欧美美女一区二区| 日韩专区欧美专区| 日韩欧美一区电影| 国产一区二区美女| 亚洲天堂福利av| 欧美日韩mp4| 久色婷婷小香蕉久久| 2014亚洲片线观看视频免费| 国产成人免费视频网站高清观看视频| 日本一区二区三区久久久久久久久不 | 久久精品国产免费| 久久久久久亚洲综合| av电影在线观看完整版一区二区| 一区二区三区在线高清| 在线不卡一区二区| 国产自产2019最新不卡| 国产精品久久久久一区| 欧美日韩久久一区| 国产高清久久久久| 亚洲欧美日本韩国| 日韩欧美中文字幕制服| 成人精品视频一区二区三区 | 综合av第一页| 欧美一区二区精品在线| 高清av一区二区| 五月激情丁香一区二区三区| 久久久久久9999| 欧美日韩一区三区四区| 国产一区二区三区高清播放| 亚洲小说欧美激情另类| 久久精品一区二区三区不卡 | 国产丝袜在线精品| 欧美日韩在线播放三区四区| 国产成人h网站| 日韩精品三区四区| 一区二区三区四区精品在线视频| 日韩免费性生活视频播放| 欧美在线观看一二区| 国产精品一线二线三线精华| 亚洲h精品动漫在线观看| 国产精品丝袜久久久久久app| 欧美一区二区三区播放老司机| 91麻豆福利精品推荐| 国产麻豆一精品一av一免费| 日韩成人精品在线观看| 1024精品合集| 国产日韩欧美不卡在线| 欧美一区二区三区婷婷月色| 欧美视频一区二区三区四区| 99re热视频精品| 国产白丝网站精品污在线入口| 三级成人在线视频| 亚洲午夜精品网| 亚洲人成在线播放网站岛国 | 精品国产乱码久久| 91精品一区二区三区在线观看| 在线欧美一区二区| jlzzjlzz亚洲日本少妇| 国产成人精品免费网站| 国产精品18久久久久久vr| 久久99热这里只有精品| 麻豆精品一区二区三区| 日本不卡视频在线| 蜜桃视频一区二区三区| 午夜精品在线看| 亚洲成在人线在线播放| 亚洲电影在线播放| 亚洲午夜久久久久久久久电影网| 一区二区三区产品免费精品久久75| 中文字幕欧美激情| 中文字幕亚洲在| 亚洲免费观看高清完整| 一区二区不卡在线播放 | 精品午夜久久福利影院 | 久久精品一二三| 久久久久久久久久久久电影| 久久综合九色综合欧美98| 久久久精品国产免大香伊| 国产午夜精品一区二区三区嫩草| 国产欧美一区视频| 亚洲欧洲中文日韩久久av乱码| 亚洲欧美国产77777| 亚洲成av人片在线| 蜜乳av一区二区三区| 国产乱一区二区| www.亚洲免费av| 欧美性猛交xxxx黑人交| 欧美一区二区免费视频| 国产亚洲精品久| 中文字幕在线观看不卡视频| 亚洲色图欧洲色图婷婷| 日韩中文字幕av电影| 久久成人久久鬼色| av一本久道久久综合久久鬼色| 在线精品视频一区二区| 精品久久99ma| 亚洲欧洲精品一区二区三区| 亚洲超碰97人人做人人爱| 久久99国内精品| 99久久精品国产毛片| 欧美日韩一区二区三区视频| 欧美videos中文字幕| 国产嫩草影院久久久久| 亚洲成年人网站在线观看| 国产麻豆视频精品| 在线看日本不卡| 国产亚洲美州欧州综合国| 亚洲一区二区在线观看视频| 狠狠色丁香婷综合久久| 色一区在线观看| wwwwww.欧美系列| 亚洲专区一二三| 国产一区二区电影| 欧美日韩国产片| 国产精品无圣光一区二区| 肉肉av福利一精品导航| av成人动漫在线观看| 精品奇米国产一区二区三区| 亚洲人成人一区二区在线观看| 狠狠狠色丁香婷婷综合激情| 色噜噜狠狠成人中文综合| 精品国产91久久久久久久妲己 | 欧美在线一二三| 国产午夜亚洲精品午夜鲁丝片| 亚洲成在线观看| 99国产精品久| 国产亚洲精久久久久久| 石原莉奈一区二区三区在线观看| 99久久久久久| 国产夜色精品一区二区av| 男女激情视频一区| 色狠狠一区二区三区香蕉| 国产日韩欧美制服另类| 蜜桃精品视频在线| 欧美肥妇毛茸茸| 亚洲自拍欧美精品| 色婷婷综合久久久| 中文字幕一区二区三区不卡| 国产成人免费网站| 久久久久综合网| 狠狠色丁香九九婷婷综合五月| 911精品国产一区二区在线| 亚洲黄色尤物视频| 色综合婷婷久久| 日韩一区在线播放| 不卡在线观看av| 国产精品国产三级国产有无不卡| 国产一区二区三区观看| 久久久五月婷婷| 国产精品亚洲综合一区在线观看| 精品三级在线看| 国产一区二区福利视频| 国产婷婷精品av在线| 成人看片黄a免费看在线| 欧美激情一区二区三区在线| 成人一级视频在线观看| 欧美国产精品一区|