Oracle神谕

  BlogJava :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理 ::
  284 随笔 :: 9 文章 :: 106 评论 :: 0 Trackbacks

#

The Drools move to JBoss really is a good thing for everyone, with no down sides, key Drools developers were consulted throughout the process and all are more than happy with the situation.

Drools转移到JBoss对每个人来说是一件好事情,没有任何条件地,核心Drool开发人员考虑流程并且所有都更快乐的情形。

Rule engines are a specialised field, this is recognised by JBoss, and they trust us as the experts so we retain full control of development. I now get to work full time on Drools and we will hopefully be hiring another full time Drools developer. Bob McWhirter will continue to be involved in Drools, in an official JBoss capacity under a part time basis, as he continues to have other responsibilities. This will really accelerate the development process; which benefits everyone.
Rule引擎是一个专门的领域,这是被JBoss承认,并且它们信任我们作为专家,所以我们保留所有的开发控制。我现在开始在Drools上全职开发并且我们将希望雇佣其他全职的Drools开发者。Bob McWhirter将继续保持在Drools,在一个官方的JBoss地位 under a part time basis,所以他继续拥有其他责任。他们将真正的促进开发流程;我们收益于每个人。

Drools will continue to work as a standalone product, as part of the JBoss JEMS stack. We will of course work on great JBoss AS integration, especially with jBPM - however we will continue to fully support other AS. I want Drools to be used absolutely everywhere and will do everything I can to achieve this; I want NO artificial barriers to adoption - this has always been important to me and the main reason for not going LGPL. The license will stay BSDish, although we may change it to a standardised BSD/ASF/MIT license ?this has been planned for a while and will help to avoid confusion.

Drools将继续作为一个独立的项目工作,作为JBoss JEMS stack的一部分。我们将当然继续工作JBoss AS 集成,特别是jBPM-然而我们将继续全面支持其他AS.我想让Drools用来被使用绝对每个地方并且做我可以去完成这个的任何事情;我想没有假的障碍来采用--这总是对我来说很重要并且没有进行LGPL的主要原因。这个license仍然逗留在BSDish,虽然我们可以修改他成一个标准化的BSD/ASF/MIT 的license?这已经计划了一段时间并且帮助我们避免混乱。

Now that Drools is part of JBoss we can work on strong jBPM integration. We will bring standardised and easily understandable solutions to Workflow/BPM and Business Rules integration to the masses. I have already met with Tom Baeyens and we have identified some initial areas to work on for our first product release in Q1 2006. This is exciting work and will provide new ways of being able to build better affordable solutions without the high costs of existing specialised systems.

On a more personal note neither I nor Bob McWhirter are corporate type people, in fact Bob is famous for it!!! I would not have joined JBoss without full autonomy in an environment that would fully support my vision and the Drools community. We expected JBoss to take bully boy tactics in negotiations; however they were quite the contrary - this was unexpected and very refreshing and one of the key factors in my decision. Throughout the entire process they were surprisingly flexible; they listened to all our concerns and responded supportively - this was especially demonstrated in licensing talks, I hope the community takes note of that. While JBoss would have liked us to LGPL they respected our reasoning and never put any undue pressure on us. Since joining I have been continually asked about community feedback and response from all key JBoss people, Marc Fleury has taken a personal interest in this and repeatedly asked me if there is anything more he can do. This concern has been truly genuine and very much appreciated by me. Luckily the response has been great; we have had overwhelmingly positive feedback, especially once we clarified the licensing.

It would take 24+ months for a small company without an existing track record or infrastructure to try and build a strong brand around Drools, with all the support/consultancy/training/partner infrastructure that is needed for enterprise systems - this is a huge risk and one that I and Iterion were very much aware of. With JBoss we can achieve these in 6 months to a far greater effect, with negligible risk; as JBoss depends heavily on partners this will result in a larger ROI, due to scaling, with far less risk for them.

原文地址:http://blogs.codehaus.org/people/mproctor/archives/001192_drools_joins_jboss.html

