nPdl的翻译

 在看NetBPMnPdl文档时做了个翻译,一来是让自己能更好的理解nPdl,二来是希望能得到关心NetBPM的同志的指导。
    由于对工作流不熟悉,所以有不少术语翻译没有把握,先在下面列举一下我对一些单词的翻译,如果有谬误还请高手指教。
    此后对此文档的修改也将直接在此更新。

process过程

business业务

activity活动

invoke调用

join汇聚

fork分支

action操作

transition迁移、变迁

concurrent-block并发块

process-block过程块

decision决策

implementation实现

authorization授权

assigment指派

handler处理者

What is nPdl

什么是nPdl

nPdl is the acronym for 'NetBpm process definition language'. It describes the format for expressing a business process. nPdl specifies the following

  • how the business process logic should be expressed in xml
  • how to express optional web-interface information to let the NetBpm web application generate web-forms for every step of the process
  • how the execution of your .NET-classes can be coupled to the process logic
  • how all the files for one business process are packed together in a archive

So nPdl is more than just an xml-schema. It describes how to express a business process in a process archive including the application integration aspect. The next image shows the basic terminology that is used in nPdl to express a business process.

nPdl是“NetBPM过程(process)定义语言”的首字母缩写。它描述业务过程(business process)的表示格式。nPdl描述了以下几点:

  • xml中该如何表示业务过程逻辑。
  • 如何表示可选的Web接口信息,便于NetBpmWeb应用程序生成每个过程步骤的Web表单。
  • .net类是如何与过程逻辑相联系的。
  • 一个业务过程的相关文件是如何打包到一个文档中的。

因此nPdl不仅仅是一个xml模式。它描述了包含应用程序综合情况(integration aspect)的过程包(process archive)是如何表示业务过程的。下面的图片显示了nPdl用以表示业务过程的基本术语。

Process archives

过程包

A process archive is a zipfile that contains xml-files, .NET assembly and other files. All the information in a process archive specifies one process definition. The assemblies in a process archive are associated with the process definition and are not visible outside that scope. (They are loaded with a process-definition-specific-classloader). Analogue to the classloading mechanism of web-archives and bean-archives.

过程包(process archive)是包含了xml文件、.net程序集和其他文件的zip压缩包。一个过程包里的信息定义一个过程。过程包中的程序集与过程定义相关联并且仅在该范围内可见(它们由过程定义装载类加载)。以及 web档案和二进制档案的加载机制。

Note

注意

If you use dynamic loading of assemblies make sure that DBClassLoader is configured.

如果您使用动态记载程序集,则请确保配置好了DBClassLoader

 

        /root

          |

          +- processdefinition.xml

          |

          +- web

          |   +- webinterface.xml

          |   +- activitydiagram.gif

          |  

          +- lib

              +- MyActions.dll

 

                              

example of a typical layout of a process archive

典型程序包结构

Three names of a process archive are fixed :

  • processdefinition.xml : must be in the root of the process archive and contains the process logic.
  • lib : this folder contains .Net assemblies that are associated with this process definition. (the assemblies will be stored in the NetBpm database)
  • web/webinterface.xml : this file is optional but if you want to add web-form generation to your pages, this must be the name of the file-name.

Process archives are deployed into the NetBpm application through e.g. the NetBpm web-application that uses file-upload, an nant-task or directly the interface of the definition component. The definition component will parse the process archive, store the information in the NetBpm-database and discard the process archive file. After a process has been deployed, users (or systems) are able to perform single activities through the execution component.

过程包中以下三个的名称是固定的:

  • processdefinition.xml必须放在过程包中的根处,并且包含过程逻辑。
  • lib该目录包含与过程定义关联的.net程序集。(该程序集将被保存在NetBpm的数据库中)
  • Web/webinterface.xml:该文件是可选的,如果您希望向您的页面添加Web表单生成功能,那么该文件名必须为该名字。

Note

注意

nant-task is not yet supported

nant-task目前未被支持

See also The NetBpm database

Process logic

过程逻辑

This section explains the schema of the processdefinition.xml. The description of the schema use the type attribute and element.

Element : a element is an XML element

