andyj2ee

          java tec sky

          導(dǎo)航

          <2025年6月>
          25262728293031
          1234567
          891011121314
          15161718192021
          22232425262728
          293012345

          隨筆分類

          文章分類

          收藏夾

          隨筆檔案

          文章檔案

          統(tǒng)計(jì)

          留言簿(4)

          activemq

          aop

          design pattern

          other blog

          spring

          workflow

          多線程

          軟件架構(gòu)師

          閱讀排行榜

          評(píng)論排行榜

          #

          shark 工作流引擎新特性 HistoryRelated assigment

          shark 新特性:

          * Included new HistoryRelated implementation of Assignment API - great contribution by Rich Robinson.
            You can use it by commenting standard AssignmentManager and uncommenting HistoryRelated assignment
            manager entries 
          in Shark.conf (if you are configuring shark this way), and test it with
            Publish Document proces from test
          -JavaScript.xpdl.

          I've attached the latest HistoryRelatedAssignmentManager class and also an updated
          version of test-JavaScript.xpdl.
          
          The class now supports the following extended attributes (the names of which
          can be redefined in Shark.conf):
          
          * ReassignToOriginalPerformer
          * ReassignToOriginalPerformer
          * DoNotAssignToPerformerOfActivity
          
          As mentioned in the comments, one of each extended attribute should be
          associated with any single activity definition.  If anybody wishes to
          extend/modify this class in any way, one obvious improvment would be to allow
          multiple copies of each extended attribute to be assigned to a single 
          activity.
          I would ideally have liked to do this, but I don't need such functionality at
          the moment, and unfortunately don't have any more time to spend on it.
          
          In order to get the class working, the following properties need to be 
          specified
          in Shark.conf:
          
          
          #
          # HistoryRelated assigment manager
          #
          AssignmentManagerClassName
          =org.enhydra.shark.assignment.HistoryRelatedAssignmentManager
          HistoryRelatedAssignmentManager.username
          =admin
          HistoryRelatedAssignmentManager.password
          =enhydra
          HistoryRelatedAssignmentManager.extAttrReassignToOriginalPerformer
          =ReassignToOriginalPerformer
          HistoryRelatedAssignmentManager.extAttrAssignToPerformerOfActivity
          =AssignToPerformerOfActivity
          HistoryRelatedAssignmentManager.extAttrDoNotAssignToPerformerOfActivity
          =DoNotAssignToPerformerOfActivity
          The XPDL example is a "publish document" process that describes the workflow that may occur when publishing a web-based document. Note that in the following, a question mark represents either "1" or "2" depending on which moderator we are referring to: * Initially, an author creates a document and submits it to two moderators. The "DoNotAssignToPerformerOfActivity" ext attrib is used for each moderate_document_? activity to ensure that two different moderators moderate the document and that the same moderator cannot moderate it twice. * Each moderator moderates the document and says whether or not it is ok by setting the values of the moderate_?_ok WRD. If OK, the moderator then has to submit the document. Note that the AssignToPerformerOfActivity ext attrib is used to ensure that the moderator who moderated the document is assigned the appropriate submit_document_? activity. * If either moderator rejects the document, then the author has to update it. Again, we use the AssignToPerformerOfActivity ext attrib to ensure that the author who originally created the document has to update it. * When updated, the author has to re-submit the document using the same submit_document activity. We use the ReassignToOriginalPerformer ext attrib to ensure that the author who resubmits the document is the same author that originally submitted it. * Finally, when both the moderators are happy with the document, a publisher reviews it (if he rejects it, we head back to "update document" - in exactly the same way as if a moderator rejects it). When the publisher is happy with the document, he publishes it. We use the AssignToPerformerOfActivity ext attrib to ensure that the publisher who publishes the document is the same publisher that reviewed it. That's it... I've tested both the class and the XPDL to some extent, but both could do with some more testing if anybody would like to do it. Let me know if you have any questions.

          posted @ 2005-04-30 14:16 java光環(huán) 閱讀(572) | 評(píng)論 (0)編輯 收藏

          Integrating workflow engines with other system modules

          Hi all,

          This is probably a newbie question so please be tolerant :-)

          I am involved in the development of a system that has a business process management component. The system is based on Spring, Hibernate and Web Work 2. The question is, out of all those available BPM engines, which ones can easily be integrated into other infrastructures? My first impression is that BPM engines designed to be the infrastructure itself, so that functions such as data access, business logic and user interface are specified around it. As opposed to using another infrastructure (in our case, Spring + Hibernate + Web Work) where the BPM engine is merely a component.

          Is this distinction real? Should BPM engines logically be the center-piece of the system? Or am I grossly misunderstanding the issues?


          --->

          I feel that the best way to use a Workflow/BPM system is as a database is : something external that you access with some system users.

          Sometimes an embedded workflow engine is necessary, but in this case, the application that embeds should dictate the infrastructure

          --->

          I think it should be implemented as an aspect

          I have implemented a workflow engine before. I made it completely independent of the business objects etc. However, I had to modify business facades to call into the workflow engine; for example, to start a new process for a new request. At this point, I am thinking of doing it as an aspect in Spring, and I believe this will work out nicely.

          --->

          I am currently building a project using Struts, Spring and Hibernate with OSWorkflow. The current development build (2.8) has built-in support for a Spring / Hibernate environment. In this case, performing an action in the workflow can check against a set of pre-conditions, which can refer to logic in the business layer and can then call some functions if the conditions hold, which can also refer to business logic. This is nice because Spring deals with the dependencies for the conditions and functions. The end result is my business logic is protected by the workflow engine, which prevents any action being performed in the wrong stage of the process.

          The only downside of OSWorkflow is that you have to call the workflow action by passing the action's id (an int) and a map of all the inputs to the engine. I'm getting around this by writing an abstraction layer that provides nice method signatures (the business facade) for my struts actions (or any other client). These methods will map to an action id, take all the arguments from the signature and wrap them in a map and call the action.

          I hope this is helpful.

          Adam

          http://www.manageability.org/blog/stuff/workflow_in_java/view

          posted @ 2005-04-28 18:49 java光環(huán) 閱讀(539) | 評(píng)論 (0)編輯 收藏

          工作流引擎Shark配置

           如果在Shark中未定義程序映射,Shark將調(diào)用默認(rèn)的ToolAgent,在Shark.conf中可定義;

          RuntimeApplicationToolAgent可執(zhí)行其它外部程序,比如notepad等,此時(shí),傳入的application mode如果為0,則Shark會(huì)等待應(yīng)用程序的執(zhí)行結(jié)束;如果不為0,則Shark在應(yīng)用程序開始后會(huì)繼續(xù)流程的處理;

          JavaScriptToolAgent可用于執(zhí)行JavaScript,application mode為0,則系統(tǒng)將搜索名為applicationName的文件,執(zhí)行;

          posted @ 2005-04-22 11:37 java光環(huán) 閱讀(878) | 評(píng)論 (0)編輯 收藏

          Spring Hibernate Config: mappingDirectoryLocations

           I have seen a bunch of projects which are using Spring and Hibernate, and have something like the following in their applicationContext.xml file.

          <property name="mappingResources">
          <list>
          <value>com/almaer/model/Person.hbm.xml</value>
          <value>com/almaer/model/Car.hbm.xml</value>
          <value>com/almaer/model/Engine.hbm.xml</value>
          <value>com/almaer/model/Toy.hbm.xml</value>
          </list>
          </property>

           Luckily, you can just point to the directory now, and have Spring work it out for you :)

          <property name="mappingDirectoryLocations">
          <list>
          <value>WEB-INF/mappings</value>
          </list>
          </property>

          posted @ 2005-04-20 13:59 java光環(huán) 閱讀(1391) | 評(píng)論 (0)編輯 收藏

          關(guān)于cascade 與inverse

          看貼記錄:

           在絕大多數(shù)(100%?)情況下,many-to-many的cascade都會(huì)設(shè)置為"save-update",
          比如User和Role是many-to-many的,你不可能在刪除一個(gè)Role時(shí),把它的所有User都刪除吧,反之也不可能。 

          雙向的many-to-many維護(hù)起來確實(shí)比較麻煩,且效率可能比較低。
          但我始終還是堅(jiān)持一個(gè)原則:雙向關(guān)聯(lián)一定要一邊設(shè)置為inverse="true",更新時(shí)兩邊一起更新。我從來沒有遇到過違反外鍵的情況。
           

          從關(guān)系本身來講,一對(duì)多,多對(duì)一的關(guān)系本身都是由多的一方來維護(hù)的,
          多對(duì)多是由雙方來維護(hù)的

          posted @ 2005-04-15 15:09 java光環(huán) 閱讀(275) | 評(píng)論 (0)編輯 收藏

          How do you use findByNamedParam,findByNamedQueryAndNamedParam?

          spring  封裝了對(duì)hibernate 底層操作,現(xiàn)列了一些查詢方法:

          1,findByNamedParam
          code:

          public List getRolesByName(String roleName) {
                  
          return getHibernateTemplate().findByNamedParam("from Role role where role.name=:roleName""roleName",roleName);
              }

          2,findByNamedQueryAndNamedParam
          code:
          getHibernateTemplate().findByNamedQueryAndNamedParam("testeCQuery""idCidade", cidade);
          xml code:
          <query name="testeCQuery"><![CDATA[
                       from br.com.ag2.casarural.vo.Cidade as cidade where cidade.idCidade = :idCidade
                  
          ]]></query>

          posted @ 2005-04-14 19:31 java光環(huán) 閱讀(5818) | 評(píng)論 (1)編輯 收藏

          appfuse 加入初始化數(shù)據(jù)

          appfuse 在new 一個(gè)project  如果直接改了自帶的user ,role 表名,沒有自動(dòng)裝入數(shù)據(jù),原因在SETUP時(shí)CREAE TABLE 與 測(cè)試腳本中的表名不一致造成的,我們只要再修改一下metadata\sql\sample-data.xml文件,把表名改成與類名中的XDOCLET 一致就行了,然后 執(zhí)行ant db-load 再次select 一下,就可以了.
          //--
          ant db-prepare // 重新編譯類生成 *.hbm.xml 文件,數(shù)據(jù)表將重建,原來數(shù)據(jù)表要被drop 掉。

          posted @ 2005-04-11 16:58 java光環(huán) 閱讀(376) | 評(píng)論 (0)編輯 收藏

          Avoiding "Do you want to resend information" browser messages

           This might be a minor thing but significantly improves the user experience. The problem usually happens when the update action forwards to the view action. Instead of doing a redirect. This means the user sees /editPerson.action in the address field of the browser. But he is really looking at /viewPerson.action. This means that if he presses reload he will resubmit the data. It also means the user can navigate back to the /editPerson.action by using the back and forward buttons or the browser history. 

          To avoid this you can use the PRG (Post, Redirect and Get) Pattern. It can be summarized as follows: 

          Never show pages in response to POST
          Always load pages using GET
          Navigate from POST to GET using REDIRECT

          Using the PRG approach removes this possibility by never showing the /editPerson.action to the user. This means he cannot navigate back to the page in any way. In this case it means a redirect between the editPerson action (update action) and the viewPerson action (view action).

          It is easily implemented in Webwork by using the redirect result type. The final mapping of editPerson and viewPerson looks like this.
          <action name="editPerson" class="example.EditPersonAction">
             
          <result name="success" type="redirect">
                 
          <param name="location">/viewPerson.action?id=${userId}</param>
                 
          <param name="parse">true</param>
             
          </result>
             
          <result name="invalid.token">/duplicate_post.vm</result>
             
          <interceptor-ref name="defaultStack"/>
             
          <interceptor-ref name="token"/>
          </action>

          <action name="viewPerson" class="example.ViewPersonAction">
             
          <result name="success">/view_person.vm</result>
             
          <interceptor-ref name="defaultStack"/>
          </action>
          One thing to notice is the OGNL expression in the location (/viewPerson.action?id=${userId}) This means Webwork will evaluate the expression at runtime and replace ${userId}. In this case it is taken directly from a request parameter.

          In Struts you would have to manually code the redirect as far as I know.

          posted @ 2005-04-04 16:24 java光環(huán) 閱讀(326) | 評(píng)論 (0)編輯 收藏

          Preventing Duplicate Logins with Acegi Security

          Acegi Security sure makes things a lot simpler (once you have it setup). Today on the AppFuse mailing list, I noticed a link to how to prevent duplicate logins. No code needed, just some configuration changes. Nice!

          Update: I tried this on AppFuse and it does work, but I don't like the default implemementation. If a user is already logged in, you can't log in with that same user until the initial session times out. I'd prefer the first session gets invalidated when the second login is made. What's your preference?

          posted @ 2005-03-25 11:42 java光環(huán) 閱讀(507) | 評(píng)論 (0)編輯 收藏

          Developing Test-Driven Web Applications with Spring and Hibernate

          One of the hardest parts about J2EE development is getting started. There is an immense amount of open source tools for web app development. Making a decision on which technologies to use can be tough--actually beginning to use them can be even more difficult.

          Once you've decided to use Struts and Hibernate, how do you go about implementing them? If you look on the Hibernate site or the Struts site, you'll probably have a hard time finding any information on integrating the two. What if you want to throw Spring into the mix? For developers, one of the best ways to learn is by viewing sample apps and tutorials that explain how to extend those applications. In order to learn (and remember) how to integrate open source technologies such as Hibernate, Spring, Struts, and Ant/XDoclet, Raible created AppFuse.

          The beauty of AppFuse is you can actually get started with Hibernate, Spring, and Struts without even knowing much about them. Using test-driven development, AppFuse and its tutorials will show you how to develop a J2EE web application quickly and efficiently.

          posted @ 2005-03-25 09:43 java光環(huán) 閱讀(384) | 評(píng)論 (0)編輯 收藏

          僅列出標(biāo)題
          共5頁: 上一頁 1 2 3 4 5 下一頁 
          主站蜘蛛池模板: 梅州市| 米泉市| 洛宁县| 安国市| 竹北市| 广西| 思茅市| 高淳县| 洛宁县| 营口市| 南川市| 柞水县| 公主岭市| 石屏县| 济阳县| 浦北县| 广汉市| 迁西县| 寿阳县| 布尔津县| 黑河市| 五常市| 马鞍山市| 龙门县| 荥经县| 抚顺市| 十堰市| 图们市| 新宁县| 云霄县| 车险| 和龙市| 吴堡县| 乐昌市| 万山特区| 凤城市| 遵义市| 六安市| 资阳市| 博客| 全椒县|