posted @ 2005-10-13 23:54 java世界畅谈 阅读(639) | 评论 (0)编辑 收藏

public class PriorityQueue<E>extends AbstractQueue<E>implements Serializable
An unbounded priority queue based on a priority heap. This queue orders elements according to an order specified at construction time, which is specified either according to their natural order (see Comparable), or according to a Comparator, depending on which constructor is used. A priority queue does not permit null elements. A priority queue relying on natural ordering also does not permit insertion of non-comparable objects (doing so may result in ClassCastException).
  一个极大的优先队列基于一个优先堆栈。这个队列按照一个限定在构造时间顺序排列元素,这是也是按照它们的自然的顺序(查看Comparable)限定的,或者按照一个Comparator,依靠使用的构造子。一个优先队列不允许为空元素。一个优先队列依靠自然顺序也不允许插入一个非comparable对象(这样做会产生ClassCastException的结果)。

The head of this queue is the least element with respect to the specified ordering. If multiple elements are tied for least value, the head is one of those elements -- ties are broken arbitrarily. The queue retrieval operations poll, remove, peek, and element access the element at the head of the queue.
  这个队列头是最小的元素伴随期望限定的排序。如果多个元素为最小的值约束,头是这些元素中的一个---约束是任意打断的。队列获得操作poll(推),remove(移除),peek 和在队列头部的元素

A priority queue is unbounded, but has an internal capacity governing the size of an array used to store the elements on the queue. It is always at least as large as the queue size. As elements are added to a priority queue, its capacity grows automatically. The details of the growth policy are not specified.
  一个优先队列是极大的,但是拥有一个内部的容量调节数组的大小用来存储在队列中的元素。它总是至少和队列大小是是一样大小的。作为元素被加入一个优先队列,它的容量是自动增加的。增加策略的细节是没有指定的。

This class and its iterator implement all of the optional methods of the Collection and Iterator interfaces. The Iterator provided in method iterator() is not guaranteed to traverse the elements of the PriorityQueue in any particular order. If you need ordered traversal, consider using Arrays.sort(pq.toArray()).
  这个类和它的枚举实现所有可选的集合和枚举接口的方法。这个枚举支持iterator()方法是不保证在任何特定的顺序遍历PriorityQueue的元素。如果你需要顺序的遍历,考虑使用Array.sort(pq.toArray()).

Note that this implementation is not synchronized. Multiple threads should not access a PriorityQueue instance concurrently if any of the threads modifies the list structurally. Instead, use the thread-safe PriorityBlockingQueue class.
  注意这个实现不是不同步的。多个线程不应当并发访问一个PriorityQueue实例,如果线程在结构上线程任一个被修改。作为替换,使用线程安全的PriorityBlockingQueue类。

Implementation note: this implementation provides O(log(n)) time for the insertion methods (offer, poll, remove() and add) methods; linear time for the remove(Object) and contains(Object) methods; and constant time for the retrieval methods (peek, element, and size).

This class is a member of the Java Collections Framework.

 

Since:
1.5
See Also:
Serialized Form

posted @ 2005-10-09 23:10 java世界畅谈 阅读(901) | 评论 (1)编辑 收藏

Package java.util.concurrent(并发) Description

Utility classes commonly useful in concurrent programming. This package includes a few small standardized extensible frameworks, as well as some classes that provide useful functionality and are otherwise tedious(沉闷的) or difficult to implement. Here are brief(摘要的) descriptions of the main components. See also the locks(锁) and atomic(原子的) packages.