Property : a property is an attribute that can also be supplied as an element. It is possible to write a property as a XML property or a XML element. See the following example.

本小节解释了processdefinition.xml的模式。模式的描述使用属性(attribute)和元素(element)。

元素(Element)就是XML元素。

性质(Property)性质就是可以用元素代替(be supplied as)的属性。可以用性质表示XML性质或XML元素。请见下面的例子。

  ...

  <image>

    <name>myimagefile.gif</name>

    <mime-type>image/gif</mime-type>

    <width>345</width>

    <height>53</height>

  </image>

  ...

 

  can also be expressed as

 

  ...

  <image name="myimagefile.gif" mime-type="image/gif" width="345" height="53" />

  ...

 

  or a combination of both notations.

                                     

properties can be supplied as attributes or as child-elements

性质能代替(be supplied as)属性和子元素

Process definition

过程定义

The process-definition is the document root tag. A process-definition contains the process logic for one business process. Only one process-definition is allowed in a processdefinition.xml.

过程定义是文档的根标签。一个过程定义包含了业务过程的过程逻辑。processdefinition.xml文件只允许包含一个过程定义。

name

multiplicity

type

description

name

1

property

is the name of the process definition. Note that this name is also used in the versioning mechanism

过程定义的名字。该名字同时在版本控制机制中被用到。

description

0-1

property

general purpose description of the business process

业务过程的一般描述。

responsible

0-1

property

is the user responsible for this process

负责该过程的用户

authorization

0-1

element

allows to specify a custom authorization implementation that can validate every action that is done through the execution or the admin components. see authorization

允许指定自定义授权实现,该实现可以在执行(execution)或管理(admin)组件(components)中验证每个过程动作。

start-state

1

element

the unique start state of the process. see start-state

每个过程中唯一的起始状态。

end-state

1

element

the unique end state of the process. see end-state

每个过程中唯一的结束状态。

attribute

0-n

element

the attribute defined here result in attribute instances created for the root-flow. see attribute

此处定义的属性将为root-flow创建属性实例。

activity-state

0-n

element

define the wait states where the process will have to wait on input or a trigger from human users or systems external to NetBpm. see activity-state

定义等待状态,该状态需要过程等待用户或外部系统的输入或触发。

process-state

0-n

element

defines a state in the process that corresponds with the complete execution of another process. see process-state

定义过程状态,该状态表示一个需要完成执行的其他过程。

decision

0-n

element

defines a choice between multiple paths of execution. see decision

定义一个多个执行路径中的选择。

concurrent-block

0-n

element

defines a block with a fork, join and everything in between. Note that transitions cannot cross concurrent-block boundaries. see concurrent-block

定义分支、连接以及两者之间的所有内容的组合块。注意,迁移不能穿过并发块的边界。

action

0-n

element

defines an action relative to the process-definition. The valid event-types for process-definition-actions are process-instance-start, process-instance-end and process-instance-cancel. see action

定义与过程定义相关的操作。有效的过程定义操作事件类型有:过程实例开始、过程实例结束、过程实例取消。

Start-state

起始状态

The start-state defines the starting point for the process definition. All process instances will start in the start-state. The rules for leaving transitions and attributeValues input for start-states are the same as for standard activity-states. For that explanation, please refer to Performing an activity. Note that it is not allowed for transitions to arrive in the start-state.

起始状态定义了过程定义的起始点。所有过程实例都要从起始状态开始。从起始状态迁移的离开规则和属性值的输入规则与标准活动状态相同。详细解释请参看执行活动。注意,起始状态是不可进入的。

name

multiplicity

type

description

name

1

property

is the name of the start-state

起始状态的名称。

description

0-1

property

general purpose description of the start-state

起始状态的一般描述。

role

0-1

property

see Activity assignment

field

0-n

element

can be used to restrict access to an attribute or make the input of an attribute-value required. see field

可以用来限制属性的存取或要求属性值。

action

0-n

element

defines an action relative to the activity-state. The valid event-types for start-state-actions are before-perform-of-activity and after-perform-of-activity. To schedule an action after the attributeValues are set and before the processing of the transitions, you have to put an action in the process-definition with event-type process-instance-start see action

