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

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

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

    風人園

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

    jBPM之hello world

    參考
    http://m.tkk7.com/chengang/archive/2006/07/13/57986.html

    下面是根據(jù)官方開發(fā)向?qū)Ъ白约旱慕?jīng)驗寫的

    開發(fā)向?qū)咸峁┑膆elloworld例子,這個流程是單向的,沒有任何的分支,且沒有自定義actionHandler,使用的是默認的handler
    public void testHelloWorldProcess() {
      // This method shows a process definition and one execution// of the process definition.  The process definition has // 3 nodes: an unnamed start-state, a state 's' and an // end-state named 'end'.// The next line parses a piece of xml text into a// ProcessDefinition.  A ProcessDefinition is the formal // description of a process represented as a java object.
      ProcessDefinition processDefinition = ProcessDefinition.parseXmlString(
        "<process-definition>" +
        "  <start-state>" +
        "    <transition to='s' />" +
        "  </start-state>" +
        "  <state name='s'>" +
        "    <transition to='end' />" +
        "  </state>" +
        "  <end-state name='end' />" +
        "</process-definition>"
      );
      
      // The next line creates one execution of the process definition.// After construction, the process execution has one main path// of execution (=the root token) that is positioned in the// start-state.
      ProcessInstance processInstance = 
          new ProcessInstance(processDefinition);
      
      // After construction, the process execution has one main path// of execution (=the root token).
      Token token = processInstance.getRootToken();
      
      // Also after construction, the main path of execution is positioned// in the start-state of the process definition.
      assertSame(processDefinition.getStartState(), token.getNode());
      
      // Let's start the process execution, leaving the start-state // over its default transition.
      token.signal();
      // The signal method will block until the process execution // enters a wait state.// The process execution will have entered the first wait state// in state 's'. So the main path of execution is now // positioned in state 's'
      assertSame(processDefinition.getNode("s"), token.getNode());
    
      // Let's send another signal.  This will resume execution by // leaving the state 's' over its default transition.
      token.signal();
      // Now the signal method returned because the process instance // has arrived in the end-state.
      
      assertSame(processDefinition.getNode("end"), token.getNode());
    }

    更詳細的例子可以看參考,里面有很詳細的操作說明。




    下面是根據(jù)參考例子測試時出現(xiàn)的一些問題及說明。
    一、關(guān)于數(shù)據(jù)庫,首先要修改數(shù)據(jù)庫連接,然后創(chuàng)建數(shù)據(jù)庫,里面的表格jBPM提供相應的API去創(chuàng)建。
    public?void?testDeployProcessDefinition()?throws?FileNotFoundException?{?
    ????????
    //?從?jbpm.cfg.xml?取得?jbpm?的配置?
    ????????JbpmConfiguration?config?=?JbpmConfiguration.getInstance();
    ????????config.dropSchema();//刪除數(shù)據(jù)表結(jié)構(gòu)
    ????????config.createSchema();//創(chuàng)建數(shù)據(jù)表結(jié)構(gòu)
    ????????
    //?創(chuàng)建一個?jbpm?容器?
    ????????JbpmContext?jbpmContext?=?config.createJbpmContext();?
    ????????
    //?由?processdefinition.xml?生成相對應的流程定義類?ProcessDefinition?
    ????????InputStream?is?=?new?FileInputStream("processes/simple/processdefinition.xml");?
    ????????ProcessDefinition?processDefinition?
    =?ProcessDefinition.parseXmlInputStream(is);?
    ????????
    ????????
    //?利用容器的方法將流程定義數(shù)據(jù)部署到數(shù)據(jù)庫上?
    ????????jbpmContext.deployProcessDefinition(processDefinition);?
    ????????
    //?關(guān)閉?jbpmContext?
    ????????jbpmContext.close();?
    ????}

    這個是根據(jù)流程配置文件最后生成的數(shù)據(jù)庫信息的測試方法,剛開始我還有一個疑問,數(shù)據(jù)庫和數(shù)據(jù)表是系統(tǒng)自動創(chuàng)建還
    是要手動創(chuàng)建,數(shù)據(jù)庫是要手動創(chuàng)建的,數(shù)據(jù)表可以自動創(chuàng)建的



    posted on 2007-01-18 10:55 風人園 閱讀(1010) 評論(0)  編輯  收藏 所屬分類: jBPM

    主站蜘蛛池模板: 精品亚洲一区二区三区在线观看| 亚洲男女性高爱潮网站| 亚洲人成色77777在线观看大| 区三区激情福利综合中文字幕在线一区亚洲视频1 | 毛片免费全部播放一级| 可以免费观看一级毛片黄a| 亚洲国产精品成人久久| 亚洲码和欧洲码一码二码三码| 九九免费精品视频在这里| 最近2019中文字幕免费直播| 亚洲精品成人a在线观看| 高潮毛片无遮挡高清免费| 精品无码免费专区毛片| 亚洲av无码乱码在线观看野外 | 亚洲国产日韩成人综合天堂| 特黄aa级毛片免费视频播放| 亚洲精品动漫人成3d在线| 亚洲天堂免费在线视频| 国产免费人成在线视频| 亚洲一区二区三区亚瑟| 成人久久免费网站| 亚洲午夜福利精品无码| a在线观看免费视频| 97亚洲熟妇自偷自拍另类图片| 国产成人精品日本亚洲18图| 久久亚洲免费视频| 国产亚洲综合久久系列| 九九免费精品视频在这里| 亚洲AV无码久久精品蜜桃| 在线免费观看h片| 国产亚洲日韩在线三区| 在线播放免费人成视频网站| 国产在线播放免费| 亚洲AV成人无码网天堂| 黄页网站免费在线观看| 亚洲性色高清完整版在线观看| 久久久久久夜精品精品免费啦| 亚洲日韩人妻第一页| 在线观看免费中文视频| 337p日本欧洲亚洲大胆人人 | 99久久免费国产特黄|