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

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

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

    Oracle神諭

      BlogJava :: 首頁 :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理 ::
      284 隨筆 :: 9 文章 :: 106 評論 :: 0 Trackbacks

    10. Scheduler(日程安排程序)
    This chapter describes how to work with timers in jBPM.

    Upon events in the process, timers can be created. When a timer expires(終止), an action can be executed or a transition can be taken.

    10.1. Timers
    The easiest way to specify a timer is by adding a timer element to the node.

    <state name='catch crooks'>
      <timer name='reminder'
             duedate='3 business hours'
             repeat='10 business minutes'
             transition='time-out-transition' >
        <action class='the-remainder-action-class-name' />
      </timer>
    </state>

    <state name='catch crooks(騙子)'>
       <timer name="reminder(提示)" duedate(到期日)="3 business hours" repeat="10 buesiness minutes" transition='time-out-transtion'>
       <action class='the-remainder-action-class-name'/>
       </timer>
    </state>


    A timer that is specified on a node, is not executed after the node is left. Both the transition and the action are optional. When a timer timer is executed, the following events occur in sequence :

    an event is fired of type timer
    if an action is specified, the action is executed.
    if a transition is specified, a signal will be sent to resume execution over the given transition.
    Every timer must have a unique name. If no name is specified in the timer element, the name of the node is taken as the name of the timer.

    The timer action can be any supported action element like e.g. action or script.

    Timers are created and cancelled by actions. The 2 action-elements are create-timer and cancel-timer. Actually, the timer element shown above is just a short notation(符號) for a create-timer action on node-enter and a cancel-timer action on node-leave.

    2 action-elements :
      create-time node-enter
      cancel-time node-leave
     
      Scheduler deployment
    Process executions create and cancel timers. The timers are stored in a timer store. A separate timer runner must check the timer store and execute the timers when they are due.

    10.2. Scheduler deployment
    Process executions create and cancel timers. The timers are stored in a timer store. A separate timer runner must check the timer store and execute the timers when they are due.

    三個Actor:
      process executions(流程執(zhí)行):
        a. scheduler timer (日期安排計時器)
        b. cancel timer    (取消計時器)
      timer store(計時器儲存) --->cancel timer--->scheduler timer
      timer runner(計時器運行者) --->execute timers that are due
     
       
      Scheduler Service
      timer runner
     
    The following class diagram shows the classes that are involved in the scheduler deployment. The interfaces SchedulerService and TimerExecutor are specified to make the timer execution mechanism pluggable.

    process execution(actor) ---> SchedulerInstance ---> SchedulerService (接口)<----SchedulerServiceImpl(接口實現(xiàn))
                                                                           --->JBPM_TIMER database
                                 /SchedulerMain                                          |||
    Runnable(接口)----TimerRunner(實現(xiàn)接口)--------->TimerExecutor(接口)<---------TimerExecutorImpl(接口實現(xiàn))
                                 \SchedulerServlet
                                
    ----------------------------------------------------------
    11. Business calendar (商業(yè)日歷)
    This chapter describes the business calendar of jBPM. The business calendar knows about business hours and is used in calculation(計劃) of due(預(yù)期的) dates for tasks and timers<任務(wù)和計時器>.

    The business calendar is able to calculate(計劃) a date by adding a duration(持續(xù)時間) and a date.

    11.1. Duration(持續(xù)時間)
    A duration is specified in absolute or in business hours. Let's look at the syntax:

    <quantity> [business] <unit>

    Where <quantity> is a piece of text that is parsable with Double.parseDouble(quantity). <unit> is one of {second, seconds, minute, minutes, hour, hours, day, days, week, weeks, month, months, year, years}. And adding the optional indication business means that only business hours should be taken into account for this duration. Without the indication business, the duration will be interpreted as an absolute time period.

    <quantity> [business] <unit>
    <數(shù)量>[商業(yè)]<單元>

    這里<quantity>是一段文字,用來解析使用Double.parseDouble(quantity). <單元>是{秒、分等等}中的一種。并且增加可選的指示商業(yè)意味著僅僅商業(yè)時間被考慮為這一段時間。 沒有這個指示商業(yè),持續(xù)時間將被解釋為一個完全的時間區(qū)域。

    11.2. Configuration(配置)
    The file org/jbpm/calendar/jbpm.business.calendar.properties specifies what business hours are. The configuration file can be customized and a modified copy can be placed in the root of the classpath.

    This is the example business hour specification that is shipped by default in jbpm.business.calendar.properties:

    hour.format=HH:mm
    #weekday ::= [<daypart> [& <daypart>]*]
    #daypart ::= <start-hour>-<to-hour>
    #start-hour and to-hour must be in the hour.format
    #dayparts have to be ordered
    weekday.monday=    9:00-12:00 & 12:30-17:00
    weekday.thuesday=  9:00-12:00 & 12:30-17:00
    weekday.wednesday= 9:00-12:00 & 12:30-17:00
    weekday.thursday=  9:00-12:00 & 12:30-17:00
    weekday.friday=    9:00-12:00 & 12:30-17:00
    weekday.saturday=
    weekday.sunday=

    day.format=dd/MM/yyyy
    # holiday syntax: <holiday>
    # holiday period syntax: <start-day>-<end-day>
    # below are the belgian official holidays
    holiday.1=  01/01/2005 # nieuwjaar
    holiday.2=  27/3/2005  # pasen
    holiday.3=  28/3/2005  # paasmaandag
    holiday.4=  1/5/2005   # feest van de arbeid
    holiday.5=  5/5/2005   # hemelvaart
    holiday.6=  15/5/2005  # pinksteren
    holiday.7=  16/5/2005  # pinkstermaandag
    holiday.8=  21/7/2005  # my birthday
    holiday.9=  15/8/2005  # moederkesdag
    holiday.10= 1/11/2005  # allerheiligen
    holiday.11= 11/11/2005 # wapenstilstand
    holiday.12= 25/12/2005 # kerstmis

    business.day.expressed.in.hours=             8
    business.week.expressed.in.hours=           40
    business.month.expressed.in.business.days=  21
    business.year.expressed.in.business.days=  220

    ----------------------------------------------------
     13. jBPM Process Definition Language (JPDL) (jBPM流程定義語言)
    JPDL specifies an xml schema and the mechanism to package all the process definition related files into a process archive(存檔).

    13.1. The process archive
    A process archive is a zip file. The central file in the process archive is processdefinition.xml. The main information in that file is the process graph. The processdefinition.xml also contains information about actions and tasks. A process archive can also contain other process related files such as classes, ui-forms for tasks, ...

    13.1.1. Deploying a process archive
    Deploying process archives can be done in 3 ways: with the process designer tool, with an ant task or programatically.
    三種部署方式:
      a.流程設(shè)計工具
      b.ant任務(wù)處理
      c.程序

    Deploying a process archive with the designer tool is still under construction.

    Deploying a process archive with an ant task can be done as follows:

    <target name="deploy.par">
      <taskdef name="deploypar" classname="org.jbpm.jpdl.par.ProcessArchiveDeployerTask">
        <classpath --make sure the jbpm-[version].jar is in this classpath--/> 
      </taskdef> 
      <deploypar par="build/myprocess.par" />
    </target>
    To deploy more process archives at once, use the nested fileset elements. The file attribute itself is optional. Other attributes of the ant task are:

    cfg:
       cfg is optional, the default value is 'hibernate.cfg.xml'. The hibernate configuration file that contains the jdbc connection properties to the database and the mapping files.
    properties:
       properties is optional and overwrites *all* hibernate properties as found in the hibernate.cfg.xml
    createschema:
       if set to true, the jbpm database schema is created before the processes get deployed.
    Process archives can also be deployed programmatically with the class org.jbpm.jpdl.par.ProcessArchiveDeployer

    13.1.2. Process versioning
    Process definitions should never change because it is extremely difficult (if not, impossible) to predict(預(yù)知) all possible side effects of process definition changes.

    To get around this problem, jBPM has a sophicticated process versioning mechanism. The versioning mechanism allows multiple process definitions of the same name to coexist(共存) in the database. A process instance can be started in the latest version available at that time and it will keep on executing in that same process definition for its complete lifetime. When a newer version is deployed, newly created instances will be started in the newest version, while older process instances keep on executing in the older process defintions.

    Process definitions are a combination of a declaratively specified process graph and optionally, a set of related java classes. The java classes can be made available to the jBPM runtime environment in 2 ways : by making sure these classes are visible to the jBPM classloader. This usually means that you can put your delegation classes in a .jar file next to the jbpm-[version].jar. The java classes can also be included in the process archive. When you include your delegation classes in the process archive (and they are not visible to the jbpm classloader), jBPM will also apply versioning on these classes. More information about process classloading can be found in Section 13.2, “Delegation”

    When a process archive gets deployed, it creates a process definition in the jBPM database. Process definitions can be versioned on the basis of the process definition name. When a named process archive gets deployed, the deployer will assign a version number. To assign this number, the deployer will look up the highest version number for process definitions with the same name and adds 1. Unnamed process definitions will always have version number -1.

    posted on 2005-06-16 14:12 java世界暢談 閱讀(1902) 評論(1)  編輯  收藏 所屬分類: 工作流

    評論

    # re: jBPM的scheduler、timer、版本等 2005-08-12 11:34 bozo
    你好,我現(xiàn)在也在折騰jbpm3,我的環(huán)境和你的差不多,jbpm3+tomcat5+sqlserver2000,我看了你的幾篇文章,很不錯,但是我還是沒能成功的把jbpm配置起來,能不能詳細(xì)的寫一篇jbpm3+tomcat+sqlserver配置的文章,謝謝

    希望能多向你學(xué)習(xí):whubozo@163.com
      回復(fù)  更多評論
      

    主站蜘蛛池模板: 亚洲免费视频在线观看| 成年女人免费v片| 国产日本亚洲一区二区三区| 成人免费无遮挡无码黄漫视频| 国产亚洲精品2021自在线| 亚洲成Av人片乱码色午夜| 精品免费国产一区二区三区| 一区二区三区免费视频观看| 亚洲国产一区在线观看| 国产精品亚洲mnbav网站| 久草在视频免费福利| 久久九九久精品国产免费直播| 亚洲不卡中文字幕| 亚洲精品无码久久久| 亚洲精品免费在线视频| 一级a性色生活片久久无少妇一级婬片免费放 | 久久国产成人亚洲精品影院| 曰批全过程免费视频播放网站 | 91香蕉在线观看免费高清| 在线亚洲v日韩v| 亚洲国产午夜电影在线入口 | 黄色毛片免费观看| 亚洲天堂一区在线| 亚洲精品二区国产综合野狼| 日韩一品在线播放视频一品免费| 日本亚洲欧洲免费天堂午夜看片女人员| 亚洲日本天堂在线| 777亚洲精品乱码久久久久久 | 久久国产亚洲精品| 亚洲今日精彩视频| 亚洲午夜AV无码专区在线播放| 成年女人午夜毛片免费视频| 久久国产精品萌白酱免费| 一区二区三区精品高清视频免费在线播放 | 成年女性特黄午夜视频免费看| 嫩草成人永久免费观看| 日本永久免费a∨在线视频| 亚洲色丰满少妇高潮18p| 亚洲色图古典武侠| 久久久无码精品亚洲日韩蜜臀浪潮| 久久影院亚洲一区|