定义与活动状态相关的动作。起始状态动作可用的事件类型有:活动执行前和活动执行后。要计划在设置属性值之后且在迁移处理之前执行一个动作,就必须在流程定义中放置一个事件类型为过程实例启动的动作。

transition

1-n

element

are the transitions leaving this node. see transition

离开该节点的迁移。

End-state

结束状态

Defines the end-state of this process definition. A process-definition would have an end-state.

定义过程定义的结束状态。每个过程定义应该包含一个结束状态。

name

multiplicity

type

description

name

1

property

is the name of the end-state

结束状态的名称。

Activity-state

活动状态

An activity-state is a state in the process where you wait for an external party (human user or system). An activity-state specifies that the 'thread-of-execution' is outside the scope of the process engine. All actions that should be executed by the process engine in the context of a process instance should be modelled as actions

活动状态是在过程中等待外部参与的一种状态(人工或系统)。一个活动状态指定了在过程引擎范围之外的“执行线索”。所有由过程引擎在过程实例上下文中执行的活动应当符合活动模型。

name

multiplicity

type

description

name

1

property

is the name of the activity-state

活动状态的名称

description

0-1

property

general purpose description of the activity-state

活动状态的一般描述

assignment

0-1

element

see Activity assignment

role

0-1

property

see Activity assignment

field

0-n

element

can be used to restrict access to an attribute or make the input of an attribute-value required. see field

用以限制属性的存取或属性值输入的要求

action

0-n

element

defines an action relative to the activity-state. The valid event-types for activity-state-actions are before-perform-of-activity (which is before the attributeValues are stored in the attribute instances), perform-of-activityafter-perform-of-activity (which is after the engine has processed all transitions), before-activitystate-assignment, and after-activitystate-assignment. see action

定义与活动状态对应的动作。活动状态动作的有效事件类型是活动执行前(在属性值写入到属性实例之前)、活动执行、活动执行后(在引擎处理了所有迁移之后),活动状态指派前,以及活动状态指派后。

transition

1-n

element

are the transitions leaving this node. see transition

离开此节点的迁移。

Activity assignment

活动指派

If you're not familiar with the organisation component read The organisation component.

To assign an activity-state to an actor, the process developer has 2 mechanisms

如果您对组织组件不熟,请参见组织组件。

为执行者指派活动状态,过程开发者有两个方法:

  1. AssignmentHandler : an AssignmentHandleris an interface with one method. When the execution arrives in an activity, first is checked if that activity-state has an AssignmentHandler.

               public interface IAssignmentHandler

               {

                       String SelectActor(IAssignmentContext assignerContext);

               }

                                             


