<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    風(fēng)人園

    弱水三千,只取一瓢,便能解渴;佛法無邊,奉行一法,便能得益。
    隨筆 - 99, 文章 - 181, 評論 - 56, 引用 - 0
    數(shù)據(jù)加載中……

    jBPM之JbpmContext

    The three most common persistence operations are:

    • Deploying a process
    • Starting a new execution of a process
    • Continuing an execution

    First deploying a process definition. Typically, this will be done directly from the graphical process designer or from the deployprocess ant task. But here you can see how this is done programmatically:

    JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
    try {
      ProcessDefinition processDefinition = ...;
      jbpmContext.deployProcessDefinition(processDefinition);
    } finally {
      jbpmContext.close();
    }

    For the creation of a new process execution, we need to specify of which process definition this execution will be an instance. The most common way to specify this is to refer to the name of the process and let jBPM find the latest version of that process in the database:

    JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
    try {
      String processName = ...;
      ProcessInstance processInstance = 
          jbpmContext.newProcessInstance(processName);
    } finally {
      jbpmContext.close();
    }

    For continuing a process execution, we need to fetch the process instance, the token or the taskInstance from the database, invoke some methods on the POJO jBPM objects and afterwards save the updates made to the processInstance into the database again.

    JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
    try {
      long processInstanceId = ...;
      ProcessInstance processInstance = 
          jbpmContext.loadProcessInstance(processInstanceId);
      processInstance.signal();
      jbpmContext.save(processInstance);
    } finally {
      jbpmContext.close();
    }

    Note that if you use the xxxForUpdate methods in the JbpmContext, an explicit invocation of the jbpmContext.save is not necessary any more because it will then occur automatically during the close of the jbpmContext. E.g. suppose we want to inform jBPM about a taskInstance that has been completed. Note that task instance completion can trigger execution to continue so the processInstance related to the taskInstance must be saved. The most convenient way to do this is to use the loadTaskInstanceForUpdate method:

    JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
    try {
      long taskInstanceId = ...;
      TaskInstance taskInstance = 
          jbpmContext.loadTaskInstanceForUpdate(taskInstanceId);
      taskInstance.end();
    } finally {
      jbpmContext.close();
    }

    posted on 2007-01-18 11:39 風(fēng)人園 閱讀(1819) 評論(0)  編輯  收藏 所屬分類: jBPM

    主站蜘蛛池模板: 久久午夜夜伦鲁鲁片免费无码影视| 亚洲电影免费观看| 久久亚洲春色中文字幕久久久| 99ee6热久久免费精品6| 亚洲性无码AV中文字幕| 亚洲精品人成无码中文毛片| 日韩精品久久久久久免费| 亚洲av无码专区在线观看亚| 亚洲日韩国产精品第一页一区| 免费毛片a在线观看67194| 免费一区二区无码视频在线播放| 亚洲视频中文字幕| 国产又粗又猛又爽又黄的免费视频| 国产麻豆成人传媒免费观看| 亚洲色无码专区一区| 无码专区—VA亚洲V天堂| 日本免费人成黄页在线观看视频| 国产精品免费观看调教网| 亚洲欧美日韩综合久久久久| 久久综合九九亚洲一区| 免费A级毛片无码A| 四虎永久在线精品免费网址 | 手机看黄av免费网址| 一级片在线免费看| 精品国产成人亚洲午夜福利| 亚洲日韩精品无码专区网址| 日本一道综合久久aⅴ免费| 最近最新高清免费中文字幕| 亚洲免费无码在线| 亚洲av无码专区在线观看下载| 91大神亚洲影视在线| 亚洲色婷婷一区二区三区| 国产免费看插插插视频| 免费AA片少妇人AA片直播| 久久久久久久99精品免费观看| 免费人成视频在线观看免费| 亚洲人成电影网站久久| 亚洲成人福利在线| 亚洲日本精品一区二区| 久久亚洲综合色一区二区三区| 亚洲国产主播精品极品网红|