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

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

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

    如鵬網(wǎng) 大學(xué)生計(jì)算機(jī)學(xué)習(xí)社區(qū)

    CowNew開源團(tuán)隊(duì)

    http://www.cownew.com 郵件請聯(lián)系 about521 at 163.com

      BlogJava :: 首頁 :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理 ::
      363 隨筆 :: 2 文章 :: 808 評論 :: 0 Trackbacks
    定義一個(gè)ActionHandler:

    package com.test;

    import org.jbpm.graph.def.ActionHandler;
    import org.jbpm.graph.exe.ExecutionContext;

    public class MyAction implements ActionHandler
    {

     private static final long serialVersionUID = 1L;

     private String message;

     public String getMessage()
     {
      return message;
     }

     public void setMessage(String message)
     {
      this.message = message;
     }

     public void execute(ExecutionContext executionContext) throws Exception
     {
      System.out.println(message);
     }

    }


    定義一個(gè)流程文件:

    <?xml version="1.0" encoding="UTF-8"?>

    <process-definition
      xmlns="urn:jbpm.org:jpdl-3.1"
      name="simple">
       <start-state name="start">
          <transition name="to_state" to="first">
             <action name="action" class="com.test.MyAction">
                <message>Going to the first state!</message>
             </action>
          </transition>
       </start-state>
       <state name="first">
          <transition name="to_end" to="end">
             <action name="action" class="com.test.MyAction">
                <message>About to finish!</message>
             </action>
          </transition>
       </state>
       <end-state name="end"></end-state>
    </process-definition>

    定義流程驅(qū)動類:

    package com.test;

    import java.io.IOException;
    import java.io.InputStream;

    import org.jbpm.graph.def.ProcessDefinition;
    import org.jbpm.graph.exe.ProcessInstance;

    public class Main
    {
     public static void main(String[] args) throws IOException
     {
      InputStream stream = Main.class.getResourceAsStream("processdefinition.xml");
      ProcessDefinition processDefinition = ProcessDefinition
        .parseXmlInputStream(stream);
      stream.close();
      ProcessInstance instance = new ProcessInstance(processDefinition);
      while (!instance.hasEnded())
      {
       instance.signal();
      }
     }
    }


    將jbpm***.jar、commons-logging**.jar和dom4j.jar三個(gè)包加入classpath就可以了。
    執(zhí)行結(jié)果:
    Going to the first state!
    About to finish!
    posted on 2007-11-16 13:51 CowNew開源團(tuán)隊(duì) 閱讀(2550) 評論(0)  編輯  收藏 所屬分類: 技術(shù)類
    主站蜘蛛池模板: 久久av免费天堂小草播放| 亚洲av片在线观看| 亚洲综合在线另类色区奇米| 亚洲动漫精品无码av天堂| 国产日韩在线视频免费播放| 日产国产精品亚洲系列| 暖暖免费中文在线日本| 国产精品V亚洲精品V日韩精品| 日韩少妇内射免费播放| 久久亚洲2019中文字幕| 精品四虎免费观看国产高清午夜| 国产精品亚洲成在人线| 免费观看四虎精品成人| 久久亚洲中文字幕精品一区| 在线观看片免费人成视频播放| 久久夜色精品国产噜噜噜亚洲AV | 国产gav成人免费播放视频| 免费播放美女一级毛片| 中文字幕亚洲一区二区三区| 免费看少妇高潮成人片| 777亚洲精品乱码久久久久久 | 无码 免费 国产在线观看91 | 亚洲国产天堂在线观看| 免费观看激色视频网站(性色)| 亚洲w码欧洲s码免费| 国产成人精品123区免费视频| 午夜不卡AV免费| 久久久亚洲精品国产| 免费A级毛片无码免费视| 久久久久久久亚洲Av无码| 免费成人福利视频| 在线观看亚洲专区| 亚洲精品无码午夜福利中文字幕| 91青青青国产在观免费影视| 亚洲 暴爽 AV人人爽日日碰| 亚洲黄色免费网站| 亚洲电影免费观看| 免费v片在线观看无遮挡| 日韩内射激情视频在线播放免费| 亚洲午夜福利在线视频| 在线免费视频一区二区|