#
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.
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
如果在Shark中未定义程序映射,Shark将调用默认的ToolAgent,在Shark.conf中可定义;
RuntimeApplicationToolAgent可执行其它外部程序,比如notepad等,此时,传入的application mode如果为0,则Shark会等待应用程序的执行结束;如果不为0,则Shark在应用程序开始后会继续流程的处理;
JavaScriptToolAgent可用于执行JavaScript,application mode为0,则系统将搜索名为applicationName的文件,执行;
看贴记录:
在绝大多数(100%?)情况下,many-to-many的cascade都会设置为"save-update",
比如User和Role是many-to-many的,你不可能在删除一个Role时,把它的所有User都删除吧,反之也不可能。
双向的many-to-many维护起来确实比较麻烦,且效率可能比较低。
但我始终还是坚持一个原则:双向关联一定要一边设置为inverse="true",更新时两边一起更新。我从来没有遇到过违反外键的情况。
从关系本身来讲,一对多,多对一的关系本身都是由多的一方来维护的,
多对多是由双方来维护的
appfuse 在new 一个project 如果直接改了自带的user ,role 表名,没有自动装入数据,原因在SETUP时CREAE TABLE 与 测试脚本中的表名不一致造成的,我们只要再修改一下metadata\sql\sample-data.xml文件,把表名改成与类名中的XDOCLET 一致就行了,然后 执行ant db-load 再次select 一下,就可以了.
//--
ant db-prepare // 重新编译类生成 *.hbm.xml 文件,数据表将重建,原来数据表要被drop 掉。
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?
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.