1 Reply Latest reply on Jul 7, 2006 3:17 AM by Sven Binnewies

    Add Actor to ActorPool

    Sven Binnewies Newbie

      Hi,

      how to add or delete an actor to an already existing actor pool via the jbpm api? I have only found taskInstance.setPooledActors for a group of actors but nothing like taskInstance.addPooledActor() for adding a single actor to an already existing actor pool.

      I also tried the following so far:

      PooledActor pooledActor = new PooledActor(actorId);
      pooledActor.addTaskInstance(taskInstance);
      hibernateSession.save(pooledActor);

      That creates a new actor in the pool, but dosen't assign the pooledActor to the given taskInstance? Any clues? And thanks in advance, as always ;-)

      regards

        • 1. Re: Add Actor to ActorPool
          Sven Binnewies Newbie

          Problem solved! I simply have forgotten to add the pooled actor also to the task instance itself, so that's the correct code:

          [...]
          PooledActor pooledActor = new PooledActor(actorId);
          pooledActor.addTaskInstance(taskInstance);
          hbSession.save(pooledActor);

          pooledActors.add(pooledActor);
          taskInstance.setPooledActors(pooledActors);
          hbSession.save(taskInstance);
          [...]