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

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

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

    風人園

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

    jBPM之hello world

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

    下面是根據官方開發向導及自己的經驗寫的

    開發向導上提供的helloworld例子,這個流程是單向的,沒有任何的分支,且沒有自定義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());
    }

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




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

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



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

    主站蜘蛛池模板: 一本岛v免费不卡一二三区| 91免费福利视频| 337P日本欧洲亚洲大胆精品| 一级做a爰黑人又硬又粗免费看51社区国产精品视 | tom影院亚洲国产一区二区| 国产偷v国产偷v亚洲高清| 337p欧洲亚洲大胆艺术| 亚洲妇女无套内射精| 好紧我太爽了视频免费国产| 午夜精品在线免费观看| 国产亚洲美女精品久久久久狼| 一级毛片免费在线观看网站| 免费在线黄色网址| 精品丝袜国产自在线拍亚洲| 日本高清在线免费| 亚洲一区二区三区无码中文字幕| 亚洲中文字幕久久久一区| 在线观看特色大片免费网站| 日本免费网站观看| 亚洲美女视频免费| 免费影院未满十八勿进网站| 亚洲AV无码一区二区乱孑伦AS| 国产成人综合亚洲一区| 免费视频专区一国产盗摄| 亚洲精品综合在线影院| 久久久久久夜精品精品免费啦| 四虎成人免费网址在线| 色噜噜噜噜亚洲第一| 中文亚洲AV片在线观看不卡| 亚洲AV无码AV日韩AV网站| 免费观看黄网站在线播放| 久久久久亚洲AV成人无码网站| 七次郎成人免费线路视频| 亚洲熟妇无码八AV在线播放| 青青草无码免费一二三区| 亚洲天堂男人影院| 免费一级做a爰片久久毛片潮喷| 好吊色永久免费视频大全| 亚洲AⅤ永久无码精品AA| 国产成人亚洲综合在线| 亚洲精品国产字幕久久不卡|