The AssignmentHandler interface If it does, the specified class is instantiated and the method is called. The implementation must then return the ID of the Actor that must be assigned to the activity. see the delegation principle

  1. role : if an activity-state does not have an AssignmentHandler, it must have a role specified. The value of a role for an activity must be the name of an attribute. As a consequence, you must declare an attribute of type 'actor' for the role. A role corresponds with a swimlane in the UML activity diagram. If both an AssignmentHandler and a role are specified, the AssignmentHandler will be used to select the actor and that actor is also stored in the attribute instance. If only a role is specified and no AssignmentHandler, the activity-state is assigned to the actor in the attribute instance specified by the role. Note that in the latter case the attribute instance may not contain a null-value.
  1. 指派处理者:指派处理者是具有一个方法的接口。当执行到达一个活动时,首先检查活动状态是否有指派处理者。 如果实现了活动处理者接口,将实例化指定的类并且调用方法。该实现需返回必须指派给活动的执行者的ID。参见委托规则。
  2. 角色:如果一个活动状态没有指派处理者,必须为它指定一个角色。活动的角色值必须是属性的名字,因此必须为角色声明一个类型为‘执行者(actor)’的属性。角色对应了UML活动图中的swimlane。如果同时指定指派处理者和角色,指派处理者用来选择执行者,而执该行者被存储在属性实例中。如果仅指定角色(不指定指派处理者),属性实例中的活动状态将被指派到由角色指定的执行者。值得注意的是随后的容器(case属性实例不能包含空值。

Process-state

过程状态

Specifies one process-state in the UML-activity-diagram. A process-state is a state in the process which corresponds to the execution of a another process-instance. We say that the parent process invokes a sub-process. When execution arrives in such a state, the sub- process will be started. The termination of the sub-process-instance triggers the parent process to regard the process-state as completed and continue execution.

指定在UML活动图中的一个过程状态。活动状态是指在这样一种过程中的状态,该状态对应了另一个过程实例的执行。我们也称之为父过程调用一个子过程。当执行到该状态,子过程将启动。当子过程实例结束时触发父过程完成该过程状态并继续执行。

name

multiplicity

type

description

name

1

property

The name of the process-state.

过程状态的名字

description

0-1

property

general purpose description of the process-state

过程状态的一般描述。

process

1

property

The name of sub-process. Note that the latest version of the sub-process will be associated during deployment. If later new versions of the sub-process will be deployed, this will have no impact on the process-invocation.

子过程的名称。注意,子过程的最新版本仅在部署时关联。如果之后有新的子过程被部署,在过程调用的时候新的子过程将无效。

actor-expression

1

property

specifies the actor that is used to start the sub-process-instance

指定启动子过程实例的执行者。

process-invocation

1

element

see process-invocation element for details

细节元素。

action

0-n

element

defines an action relative to the process-state. The valid event-types for process-state-actions are sub-process-

instance-start

process-instance-

start. see action

定义与过程状态相关的动作。有效的过程状态动作的事件类型有:子过程实例启动,过程实例启动。

transition

1-n

element

are the transitions leaving this node. see transition

迁移是否离开此节点。

Attribute

Defines the attributes used in this process definition.

定义在此过程定义中用到的属性。

name

multiplicity

type

description

name

1

property

is the name of the attribute

属性的名称。

description

0-1

property

general purpose description of the attribute

属性的一般描述。

initial-value

0-1

property

the initial value for the attribute in serialized format.

属性的初时值,使用序列化的格式。

serializer

1

property

For storing attribute .NET-objects into the database, they have to be serialized to text. This property specifies how the attribute .NET-objects get serialized. This must be a fully qualified .NET class name. Customised implementation must implement NetBpm.Workflow.Delegation.ISerializer

为了把.net对象存储到数据库,它们必须序列化成文本。该属性指定了属性这一.net对象是如何序列化的。它必须是合格的(qualified.net类名。自定义实现必须实现NetBpm.Workflow.Delegation.ISerializer接口。

type

1

property

The type attribute values are in fact short names for predefined serializers. There are several 'built-in' types in NetBpm:

  • type="actor" for 'NetBpm.Workflow.Delegation.Impl.Serializer.ActorSerializer'
  • type="text" for 'NetBpm.Workflow.Delegation.Impl.Serializer.TextSerializer'
  • type="long" for 'NetBpm.Workflow.Delegation.Impl.Serializer.LongSerializer'
  • type="float" for 'NetBpm.Workflow.Delegation.Impl.Serializer.FloatSerializer'
  • type="date" for 'NetBpm.Workflow.Delegation.Impl.Serializer.DateSerializer'
  • type="evaluation" for 'NetBpm.Workflow.Delegation.Impl.Serializer.EvaluationSerializer'

If the 'serializer' property has been specified, 'type' must not be specified and vice versa.

属性类型的值实际上是预定义的序列化器(serializers)的短名字。在NetBpm中有几个内置的类型:

...

如果指定了序列化器(serializers)属性,则不能指定类型并且vice versa

parameter

0-n

element

see parameter for details

Decision

决策

A decision selects one of multiple possible execution paths. To make a decision when an activity is being performed, the process modeller has 2 options :

  1. Leave the choice to the client. This is a situation where multiple transitions leave an activity. This means that the client has to supply the selected transition name in the PerformActivity(...) method.
  2. Let the engine decide automatically : In this case one transition leaves an activity and arrives in a decision-node. The decision will automatically (based upon the attributes and all desired external resources) make a decision about which leaving transition to take.

Both approaches can be combined.

决策(decision)从多个执行路径中选择一个执行。当活动执行需要决策时,过程模型有两种模式:

  1. 由客户端做出选择。这是当离开活动时出现多个迁移的情况。此时客户端应当在PerformActivity方法中提供所选迁移的名称。
  2. 由引擎自动选择。在这种情况下将自动决策选择哪个迁移,做选择的依据时属性和需要的外部资源。

name

multiplicity

type

description

name

1

property

The name of the decision.

决策的名字。

handler

1

property

Implementation of DecisionHandler to decide which path (transition) to take

决定选择路径的实现决策处理者。

parameter

0-n

element

see parameter for details

细节的参数。

transition

1-n

element

are the transitions leaving this node. see transition

离开此节点的迁移。

Process block

过程块

The common parts of a concurrent-block and a process-definition is a process-block. I'll explain the concurrent block : In process languages you have the block-structured approach (e.g. BPML) and the graph based approach (e.g. XPDL). NetBpm combines best of both worlds. Where possible, NetBpm allows graph-based approach (free transitions between nodes). This gets problematic when forking and joining therefor a fork always is associated with a join and those two define a concurrent block. No transitions can cross the concurrent block boundary. Concurrent blocks can be nested. Another communality of process definitions and concurrent blocks is the fact that they can define attributes : Attributes, defined in a process definitions are instantiated at process-instance-creation-time and attributes that are defined in a process block are instantiated for each flow that is forked at the beginning of the block.

过程块(process-block)是并行块和过程定义共有的路径。并行块在过程语言中有块结构的途径(approach)(如BPML)和图形化的途径(如XPDL)。NetBpm结合了两种情况的优点。如果可能NetBpm允许基于图形的演进(在节点间自由迁移)。当分支和汇聚的时候会出现一些问题,因此一个分支总是需要与一个汇聚关联,两者共同定义一个并行块。迁移不能穿越并行块边界。并行块能嵌套。过程定义和并行块的另外一个共同点是他们能定义属性。在过程定义中定义的属性在过程实例创建的时候被实例化了,在过程块中定义的属性是在块开始时就为每个分支的属性实例化。

Concurrent block

并行块

A concurrent-block exists of a fork, a join and all process elements that are defined in this concurrent-block. Note that transitions cannot cross concurrent-block boundaries except for transitions to the fork and transitions leaving the join. A concurrent block can also declare flow-local attributes.

并行块由定义在其中的分支、汇聚以及所有流程元素组成。迁移不能穿越并行块边界,除非迁移到分支或离开汇聚。并行块同时能声明本地流(flow-local属性。

name

multiplicity

type

description

fork

1

element

is the fork of the concurrent block

并行块的分支。

join

1

element

is the join of the concurrent block

并行块的汇聚

attribute

0-n

element

specifies a flow-local attribute

指定流的本地属性

activity-state

0-n

element

see activity-state for details

process-state

0-n

element

see process-state for details

decision

0-n

element

see decision for details

concurrent-block

0-n

element

concurrent-blocks can be nested recursively

并行块的递归嵌套。

action

0-n

element

see action for details

Fork

分支

  • Standard behaviour
    • describe what the standard behaviour is
    • standard behaviour does not require specification of a ForkHandler or JoinHandler
  • A ForkHandler can start flows for leaving transitions. Note that more than one flow can be started for the same transition.
  • Synchronization of flows :
  • 标准行为:
    • 描述什么是标准行为。
    • 标准行为不需要指定分支处理者或者汇聚处理者。
  • 一个分支处理者能够启动流来离开迁移。注意,能够为同一个迁移启动多个流。
  • 流的同步。

name

multiplicity

type

description

name

1

property

the name of this fork

分支的名称

transition

1-n

element

the multiple path of executions. Should be name of node

多路径的执行。应该是结点的名称

handler

0-1

property

Implementation of ForkHandler. Defines how the transitions should be forked. If not defined, each transition is forked sequentially

实现的分支处理者(ForkHandler)。定义迁移该如何分支。如果没有定义,每个迁移将串行的分支

parameter

0-n

element

see parameter for details

Join

汇聚

A join is used to synchronize multiple paths of execution that were created at the a fork.

汇聚(join)同步由分支(fork)产生的多个路径的执行。

name

multiplicity

type

description

name

1

property

the name of this fork

分支的名称

action

0-n

element

see action for details

transition

1-n

element

see transition for details

handler

0-1

property

Implementation of JoinHandler. Defines when parent-flow should be activated. If not defined, parent-flow will be activated when all flows arrives.

汇聚处理者的实现。定义何时父流(parent-flow)需要激活。如果没有定义,父流将在所有流到达时激活。

parameter

0-n

element

see parameter for details

Transition

转移

specifies one transition in the UML-activity-diagram. To understand the restrictions of transitions, first a word about process blocks. A process block is a scope for attributes and nodes. A process-definition is process block. A concurrent-block is also a process block. Transitions may not cross process block boundaries. This means that all forked execution-paths (= flows) that are forked at a fork, have to be joined in the join of the same concurrent block.

UML活动图中指定一个迁移。要理解活动的约束,首先要理解过程块。过程块是一些属性和节点的集合。过程定义也是一个过程块。并行块也是一个过程块。迁移不能穿越过程块的边界。这意味着所有的分支执行路径(即流)需要在同一个并行块的汇聚(join)中合并到一起。

name

multiplicity

type

description

name

1

property

the name of the transition.

转移的名称。

to

1

property

the name of the destination element of the transition. Can be an activity-state, a process-state, a decision, a fork or a join. (Should be name of Node in same process block)

迁移的目标元素名称。可以是一个活动状态(activity-state),过程状态(process-state)、决策(decision)、分支(fork)或汇聚join)。应该与对应的过程块同名。

action

0-n

element

see action for details

Action

动作

An action is a piece of software that has to be executed by the process-engine within the context of a process execution. So actions are executed within the 'thread-of-execution' of the process engine. Examples of usages are e.g. sending an email, updating a database, getting some info from an SAP-system, ... The handler specifies a .NET-class that implements the NetBpm.Workflow.Delegation.IActionHandler interface. An action element also specifies when the action has to be esxecuted. The timing is determined by two factors : 1) the surrounding process element and 2) the event-type which specifies an event relative to the surrounding process element. Let's illustrate with an example