Executors(执行者)
Interfaces. Executor is a simple standardized interface for defining custom thread-like subsystems(子系统), including thread pools(线程池), asynchronous IO(异步IO), and lightweight task frameworks(轻量级任务框架). Depending on which concrete Executor class is being used, tasks may execute in a newly(以新的方式) created thread, an existing task-execution thread, or the thread calling execute(), and may execute sequentially(继续地) or concurrently(并发地). ExecutorService provides a more complete asynchronous(异步的) task execution framework. An ExecutorService manages queuing(队列) and scheduling(行程安排) of tasks, and allows controlled shutdown. The ScheduledExecutorService subinterface adds support for delayed(延时的) and periodic(定期的) task execution. ExecutorServices provide methods arranging(安排的) asynchronous execution of any function expressed as Callable, the result-bearing analog(类似物) of Runnable. A Future returns the results of a function, allows determination of whether execution has completed, and provides a means to cancel execution.
Implementations. Classes ThreadPoolExecutor and ScheduledThreadPoolExecutor provide tunable(可调的), flexible(灵活的) thread pools. The Executors class provides factory methods for the most common kinds and configurations of Executors, as well as a few utility methods for using them. Other utilities based on Executors include the concrete class FutureTask providing a common extensible implementation of Futures, and ExecutorCompletionService, that assists in coordinating(计算调配中心) the processing of groups of asynchronous(异步的) tasks.
[Executor  ExecutorService ScheduledExecutorService ScheduledThreadPoolExecutor ExecutionCompletionService]

Queues(队列)
The java.util.concurrent ConcurrentLinkedQueue class supplies an efficient scalable(可升级的) thread-safe(线程安全) non-blocking(非模块化) FIFO queue. Five implementations in java.util.concurrent support the extended BlockingQueue interface, that defines blocking versions of put and take: LinkedBlockingQueue, ArrayBlockingQueue, SynchronousQueue, PriorityBlockingQueue, and DelayQueue. The different classes cover the most common usage contexts for producer-consumer, messaging, parallel tasking, and related concurrent designs.
[LinkedBlockingQueue ArrayBlockingQueue SynchronousQueue PriorityBlockingQueue DelayQueue]

Timing(定时)
The TimeUnit class provides multiple granularities<间隔尺寸> (including nanoseconds十亿分之一秒) for specifying and controlling time-out(暂停) based operations. Most classes in the package contain operations based on time-outs in addition to(除...以外) indefinite(不确定的) waits. In all cases that time-outs are used, the time-out specifies the minimum time that the method should wait before indicating(指出) that it timed-out. Implementations make a "best effort" to detect(察觉) time-outs as soon as possible after they occur. However, an indefinite(模糊的) amount of time may elapse(流逝) between a time-out being detected and a thread actually executing again after that time-out.

Synchronizers(同步)
Four classes aid(帮助) common special-purpose synchronization idioms(语法). Semaphore(旗语) is a classic concurrency tool. CountDownLatch(Countdown 倒数计秒  latch门插销) is a very simple yet very common utility for blocking until a given number of signals, events, or conditions hold. A CyclicBarrier(cyclic 循环的 barrier 屏障) is a resettable(可重置的) multiway(多路的) synchronization point useful in some styles of parallel programming. An Exchanger allows two threads to exchange(交换) objects at a rendezvous point(集合点), and is useful in several pipeline(管道) designs.

Concurrent Collections(并发集合)
Besides Queues, this package supplies a few Collection implementations designed for use in multithreaded contexts: ConcurrentHashMap, CopyOnWriteArrayList, and CopyOnWriteArraySet.
The "Concurrent" prefix used with some classes in this package is a shorthand(速记) indicating several differences from similar "synchronized" classes. For example java.util.Hashtable and Collections.synchronizedMap(new HashMap()) are synchronized. But ConcurrentHashMap is "concurrent". A concurrent collection is thread-safe, but not governed by a single exclusion lock. In the particular case of ConcurrentHashMap, it safely permits any number of concurrent reads as well as a tunable number of concurrent writes. "Synchronized" classes can be useful when you need to prevent all access to a collection via a single lock, at the expense of poorer scalability. In other cases in which multiple threads are expected to access a common collection, "concurrent" versions are normally preferable. And unsynchronized collections are preferable when either collections are unshared, or are accessible only when holding other locks.

