Oracle神諭

            BlogJava :: 首頁 :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理 ::
            284 隨筆 :: 9 文章 :: 106 評(píng)論 :: 0 Trackbacks

          Assignment(分派)
          A process definition contains can have task nodes. A task-node contains zero or more tasks. Tasks are a static description as part of the process definition. At runtime, tasks result(起源于) in the creation of task instances. A task instance corresponds to(相應(yīng)) one entry in a person's task list.
          tasknodes-->>task-node--->>tasks 

          With jBPM, push and pull model (see below) of task assignment can be applied in combination. The process can calculate(考慮) the responsible for a task and push it in his/her tasklist. Or alternatively(作為選擇), a task can be assigned to a pool of actors, in which case each of the actors in the pool can pull the task and put it in the actor's personal tasklist.  {這里提到了一個(gè)行為池的概念 pool of actors}

          9.3.1. Assignment interfaces
          Assigning task instances is done via the interface AssignmentHandler: {任務(wù)實(shí)例分派是依靠AssignmentHandler來實(shí)現(xiàn)的}

          public interface AssignmentHandler extends Serializable {
            void assign( Assignable assignable, ExecutionContext executionContext );
          }
          An assignment handler implementation is called when a task instance is created. At that time, the task instance can be assigned to one or more actors. The AssignmentHandler implementation should call the Assignable methods (setActorId or setPooledActors) to assign a task. The Assignable is either a TaskInstance or a SwimlaneInstance (=process role).

          Assignable 流程角色:TaskInstance  SwimlaneInstance

          public interface Assignable {
            public void setActorId(String actorId);
            public void setPooledActors(String[] pooledActors);
          }

          Both TaskInstances and SwimlaneInstances can be assigned to a specific user or to a pool of actors. To assign a TaskInstance to a user, call Assignable.setActorId(String actorId). To assign a TaskInstance to a pool of candidate(侯選) actors, call Assignable.setPooledActors(String[] actorIds).

          分配對(duì)象:
          分配給一個(gè)用戶       Assignable.setActorId(String actorId);
          分配給一個(gè)侯選用戶池 Assignable.setPooledActors(String[] actorIds);

          Each task in the process definition can be associated with an assignment handler implementation to perform the assignment at runtime.


          When more then one task in a process should be assigned to the same person or group of actors, consider the usage of a swimlane

          在一個(gè)流程當(dāng)多于一個(gè)任務(wù)時(shí)應(yīng)當(dāng)被分派給一個(gè)用戶或多用戶的組,考慮使用泳道。

          To allow for the creation of reusable AssignmentHandlers, each usage of an AssignmentHandler can be configured in the processdefinition.xml. See Section 13.2, “Delegation(委托)” for more information on how to add configuration to assignment handlers.

          9.3.2. The assignment data model
          The datamodel for managing assignments of task instances and swimlane instances to actors is the following. Each TaskInstance has an actorId and a set of pooled actors.

          The actorId is the responsible for the task, while the set of pooled actors represents a collection of candidates that can become responsible if they would take the task. Both actorId and pooledActors are optional and can also be combined.


          Pull model(拉模式)
          On the other hand, the tasks of pooled tasks for a given user are the tasks for which the given user is referenced in the pooled actors.
          Fetching the list of pooled tasks is typically a two step operation :
          1) get all the groups for the given user from the identity component. and
          2) get the list of all pooled tasks for the combined set of the user's actorId and the actorId's that reference the users' groups.
           Getting the list of pooled tasks that are offered to a given user can be done with the methods TaskMgmtSession.findPooledTaskInstances(String actorId) or TaskMgmtSession.findPooledTaskInstances(List actorIds). These methods will only return task instances for which the actorId is null and one of the given actorIds matches one of the pooled actors.

          TaskMgmtSession.findPooledTaskInstance(String actorId)
          TaskMgmtSession.findPooledTaskInstance(List actorIds)

          To prevent multiple users working on the same pooled task, it is sufficient to update the actorId of the TaskInstance with the user's actorId. After that, the task instance will not appear in the list of pooled tasks, but only in the user's personal task list. Setting the actorId of a taskInstance to null will put the task instance back in the pooled tasks.

          posted on 2005-06-15 11:18 java世界暢談 閱讀(1562) 評(píng)論(0)  編輯  收藏 所屬分類: 工作流
          主站蜘蛛池模板: 出国| 纳雍县| 通化市| 屯门区| 钦州市| 象州县| 丹寨县| 益阳市| 晋江市| 唐海县| 乌兰浩特市| 清水河县| 云和县| 博野县| 巫溪县| 宾阳县| 盘山县| 繁峙县| 潮安县| 杨浦区| 改则县| 伊春市| 枣阳市| 伊通| 青田县| 古丈县| 巫溪县| 两当县| 汽车| 广饶县| 青岛市| 犍为县| 正安县| 横山县| 天祝| 加查县| 茂名市| 三门峡市| 安阳县| 岢岚县| 金塔县|