- 浏览: 129186 次
- 性别:
文章分类
最新评论
-
cultivator129:
匿名用户没办法下载,也没找到登陆的地方,大家是怎么登陆的?
signavio-core-components编译初体验 -
511039003:
...
如何使用Guava的缓存管理 -
string2020:
activiti如何整合OSGI
Activiti User Guide -- Activit 用户指南 Part06 -
刺客8882010:
楼主可否给我份Demo,谢谢,控制部分代码在哪里写我不是很清楚 ...
利用Spring动态对Quartz定时任务管理 -
yu120:
有源码吗?
利用Spring动态对Quartz定时任务管理
3.8.9. Tasks(任务)
A task represents work that needs to be done by an external entity, such as a human actor or an automated service.
一个任务表示工作需要被外部实体完成,比如人工或自动服务。
It's important to note that the BPMN semantics of a 'task' differ from the JPDL semantics. In JPDL, the concept 'task' is always used in the context of a human actor doing some type of work. When the process engine encounters a task in JPDL, it will create a task in some human actor's task list and it will behave as a wait state. In BPMN 2.0 however, there are several task types, some indicating a wait state (eg. the User Task and some indicating an automatic activity (eg. the Service Task). So take good care not to confuse the meaning of the task concept when switching languages.
重要的是注意BPMN语法的'task'与jPDL语法的区别。在jPDL中,'task'的概念总是用在人工做一些事情的环境。jPDL流程引擎在遇到task时,它会创建一个task, 并分配一些人进行处理,然后它会进入等待状态。然而在BPMN 2.0中, 这里有很多任务类型,一些表示等待状态(比如,User Task), 一些表示自动活动(比如,Service Task)。所以在切换流程语言时要小心不要混淆了任务的概念。
Tasks are depicted by a rounded rectangle, typically containing a text inside. The type of the task (user task, service task, script task, etc.) is shown as a little icon on the left top corner of the rectangle. Depending on the task type, the engine will execute different functionality.
任务使用一个圆角矩形表示,一般内部包含一些文字。任务的类型(用户任务,服务任务,脚本任务,等等)使用小图标进行区分,显示在矩形的左上角。 根据任务的类型,引擎会执行不同的功能。
3.8.10. Task: User Task(任务:人工任务)
A User task is the typical 'human task' that is found in practically every workflow or BPM software out there. When process execution reaches such a user task, a new human task is created in task list for a given user.
user task是典型的'人工任务', 几乎在每个工作流软件或BPMN软件中都可以找到。当流程执行到达一个user task时, 任务列表中就会创建一个新人工任务,并分配给给定用户进行处理。
The main difference with a manual task (which also signifies work for a human actor) is that the task is known to the process engine. The engine can track the completion, assignee, time, etc which is not the case for a manual task.
和manual task(也表示将任务分配给人进行处理)的主要区别是user task也会被流程引擎记录。 引擎可以跟踪任务完成、分配、时间等等,而manual task则不可以。
A user task is depicted as a rounded rectangle with a small user icon in the top left corner.
user task描绘为一个圆角矩形,在左上角是一个小用户图标。
A user task is defined as follows in the BPMN 2.0 XML:
BPMN 2.0中user task XM定义如下:
<userTask id="myTask" name="My task" />According to the specification, multiple implementations are possible (Webservice, WS-humantask, etc.), as stated by using the implementation attribute. Currently, only the standard jBPM task mechanism is available, so there is no point (yet) in defining the 'implementation' attribute.
根据规范,user task可以采用多种实现(WebService, WS-humantask,等等),使用implementation属性来标示。 当前,只有标准的jBPM任务机制才可以用,所以这里还没有定义'implementation'属性的功能。
The BPMN 2.0 specification contains quite a few ways of assigning user tasks to user(s), group(s), role(s), etc. The current BPMN 2.0 jBPM implementation allows to assign tasks using a resourceAssignmentExpression, combined with the humanPerformer or PotentialOwner construct. It is to be expected that this area will evolve future releases.
BPMN 2.0规范包含了一些方法把任务分配给用户、组、角色等等。当前的BPMN 2.0 jBPM实现允许使用resourceAssignmentExpression并结合humanPerformer 或 PotentialOwner结构来分配任务。这部分希望在未来的版本里能够得到进一步演化。
A potentialOwner is used when you want to make a certain user, group, role, etc. a candidate for a certain task. Take the following example. Here the candidate group for the task 'My task' will be the 'management' group. Also note that a resource must be defined outside the process, such that the task assignment can reference the resource. In fact, any activity can reference one or more resource elements. Currently, only defining this resource is enough (since it is a required attribute by the spec), but this will be enhanced in a later release (eg. resources can have runtime parameters).
potentialOwner用来,当你想把一个任务分配给一个候选的人, 组,角色时(这里所说的意思是当你需要分配给一个组时则系统为该组建立一个任务,并不会为该组中每个人员建立一个任务,即组里面的人员都是任务候选人)。如下面例子所示。这里的'My task'任务的候选人组是'management'用户组。也要注意,这是需要在流程外部定义一个资源, 这样任务分配器才可以引用到这个资源。实际上,任何活动都可以引用一个或多个资源元素。当前,只需要定义这个资源就可以了(因为它是规范中的一个必须的元素),但是在以后的发布中会进行加强(比如,资源可以拥有运行时参数)。
<resource id="manager" name="manager" /> <process ...> ... <userTask id="myTask" name="My task"> <potentialOwner resourceRef="manager" jbpm:type="group"> <resourceAssignmentExpression> <formalExpression>management</formalExpression> </resourceAssignmentExpression> </potentialOwner> </userTask>Note that we are using a specific extension here (jbpm:type="group"), to define this is a group assignment. If this attribute is removed, the group semantics will be used as default (which would be ok in this example). Now suppose that Peter and Mary are a member of the management group (here using the default identity service):
注意,我们使用了一个特定的后缀 (jbpm:type="group"),来定义这是一个用户组的分配方式。如果删除了这个属性,就会默认使用用户组的语法(在这个例子中也是没问题的)。现在假设Peter和Mary是management组的成员 (这里使用默认的身份服务):
identityService.createGroup("management"); identityService.createUser("peter", "Peter", "Pan"); identityService.createMembership("peter", "management"); identityService.createUser("mary", "Mary", "Littlelamb"); identityService.createMembership("mary", "management");Then both peter and mary can look in their task list for this task (code snippet from the example unit test):
Peter和Mary都可以在他们的任务列表中看到这条任务 (代码来自实例单元测试):
// Peter and Mary are both part of management, so they both should see the task List<Task> tasks = taskService.findGroupTasks("peter"); assertEquals(1, tasks.size()); tasks = taskService.findGroupTasks("mary"); assertEquals(1, tasks.size()); // Mary claims the task Task task = tasks.get(0); taskService.takeTask(task.getId(), "mary"); assertNull(taskService.createTaskQuery().candidate("peter").uniqueResult()); taskService.completeTask(task.getId()); assertProcessInstanceEnded(processInstance);When the assignment should be done to a candidate user, just use the jbpm:type="user" attribute.
当分配方式为候选用户时,可使用jbpm:type="user"属性。
<userTask id="myTask" name="My User task"> <potentialOwner resourceRef="employee" jbpm:type="user"> <resourceAssignmentExpression> <formalExpression>peter</formalExpression> </resourceAssignmentExpression> </potentialOwner> </userTask>In this example, peter will be able to find the task since he's a candidate user for the task.
在这个例子里,Peter可以看到任务,因为他是这个任务的候选用户。
List<Task> tasks = taskService.createTaskQuery().candidate("peter").list();A human performer is used when you want to assign a task directly to a certain user, group, role, etc. The way to do this looks very much like that of the potential owner.
human performer用来,当你想把一个任务直接分配给一个确定人、组、角色时(这里需要注意当你分配给一个组时,系统将为该组中每一个人员建立一个任务,并不为该组建立任务)。这个方法的使用方式看起来和potential owner很像。
<resource id="employee" name="employee" /> <process ...> ... <userTask id="myTask" name="My User task"> <humanPerformer resourceRef="employee"> <resourceAssignmentExpression> <formalExpression>mary</formalExpression> </resourceAssignmentExpression> </humanPerformer> </userTask>
In this example, the task will be directly assigned to Mary. She can now find the task in her task list:
在这个例子中,任务会直接分配给Mary。她可以在自己的任务列表中看到这个任务:
List<Task> tasks = taskService.findPersonalTasks("mary");Since the task assignment is done through the use of a formalExpression, it's also possible to define expressions that are evaluated at runtime. The expressions itself need to be put inside a ${}, as usual in jBPM. For example, if a process variable 'user' is defined, then it can be used inside an expression. More complex expressions are of course possible.
因为任务分配可以通过使用 formalExpression来完成,它也可以定义一个表达式中,该表达式在运行期进行解析。表达式本身需要放在 ${}中,这和jBPM一样。比如,如果流程变量中定义了一个'user'变量,那么它可以用在表达式中。当然也可以使用更复杂的表达式。
<userTask id="myTask" name="My User task"> <humanPerformer resourceRef="employee"> <resourceAssignmentExpression> <formalExpression>${user}</formalExpression> </resourceAssignmentExpression> </humanPerformer> </userTask>Note that it is not needed to use the 'jbpm:type' on a humanPerformer element, since only direct user assignments can be done. If a task needs to be assigned to a role or group, use the potentialOwner with a group type (when you assign a task to a group, all members of that group will always be candidate users for that group - hence the usage of potentialOwner).
注意不需要在humanPerformer元素中使用'jbpm:type',因为只能进行直接用户分配。如果任务需要被分配给一个角色或一个组,使用potentialOwner和group类型(当你把任务分配给一个组时, 组中的所有成员都会成为候选用户 - 参考potentialOwner的用法)。
3.8.11. Task: Java Service Task(任务:Java服务任务)
A Service Task is an automatic activity that calls some sort of service, such as a web service, Java service, etc. Currently, only Java service invocations are supported by the jBPM engine, but Web service invocations are planned for a future release.
Service Task是一个自动活动,它会调用一系列的服务, 比如web service,java service等等。当前jBPM引擎只支持调用java service,但是web service的调用在未来的版本中已经做了计划。
Defining a service
task requires quite a few lines of XML (the BPEL influence is certainly visible
here). Of course, in the near future, we expect that tooling will simplify this
area a lot. A service task is defined as follows:
定义一个服务任务需要好几行XML(这里就可以看到BPEL的影响力)。 当然,在不久的未来,我们希望有工具可以把这部分大量的简化。一个服务任务需要如下定义:
<serviceTask id="MyServiceTask" name="My service task" implementation="Other" operationRef="myOperation" />The service task has a required id and an optional name. The implementation attribute is used to indicate what the type of the invoked service is. Possible values are WebService, Other or Unspecified. Since we've only implemented the Java invocation, only the Other choice will do something useful for the moment.
服务任务定义需要一个必填的id和一个可选的 name。implementation元素是用来表示调用服务的类型。可选值有WebService, Other或者Unspecified。 因为我们只实现了Java调用,所以现在只能选择Other。
The service task will invoke a certain operation that is referenced by the operationRef attribute using the id of an operation. Such an operation is part of an interface as shown below. Every operation has at least one input message and at most one output message.
服务任务将调用operationRef属性中引用operation。每个操作都是interface的一部分,定义如下所示。每个操作都至少有一个 输入信息,并且最多有一个输出信息。
<interface id="myInterface" name="org.jbpm.MyJavaServicek"> <operation id="myOperation2" name="myMethod"> <inMessageRef>inputMessage</inMessageRef> <outMessageRef>outputMessage</outMessageRef> </bpmn:operation> </interface>For a Java service, the name of the interface is used to specificy the fully qualified classname of the Java class. The name of the operation is then used to specify the name of the method that must be called. The input/output message that represent the parameters/return value of the Java method are defined as follows:
对于java服务,接口的名称用来指定java类的全类名。操作的名称 用来指定将要调用方法名。输入/输出信息表示着java方法的参数/返回值,定义如下所示:
<message id="inputMessage" name="input message" structureRef="myItemDefinition1" />
Several elements in BPMN are so-called 'item-aware', including this message construct. This means that they are involved in storing or reading items during process execution. The data structure to hold these elements is specified using a reference to an ItemDefinition. In this context, the message specifies its data structure by referencing an Itemdefinition in the structureRef attribute.
包括这个消息结构在内,BPMN中很多元素叫做'item感知'。这意味着它们会在流程执行过程中保存或读取item。负责这些元素的数据结构需要使用ItemDefinition。在这个环境下,消息指定了它的数据结构,通过引用 structureRef属性中定义的ItemDefinition。
<itemDefinition id="myItemDefinition1" > <jbpm:arg> <jbpm:object expr="#{var1}" /> </jbpm:arg> </itemDefinition> <itemDefinition id="myItemDefinition2"> <jbpm:var name="returnVar" /> </itemDefinition>Do note that this is not fully standard BPMN 2.0 as by the specification (hence the 'jbpm' prefix). In fact, according to the specification, the ItemDefinition shouldn't contain more than a data structure definition. The actual mapping between input paramaters, with a ceratin data structure, is done in the ioSpecification section of the serviceTask. However, the current jBPM BPMN 2.0 implementation hasn't implemented that construct yet. So, this means that the current usage as described above, will probably change in the near future.
注意,这写的不完全是BPMN 2.0标准(因此都有'jbpm'的前缀)。实际上,根据标准,ItemDefinition不应该包含多余一个数据结构定义。对于输入参数的数据结构映射,应该在serviceTask的ioSpecification部分来定义。然而,当前jBPM BPMN 2.0实现还没有实现。所以,这意味着上面所描述的使用方法,很可能在不久的未来就会出现变化。
Important note: Interfaces, ItemDefinitions and messages are defined outside a <process>. See the example ServiceTaskTest for a concrete process and unit test.
重要提醒:Interface、ItemDefinitions和Message都需要定义在 <process>外边。可以参考实际流程和单元测试示例 ServiceTaskTest。
发表评论
-
图形连线路由算法
2014-03-20 16:34 5915最近打算将工作流引擎设计器使用html5技术进 ... -
signavio-core-components编译初体验
2012-03-28 11:17 4695最近又开始研究Acti ... -
jBPM Developers Guide(jBPM开发指南)--Chapter 3. BPMN 2.0(第六部分)
2010-06-22 20:15 27393.9. Complete example (includi ... -
jBPM Developers Guide(jBPM开发指南)--Chapter 3. BPMN 2.0(第五部分)
2010-06-22 19:43 18873.8.12. Task: Script Task(脚 ... -
jBPM Developers Guide(jBPM开发指南)--Chapter 3. BPMN 2.0(第三部分)
2010-06-20 21:47 46513.8.5. Sequence Flow(顺序流) ... -
jBPM Developers Guide(jBPM开发指南)--Chapter 3. BPMN 2.0(第二部分)
2010-06-20 21:29 20653.7. Process root element( ... -
jBPM Developers Guide(jBPM开发指南)--Chapter 3. BPMN 2.0(第一部分)
2010-06-19 09:16 3058前几天看了jBPM4.3版的开发指南,网上也有翻译但是觉得好像 ...
相关推荐
yaoqiang BPMN2.0设计器是一款专为流程图设计打造的工具,主要用于支持Activiti和JBPM等流行的业务流程管理系统。BPMN(Business Process Modeling Notation)是一种国际标准,它为业务流程建模提供了图形化表示,...
jbpm-bpmn2-5.1.0.Final.jar jbpm5
jeecg-jbpm-framework 20130202.zipjeecg-jbpm-framework 20130202.zipjeecg-jbpm-framework 20130202.zipjeecg-jbpm-framework 20130202.zipjeecg-jbpm-framework 20130202.zipjeecg-jbpm-framework 20130202....
jbpm-jpdl-suite-3.2.GA.zip
jbpm-jpdl-suite-3.2.3.zipjbpm-jpdl-suite-3.2.3.zipjbpm-jpdl-suite-3.2.3.zipjbpm-jpdl-suite-3.2.3.zipjbpm-jpdl-suite-3.2.3.zipjbpm-jpdl-suite-3.2.3.zipjbpm-jpdl-suite-3.2.3.zipjbpm-jpdl-suite-3.2.3....
jbpm-flow-builder-5.1.0.Final.jar jbpm5
jbpm-jpdl-designer-site-3.1.7.zip jbpm-jpdl-designer-site-3.1.7.zip jbpm-jpdl-designer-site-3.1.7.zip
【标题】"eclipse配置jBPM(jbpm-test-6.1.0.Final.jar)"涉及的是在Eclipse集成开发环境中配置jBPM(Java Business Process Management)框架的实践教程。jBPM是一个开源的工作流和业务流程管理平台,它允许开发者...
jbpm-jpdl-suite-3.2.GA.zip
jbpm-jpdl-suite-3.2.GA.zip
jbpm-7.3.0.Final-bin是一个包含jBPM框架核心组件的压缩包,jBPM是一个全面的开源业务流程管理系统,专注于提供企业级的流程自动化和管理能力。这个版本是7.3.0.Final,代表了该框架在特定时间点的稳定版本。 jBPM...
BPMN 2.0是业务流程模型与符号的第二版标准,旨在提供一套广泛适用于业务分析、流程设计、实现以及用户管理监控的流程建模符号。它主要被业务用户和建模者使用,通过一套清晰的图形化表示方法,允许业务流程的各个...
jbpm-jpdl-suite-3.2.GA.zip
jbpm-designer作为jBPM的一部分,通过Web界面提供了一个用户友好的BPMN2.0模型创建环境。用户可以利用其拖放式界面,创建、编辑和保存流程图,这些流程图符合BPMN2.0标准,确保了流程图的标准化和可交换性。此外,...
jbpm-persistence-jpa-5.1.0.Final.jar jbpm5
jbpm-6.0.0.Final-installer-full.tar.gz
常用jar包二十几个 bsh-1.3.0.jar commons-dbcp-1.2.1.jar commons-fileupload-1.2.1.jar commons-io-1.3.2.jar commons-logging-1.0.4.jar commons-pool-1.2.jar dom4j-1.6.1.jar freemarker-2.3.13.jar jbpm.sar....
jbpm-flow-5.1.0.Final.jar jbpm5