Most concurrent Collection implementations (including most Queues) also differ from the usual java.util conventions in that their Iterators provide weakly consistent rather than fast-fail traversal. A weakly consistent iterator is thread-safe, but does not necessarily freeze the collection while iterating, so it may (or may not) reflect any updates since the iterator was created.

 

Since:
1.5

posted @ 2005-10-08 10:43 java世界畅谈 阅读(900) | 评论 (0)编辑 收藏

  最近感觉自己一直是缺少知识的补充。现将主要学习的东东列举如下:
1.jboss(EJB JMS JNDI Jboss知识),感觉自己这方面很是缺少,也没有相应的开发经验,jBpm中使用了jms的东东。以前做的东西大都运行在Tomcat下,但是对高端的应用服务器还不是很了解。有必要好好学习。
2.正则表达式,感觉这个非常有用,以前都没有充分利用这个。只是最近才开始在一些脚本校验上使用。不过还有些东西不是很明白的。
3.AOP,现在这个是有一些理论基础,也做一个小的demo,但是对这个还是没有彻底了解。
4.针对开源软件进行学习,将其中的精髓总结出来,使用在我们的项目开发中。
posted @ 2005-10-05 12:21 java世界畅谈 阅读(366) | 评论 (0)编辑 收藏

  看到jBPM中大量使用了subclass的用法,应该说这个是比较OO的,设计的非常合理。
  (一)、首先先去看看Hibernate的subclass:
  1.对于“每一个类继承树对应一个表”的策略来说,就需要使用<subclass>定义。
  <subclass>
            name="className"  //子类的全名
            discriminator-value="discriminator-value" //辨别标识,一个用于区分每个独立的子类的值
            proxy="proxyInterface" //指定一个类或接口,在延迟加载时作为代理使用
            lazy="true|false"
            dynamic-update="true|false"
            dynamic-insert="true|false"
            entity-name="entityName"
            node="element-name">
           <property ..../>
          ......
        </subclass>
  2.每个子类都应该定义它自己的持久化属性和子类。<version>和<id>属性可以从根父类继承下去。在一棵继承树上的每个子类都必须定义一个唯一的discriminator-value。如果没有指定,就会使用Java类的全限定名。
  3.必须在子类的影射中指定extends属性来指定已影射的超类。

 (二)在jBPM中的使用
 1.在jBPM的definition组的类机构中就采用上述的技术。其中ModuleDefinition是作为抽象父类存在的,而ContextDefinition、FileDefinition、LoggingDefinition、SchedulerDefinition、MgmtDefinition类是做为subclass存在的。
 2.在父类中使用了discriminator鉴别器的技术:在继承策略中的“一个对象继承树应对应一个表”的策略中,<discriminator>元素是必须的。鉴别器字段包含标志值,用于告知持久层应该为某个特定的行创建哪一个类别的实例。例如:
  父类的影射片段:
    <discriminator type="char" column="CLASS_"/>
    <!-- M : org.jbpm.module.def.ModuleDefinition -->
    <!-- C : org.jbpm.context.def.ContextDefinition -->
    <!-- F : org.jbpm.file.def.FileDefinition -->
    <!-- L : org.jbpm.logging.def.LoggingDefinition -->
    <!-- I : org.jbpm.scheduler.def.SchedulerDefinition -->
    <!-- T : org.jbpm.taskmgmt.def.TaskMgmtDefinition -->
    <!--  :  -->
    <!--  :  -->
 3.鉴别器字段的实际值是根据<class>和<subclass>元素中的discriminator-value属性得来的
 例如:
  父影射文件:
  <class name="org.jbpm.module.def.ModuleDefinition"
         table="JBPM_MODULEDEFINITION"
         abstract="true"
         discriminator-value="M"
         lazy="false">
       子影射文件:
  <subclass name="org.jbpm.context.def.ContextDefinition"
            extends="org.jbpm.module.def.ModuleDefinition"
            discriminator-value="C"
            lazy="false">
       </subclass>
