[jboss-user] [JBoss jBPM] - Re: TaskInstance.setActorId(String) causes set TaskInstance

Octomac do-not-reply at jboss.com
Thu Jun 12 18:11:11 EDT 2008


"salaboy21" wrote : 
  | I don't really understand this.. when i mention group(Accounting) is also been read in the database.. I don't know what exactly is your configuration.. but may be you should look in your identity configuration.. I mean.. Are you using the out of the box Identity Component? where is defined User, Groups and Memberships? or Are you using your personal implementation of this?
  | 
  | can you describe your process to assign the users to the tasks in more detail? i want to help you with this.. 

Okay, I'll try to go into as much detail as possible.  I'm using my own implementation of "Groups" and "Users", rather than making use of JBPM's Groups or Swimlanes.  Hopefully we'll be on the same page after this.  I'll try to describe my assignment process, as well as the problems I'm experiencing as thoroughly as I can here.

My ProcessInstance enters a TaskNode.  That TaskNode has a Task object associated with it.  Upon entering the node, a TaskInstance object is automatically created.  In the Properties window on my Process Editor (the Eclipse plugin), I've set the Assignment mode to "Actor" in the dropdown with a value that corresponds with one of my groups.  For example, "Accounting" or "Provisioning".  When the TaskInstance is automatically assigned to this Actor Id.

At this point, I can look in the JBPM Database, querying the JBPM_TASKINSTANCE table and see that the ACTORID column for my newly-created task is what it should be.  That is, the Actor Id for this task is "Accounting," for example.

Now, I open my user interface, which is a JSF application.  The first thing the application does is retrieve two sets of task lists.  The first list is the list of tasks for the current user.  So, if, for example, my login is "Octomac," any open task with an Actor Id of "Octomac" is displayed.  The second list is the list of all "available" tasks; that is, any task with an Actor Id matching the name of the group that the current user is a part of.  So, let's say that my login, "Octomac," is part of the Accounting group.  In that case, every open task with an Actor Id of "Accounting" will be displayed.

So far, so good, and the application works as it should.

Next, the user can click on any of the tasks in the Group list.  This will bring up a screen with details on the task, along with a button which the user can click to transfer ownership of the task from the Group's Actor Id to his own.  So, what should happen is that, when the user clicks on the button, the selected task's Actor Id is changed to the user's ID, and the task should no longer be displayed in the list of Group tasks, having had its ID changed.

This is the point where the problem emerges.  The first thing that I notice is that, even after I've run the code to change the Actor ID from the group's ID to the individual's, the task continues to display in the Group list.  For example, if the user "Octomac" clicks on TaskInstance number 25, the page will refresh, the lists will be rebuilt, but the task will not have moved to the user's list.  It will instead still be in the Group list.

After I observed this for the first time, I opened an SQL query tool and checked the table data found in JBPM_TASKINSTANCE.  I found that the Actor ID for the task had indeed been changed in the database, but JBPM was still displaying the old data; that is, the task was being displayed as though it still had the Group name in the ACTORID column rather than the user's name.

At this point, I re-deployed the web application.  After that, the list of group tasks no longer displayed the newly-reassigned task (which was correct behavior), but it did not display in the User's task list.  I checked the database again with my SQL query tool and found that the task had been marked as canceled.  That is, the boolean columns ISCANCELLED, ISBLOCKING, ISOPEN, ISSUSPENDED, and ISSIGNALING had all been set to "true".  Prior to reassigning the task, only ISOPEN was true, and the rest were false.  Since the function I'm using to build the task list, JbpmContext.getTaskList(userId), only returns Open tasks, the reassigned task will not display in the user's list of tasks; JBPM thinks that it's closed.

I don't believe my problem lies in the way I'm handling assignment, because all I'm really doing, as far as JBPM is concerned, is creating a task, assigning it to one user, and then assigning it to a different user, which I believe JBPM should be able to handle.  I'm only using the ActorId property, rather than Swimlanes or Pooled Actors, because this method is simpler and fills my needs.

I hope that describes my assignment process and problems in sufficient detail.  Thank you for sticking with me on this.  Hopefully, we can find a solution soon!

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4157824#4157824

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4157824



More information about the jboss-user mailing list