Discrepancy in WorkListItem.Status

  • 26 September 2007
  • 4 replies
  • 0 views

Badge +9

Hi All,


Please help me out .


I created an activity that has 4 destination users from A to D. Limited the number of slots to 1.


Now , using OpenWorkLIstItem method, I opened the WorkListItem for user A . But when I see the status of WorkListItem for A , I get as "Available". I think the Status should be shown as Open.


The following is the code :


Connection

oK2Connection = new Connection();


Worklist oWorkList;


oK2Connection.Open(

"K2Server", "[;];Authentication=External;User=" A ";Password=");


oWorkList = oK2Connection.OpenWorklist(

"ASP");


foreach

(SourceCode.K2ROM.WorklistItem oWorkListItem in oWorkList)


{


oK2Connection.OpenWorklistItem(oWorkListItem.SerialNumber,

"ASP");


textBox4.Text = oWorkListItem.Status.ToString();  // Here I am geeting the Status as Available.


}


Please guide. 


Thanks  and Regards


4 replies

Badge +4

Hi ,


Please use this overloaded method for Open Work List Item:


 


oK2Connection.OpenWorklistItem(oWorkListItem.SerialNumber, "ASP", true);


oWorkListItem.Update();


/***


Open a Worklist Item based on the Serial number, Platform and Allocated status. If the Alloc parameter is set to True, K2.net 2003 Server will allocate the worklist item to the logged on user making the item unavailable to the other destination users, setting the parameter to False allows you to view the Item without allocating it to the User.


Hope this helps 


***/


 

Badge +11

Try:


oK2Connection.OpenWorklistItem(oWorkListItem.SerialNumber, "ASP", true);


Instead of:


oK2Connection.OpenWorklistItem(oWorkListItem.SerialNumber, "ASP");


 


HTH,


Ockert

Badge +9

Hi All,


Thanks a lot for replying.


Am I right in saying that oK2Connection.OpenWorklistItem(oWorkListItem.SerialNumber, "ASP", true);


is similar to WorkListItem.Open(true);


Also , Can U please clarify what happens to the status of a WorkListItem if I use WorkListItem.Release(); Will the status change from Open to Available for the User who has opened it.


Please guide.


Thanks and Regards.

Badge +11

Yes, the two methods are similar.


When you release a WorklistItem, the Status of all previously 'Allocated' items as well as the specific 'Open' item will change back to 'Available'.  If you had more than one slot defined on the Activity, another user's worklist item (which was previously opened) will stay 'Open'.


Hope this makes sense,


Ockert

Reply