posted @ 2005-10-03 10:22 java世界畅谈 阅读(4573) | 评论 (2)编辑 收藏

  有一阵没有看jBPM的source了,正好这几天是国庆,口袋也没有多少米,没有出去旅游的计划,所以,又重新研究分析一下src。希望从中可以学习到有用的东东!
  JbpmConfiguration,从名字上就知道是获取jBPM的相关配置信息。不过这里写的是一个公共的获取properties的方法。
  首先声明了一个static properties(静态属性)的实例properties,然后使用静态方法getProperties(),为properties获得具体的值(取org.jbpm.jbpm.properties)。
  然后是N多获取方法:
  public static String getString(String key)
  public static String getString( String key, String defaultValue ) //如果没有这个值,默认返回的是defaultValue
  public static long getLong( String key, long defaultValue )
  public static boolean getBoolean(String key, boolean defaultValue)
  public static Object getObject(String key)
  public static Object getObject(String key, Object defaultValue)   
  这些为获取String、long、boolean、Object提供基础的支持,为以后的操作提供了很多的方便。

posted @ 2005-10-02 10:52 java世界畅谈 阅读(2110) | 评论 (0)编辑 收藏

  以前的做分隔符获取一个个字符串很是麻烦,其实JDK中的String 类已经很好的解决了这个问题。正则表达式确实是个好东西!

split

public String[] split(String regex)
Splits this string around matches of the given regular expression.

This method works as if by invoking the two-argument split method with the given expression and a limit argument of zero. Trailing empty strings are therefore not included in the resulting array.

The string "boo:and:foo", for example, yields the following results with these expressions:

Regex Result
: { "boo", "and", "foo" }
o { "b", "", ":and:f" }

Parameters:
regex - the delimiting regular expression
Returns:
the array of strings computed by splitting this string around matches of the given regular expression
Throws:
PatternSyntaxException - if the regular expression's syntax is invalid
Since:
1.4
See Also:
Pattern
posted @ 2005-09-29 16:23 java世界畅谈 阅读(1774) | 评论 (1)编辑 收藏

<script type="text/javascript" language="javascript">
var http_request = false;
function makeRequest(url) {
http_request = false;
if (window.XMLHttpRequest) { // Mozilla, Safari,...
http_request = new XMLHttpRequest();
if(http_request.overrideMimeType){
http_request.overrideMimeType('text/xml');
}
} else if (window.ActiveXObject) { // IE
try {
http_request = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
http_request = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {}
}
}
if (!http_request) {
alert('Giving up Sad Cannot create an XMLHTTP instance');
return false;
}
http_request.onreadystatechange = alertContents;
http_request.open('GET', url, true);
http_request.send(null);
}
function alertContents() {
if (http_request.readyState == 4) {
if (http_request.status == 200) {
alert(http_request.responseText);
} else {
alert('There was a problem with the request.');
}
}
}
</script>
<span style="cursor: pointer; text-decoration: underline" onclick="makeRequest('test.html')"> 发出请求</span>

原文地址:http://www.hibernate.org.cn/viewtopic.php?t=15156
posted @ 2005-09-26 12:58 java世界畅谈 阅读(526) | 评论 (0)编辑 收藏

Task management 任务管理
The core business of jBPM is the ability to persist the execution of a process. A situation in which this feature is extremely useful is the management of tasks and tasklists for people. jBPM allows to specify a piece of software describing an overall process which can have wait states for human tasks.
jBPM的核心逻辑是有能力持久化流程的执行。一个为人们用来管理任务和任务列表的特征的情形是非常有用的。jBPM允许指定一些软件描述一个全面的流程,它可以为人任务拥有等待状态。

9.1. Tasks 任务
Tasks are part of the process definition and they define how task instances must be created and assigned during process executions.
任务是流程定义的一部分,并且他们定义了任务实例如何在流程执行中必须被创建并且委派。