一个动作是由过程引擎在过程执行上下文中执行的软件的一部分。因此动作是在过程引擎的执行线程(thread-of-execution)中被执行的。如发送email,更新数据库,从SAP系统获取信息,...使用处理者指定实现了NetBpm.Workflow.Delegation.IActionHandler接口的.net类。动作元素定义了何时该动作被执行。时间由两个因素决定:1)周围的过程元素2)与周围过程元素相关的事件的类型。下面是一个演示:

  ...

  <decision handler="Yourproject.Decisions.HasBigSalary">

    <action event="before-decision" handler="Yourproject.Actions.GetInfoFromSAP" />

  </decision>

  ...

                                     

specification of an action before a decision is made

在决策确定之前指定一个动作

name

multiplicity

type

description

event

1

property

 

handler

1

property

 

parameter

0-n

element

see parameter for details

on-exception

0-1

attribute

 

Authorization

授权

The runtime model

运行时模型

Note that UML does not specify a runtime-model for activity diagrams. Since NetBpm is just a run-time executor of activity diagrams, we will need to clarify certain aspects of the activity-diagram modelling.

值得一提的是UML没有指定活动图(activity diagrams)的运行模型(runtime-model)。而NetBpm只是一个活动图运行时的执行器,我们需要阐明活动图模型的一些特征(aspects)。

Performing an activity

实现活动

  1. leaving transition versus multiple leaving transitions
  2. performing an activity is a trigger
  3. while performing an activity, you can feed attributeValues into the process.
  1. 一个离开迁移与多个离开迁移。
  2. 实现活动是一个触发。
  3. 在实现活动时,可以向过程写入属性值。

Delegation

委托

Transactions

迁移

Security

安全

Schema

The process archive format

过程包格式

The processdefinition.xml schema

The webinterface.xml schema

Definition model class diagram

定义模型类图

The process definition class diagram

过程定义类图

Graph-oriented versus block-structured

面向图形与结构块化

 

posted @ 2007-05-13 09:55  badwood  阅读(3226)  评论(5编辑  收藏  举报
Badwood's Blog