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世界暢談 閱讀(1567) 評(píng)論(0)  編輯  收藏 所屬分類: 工作流
          主站蜘蛛池模板: 芜湖市| 平凉市| 长白| 南岸区| 工布江达县| 三河市| 沙田区| 万山特区| 浮梁县| 张掖市| 东丽区| 宣武区| 泰宁县| 绥阳县| 塔城市| 仁布县| 仲巴县| 柳江县| 南乐县| 双鸭山市| 余姚市| 承德市| 涿鹿县| 马龙县| 黑山县| 景谷| 三亚市| 平阳县| 旬邑县| 明水县| 林州市| 左云县| 临海市| 陆川县| 盐池县| 新干县| 高安市| 蒙阴县| 江津市| 措勤县| 鹤峰县|