Tasks can be defined in task-nodes and in the process-definition. The most common way is to define one or more tasks in a task-node. In that case the task-node represents a task to be done by the user and the process execution should wait until the actor completes the task. When the actor completes the task, process execution should continue. When more tasks are specified in a task-node, the default behaviour is to wait for all the tasks to complete.
任务可以在task-nodes和process-definition中被定义。最常用的方式是在task-node中定义一个或多个任务。如果是那样的话,task-node表现一个任务被用户执行并且流程执行应该等待知道actor完成这个任务。当这个actor完成这个任务,流程定义应该继续。当更多任务在task-node被定义,缺省的行为是等待所有任务的完成。

Tasks can also be specified on the process-definition. Tasks specified on the process definition can be looked up by name and referenced from within task-nodes or used from inside actions. In fact, all tasks (also in task-nodes) that are given a name can be looked up by name in the process-definition.
任务也被定义在process-definition中。指定在流程定义上的任务可以通过名称查询并且参考从内部的task-nodes或者从内部actions中使用。事实上,所有的给定名称任务(也在task-nodes)可以在流程定义中通过名字查询。

Task names must be unique in the whole process definition. Tasks can be given a priority. This priority will be used as the initial priority for each task instance that is created for this task. TaskInstances can change this initial priority afterwards.
任务名称在整个流程定义中是非重复。任务可以被指定一个优先权。这个优先权将被使用在初始化优先权为每个为任务创建的流程实例。任务实例然后可以修改初始化优先权

9.2. Task instances
A task instance can be assigned to an actorId (java.lang.String). All task instances are stored in one table of the database (JBPM_TASKINSTANCE). By querying this table for all task instances for a given actorId, you get the task list for that perticular user.
一个任务实例可以被委派给一个actorId(java.lang.String).所有任务实例被储存在数据库的一个表中(JBPM_TASKINGSTANCE)。通过给定的actorId来对所有的任务实例查询这个表,你为特定用户得到任务列表。

The jBPM task list mechanism can combine jBPM tasks with other tasks, even when those tasks are unrelated to a process execution. That way jBPM developers can easily combine jBPM-process-tasks with tasks of other applications in one centralized task-list-repository.

这个jBPM任务列表机制可以组合jBPM任务和其他任务,甚至当这些任务于流程执行无关。那种方法jBPM开发者可以很容易的在一个集中的任务列表仓库中组合jBPM流程任务和其他应用程序。

9.2.1. Task instance life cycle
The task instance lifecycle is straightforward: After creation, task instances can optionally be started. Then, task instances can be ended, which means that the task instance is marked as completed.
任务实例生命周期是简单的:创建之后,任务实例可以随意地开始。接着,任务实例可以被终结,这意味着任务实例内标志为完成。

Note that for flexibility, assignment is not part of the life cycle. So task instances can be assigned or not assigned. Task instance assignment does not have an influence on the task instance life cycle.

注意对适应性、委派不是生命周期的组成部分。所以任务实例可以被委派或者不委派。任务实例委派在生命周期任务实例中没有影响。

Task instances are typically created by the process execution entering a task-node (with the method TaskMgmtInstance.createTaskInstance(...)). Then, a user interface component will query the database for the tasklists using the TaskMgmtSession.findTaskInstancesByActorId(...). Then, after collecting input from the user, the UI component calls TaskInstance.assign(String), TaskInstance.start() or TaskInstance.end(...).

TaskMgmtInstance.createTaskInstance(...)
TaskMgmtSession.findTaskInstancesByActorId(...)
TaskInstance.assign(String)
TaskInstance.start()
TaskInstance.end()

A task instance maintains it's state by means of date-properties : create, start and end. Those properties can be accessed by their respective getters on the TaskInstance.
一个任务实例维护它的状态借助于日期属性:create,start 和end. 这些属性可以在任务实例中通过他们分别的getter获得通道。

Currently, completed task instances are marked with an end date so that they are not fetched with subsequent(随后) queries for tasks lists. But they remain in the JBPM_TASKINSTANCE table. JBPM_TASKINSTANCE.

