807 Redirect Delegate

  • 2 October 2008
  • 4 replies
  • 1 view

Badge +3

Hi,


We have recently upgraded from 803 to the 807 release and may have stumpled across a few issues related to how the redirect and delegate functions operate. Or perhaps we don't fully understand how they should be utilised.


Problem:
We currently have 3 lists available in our application



  • My List - Shows all work list items assigned to me that I am currently working on (opened)
  • Available List - Shows all work list items available to me (available)
  • Allocated - Show all work list items that have been opened by other users (allocated)

We need to enable users to "Redirect" or "Delegate" items in their "Available List" to another user's "My List".


For example:
When user A Redirected a worklist-item to user B, the worklist-item status will change from Available to Allocated for ALL other users and its worklist status will be Open for user B. Hence in our system it will disappear from the Available Task List and appear in the Allocated Task List for ALL other users. For user B the worklist-item will appear in the My Task list.


In the 803 release we utilised Redirect, which seemed to work fine until the 807 release. We have now tried using Delegate but when we implement the following code to enable user A to delegate an item to user B, user B work list shows the delegated work list item as Allocated and user B cannot action the item?


SourceCode.Workflow.Client.WorklistItem wli = connection.OpenWorklistItem([INSERT SERIAL NO]);
SourceCode.Workflow.Client.Destination dest = new SourceCode.Workflow.Client.Destination();
dest.DestinationType = SourceCode.Workflow.Client.DestinationType.User;
dest.Name = "[INSERT USERNAME]";                                       
dest.AllowedActions.Add("[INSERT ACTIONS]");
wli.Delegate(dest);


Can someone explain exactly how Redirect and Delegate now work in the 807 release? 


Thanks for you time!


 


 


4 replies

Badge +8

I believe the way that the item statuses are handled in delegation got changed a bit in 0807. The item is in fact delegated, but it doesn't show up in the default views. If you update your code to not change the status to Open, it will work fine.

 

So, update your code to the following and see if it helps:

SourceCode.Workflow.Client.WorklistItem wli = connection.OpenWorklistItem(txtSN.Text, "ASP", false);

 

Alternatively, you can call the release method after opening the item, either option works:

wli.Release();

 

Side note, I haven't tested this code in 0803, but you need to pass in the provider and user name in 0807. The following is the correct user name value:

wli.Delegate("K2:myDomainMyUser");

Badge +3

Thanks for your response DC, I have been busy investigating this issue and this is what I have found. Your code works perfectly but doesn't give me the desired effect I am after.


I have 2 users: UserA and UserB, I want UserA to delegate a work list item to UserB.


I want UserA to see the task as "Allocated" and UserB to see the task as "Open" after this action occurs


If I utilise the following code running as UserA:


SourceCode.Workflow.Client.

WorklistItem wli = connection.OpenWorklistItem(workListItem.SerialNumber, "asp", false);
SourceCode.Workflow.Client.Destination dest = new SourceCode.Workflow.Client.Destination();
dest.DestinationType = SourceCode.Workflow.Client.DestinationType.User;
dest.Name = UserB;
wli.Delegate(dest);


UserA work list item is Available
UserB work list item is Available 


If I use the following code instead:
SourceCode.Workflow.Client.WorklistItem wli = connection.OpenWorklistItem(workListItem.SerialNumber);


UserA work list item is Open
UserB work list item is Allocated 


In the 803 release, I used to be able to utilise the wli.Redirect(UserB) method to achieve our scenario. In the 807 release it now removes the work list item from UserA and UserB.


I want the Delegate functionality to be able to Open the work list item to the DestinationUser i.e. UserB.


Can this be done? If not then we might need to re-think our workList/role design.

Badge +9
Just to check, how many slots are configured?  Are you creating a slot for each user or 1 slot?  I would think that if you used the "create a slot for each user" option, you could achieve the result you are looking for.
Badge +3

Looks like we were utilising an 803 redirect bug/feature. We will try and implement similar functionality in the 807 release using the "OOF" (Out of Office) or is it the "OoO"? Are there any additional resources relating to OOF besides the K2 blackpearl doco? 


Thanks again!

Reply