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

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

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

    風(fēng)人園

    弱水三千,只取一瓢,便能解渴;佛法無(wú)邊,奉行一法,便能得益。
    隨筆 - 99, 文章 - 181, 評(píng)論 - 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) 評(píng)論(0)  編輯  收藏 所屬分類: jBPM

    主站蜘蛛池模板: 九九免费精品视频在这里| 免费A级毛片av无码| a毛片全部免费播放| 免费看香港一级毛片| 污污视频网站免费观看| 国产免费啪嗒啪嗒视频看看| 国产精品亚洲精品青青青| 亚洲一区二区三区免费观看| 亚洲AV电影天堂男人的天堂| 亚洲熟妇av一区二区三区| 国产免费不卡v片在线观看| 日韩一区二区三区免费播放| 亚洲视频免费播放| 最近中文字幕大全免费视频| 亚洲爆乳大丰满无码专区| 拔擦拔擦8x华人免费久久| 国产成人AV免费观看| 亚洲精品国产首次亮相| 久久精品国产69国产精品亚洲| 成人影片麻豆国产影片免费观看| 中国一级毛片免费看视频| 亚洲综合日韩久久成人AV| 美女网站在线观看视频免费的| 最新亚洲成av人免费看| 日韩精品无码区免费专区 | 伊人久久五月丁香综合中文亚洲| 国产片AV片永久免费观看| 国产免费一区二区三区免费视频 | 亚洲免费在线视频播放| 日韩视频免费一区二区三区| 久久国产精品2020免费m3u8| 亚洲自偷精品视频自拍| 国产偷国产偷亚洲高清日韩| 成人人观看的免费毛片| 日本免费xxxx色视频| a级毛片毛片免费观看永久| 色视频在线观看免费| 亚洲第一男人天堂| 亚洲成电影在线观看青青| 国产在线a不卡免费视频| 国产成人免费在线|