9.2.2. Task instances and graph execution 任务实例和图形执行
Task instances are the items in an actor's tasklist. Task instances can be signalling. A signalling task instance is a task instance that, when completed, can send a signal to its token to continue the process execution. Task instances can be blocking, meaning that the related token (=path of execution) is not allowed to leave the task-node before the task instance is completed. By default task instances are signalling and non-blocking.

In case(以防) more than one task instance are associated with a task-node, the process developer can specify how completion of the task instances affects continuation of the process. Following is the list of values that can be given to the signal-property of a task-node.

last: This is the default. Proceeds execution when the last task instance is completed. When no tasks are created on entrance of this node, execution is continued.
last-wait: Proceeds execution when the last task instance is completed. When no tasks are created on entrance of this node, execution waits in the task node till tasks are created.
first: Proceeds execution when the first task instance is completed. When no tasks are created on entrance of this node, execution is continued.
first-wait: Proceeds execution when the first task instance is completed. When no tasks are created on entrance of this node, execution waits in the task node till tasks are created.
unsynchronized: Execution always continues, regardless wether tasks are created or still unfinished.
never: Execution never continues, regardless wether tasks are created or still unfinished.
Task instance creation might be based upon a runtime calculation. In that case, add an ActionHandler on the node-enter event of the task-node and set the attribute create-tasks="false". Here is an example of such an action handler implementation:

public class CreateTasks implements ActionHandler {
  public void execute(ExecutionContext executionContext) throws Exception {
    Token token = executionContext.getToken();
    TaskMgmtInstance tmi = executionContext.getTaskMgmtInstance();
     
    TaskNode taskNode = (TaskNode) executionContext.getNode();
    Task changeNappy = taskNode.getTask("change nappy");

    // now, 2 task instances are created for the same task.
    tmi.createTaskInstance(changeNappy, token);
    tmi.createTaskInstance(changeNappy, token);
  }
}
As shown in the example the tasks to be created can be specified in the task-node. They could also be specified in the process-definition and fetched from the TaskMgmtDefinition. TaskMgmtDefinition extends the ProcessDefinition with task management information.

The API method for marking task instances as completed is TaskInstance.end(). Optionally, you can specify a transition in the end method. In case the completion of this task instance triggers continuation of the execution, the task-node is left over(延迟) the specified transition.

 

posted @ 2005-09-22 18:02 java世界畅谈 阅读(2021) | 评论 (7)编辑 收藏

script脚本:
一个script是一个执行BeanShell脚本的action。缺省地,所有流程定义变量都是合法的并且无脚本变量将被写入流程变量。下列脚本变量也是合法的:
executionContext
token
node
task
taskInstance

<process-definition>
  <event type="node-enter">
     <script>
        System.out.println("this script is enering node"+node);
     </script>
  </event>
  ...
</process-definition>

为定制缺省加载行为并且储存变量进script,变量元素可以被用来作为script的子元素。那样,脚本表达式不得不被放入一个脚本的子元素:expression

<prcession-definition>
  <event type="process-end">
    <expression>
      a = b+c;
    </expression>
    <variable name="XXX" access="write" mapped-name="a"/>
    <variable name="YYY" access="read" mapped-name="b"/>
    <variable name="ZZZ" access="read" mapped-name="c"/>
  </event>
</prcession-definition>

在脚本开始之前,这个流程变量YYY和ZZZ将分别作为脚本变量b和c使其合法。所有脚本完成之后,脚本变量值a被存储进流程变量XXX.

如果access变量属性包含"read",这个流程变量在脚本赋值之前将被加载作为一个脚本变量。如果access变量属性包含"write",这个流程变量在脚本赋值以后将被加载作为一个脚本变量。

posted @ 2005-09-20 15:42 java世界畅谈 阅读(889) | 评论 (1)编辑 收藏

仅列出标题
共29页: First 上一页 20 21 22 23 24 25 26 27 28 下一页 Last