1 Reply Latest reply on Oct 4, 2007 11:37 AM by marc blachon

    Tasks module, an initial development

    mvaldes Novice

      Hi guys,

      I've just commited a first development on tasks in the Bonita XPDL extension.

      The intention is to show the Bonita requirements in terms of human task and get a first overview of potential issues to make this module as independent as possible of the PVM (not easy imo).

      Entities included in this implementation are (under "task" directory):

      - Role.java: a roles is a logical group for users. Roles are assigned to a particular process and so one or more activities in a process can have this role. Role is implemented as a ProcessElement and leverages events (roleMapperEvent: users-roles assignments)

      - Task.java: a task represents an activity that must be performed by one/multiple users. Task is implemented as a NodeBehaviour. A Task can be assigned to 1 role at a time.

      - TaskRuntime.java: a runtime representation of a task. TaskRuntime is create when the execute method is called in a Task. Current implementation first resolve the role-user mapping (roleMapper concept). The result of this evaluation is a collection of candidates (users potentially responsible of this activity).

      A second resolution is possible thanks to PerformerAssignments entities. Performer assigments are responsible to retrieve one user from the candidates.

      At the end of the role-user resolution this taskRuntime is stored into the database (TaskRepository)

      - PerformerAssign.java and RoleMapper.java: those classes implements Action and adding setCandidates and setActorId methods respectively. Those methods must be called at the end of a custome peformerAssign and roleMapper implementations to store returns values in the TaskRuntime objet (for that ExecutionScopes are used)

      A unit test has also been added to show a process definition using tasks as well as task execution (BasicTasksTest.java).
      This unit test is adding a default implementation of the TaskRespository interface allowing to store and retrieving tasks (by leveraging the Execution Environment)

      start and terminate methods has been added to TaskRuntime class to handle tasks execution (initial, ready, executing and terminated states were also added).

      Oscar, I think this will be useful for you as an starting work for human tasks...

      regards,
      Miguel Valdes