Skip to main content

hi


Can a amanger control the out of office for a certain employee?

This Feature should be out of the box in k2 black pearl.


If not; some API's in the k2 must be there to handle this.


if not then tell me what!!!


As long as a manager is defined in the Active Directory then the manager can set their direct reports Out of Office directly in the K2 Workspace.  If the user accounts are not configured in AD with the manager and direct reports properties then a workflow administrator can also set user's OOF in the workspace.


Take a look at the following in the BlackPearl online help.



K2 Workspace > K2 Home > Configuration > Out of Office


 There are K2 APIs that can also be used to set OOF.  An example can be found at:



Users > Out of Office Status > How to set a users Out of Office Status


 


I hope this helps.


Tim


Many thanks Mr Tim


The answer to the first question was


"


A user with Administrative rights can access the K2 Out of Office configuration screen from the K2 Management Console > K2 Workflow Server > Users > Out of Office


"


------------------------ and the answer top the second question was---------------


"


Setting a user's Out of Office status via the API may be required in custom automation code or in other custom code based solutions that interact with user worklists.


The following code demonstrates the Worklist Share and Exceptions capabilities of the API. This sample requires a reference to either the SourceCode.Workflow.Client assembly or to the SourceCode.Workflow.Management.Client assembly.



Copy Code

// set


WorklistShare worklistShare = new WorklistShare();


worklistShare.ShareType = K2M.ShareType.OOF;


worklistShare.StartDate = DateTime.MinValue;


worklistShare.EndDate = DateTime.MinValue;


WorkType workType = new WorkType("MyOOFWorkType");


workType.WorklistCriteria.Platform = "ASP";


workType.Destinations.Add(new Destination(@"K2:K2WORKFLOWuser1", DestinationType.User));


WorkTypeException workTypeException = new WorkTypeException("MyOOFWorkTypeException");


workTypeException.WorklistCriteria.Platform = "ASP";


workTypeException.WorklistCriteria.AddFilterField(WCLogical.And, WCField.ProcessFullName, WCCompare.Equal, @"K2OOFK2OOFProcess");


workTypeException.WorklistCriteria.AddFilterField(WCLogical.And, WCField.ActivityName, WCCompare.Equal, "Activity");


workTypeException.Destinations.Add(new Destination(@"K2:K2WORKFLOWExceptionUser", DestinationType.User));


workType.WorkTypeExceptions.Add(workTypeException);


worklistShare.WorkTypes.Add(workType);


workflowManagementServer.ShareWorkList(@"K2:K2WORKFLOWMe", worklistShare);


workflowManagementServer.SetUserStatus(@"K2:K2WORKFLOWMe", UserStatusses.OOF);


 


// get


WorklistShares worklistShares = workflowManagementServer.GetCurrentSharingSettings(@"K2:K2WORKFLOWMe", ShareType.OOF);


 



Note: The API exposes StartDate and EndDate fields that are not currently supported in the Out of Office K2 Workspace User Interface. A custom Out of Office management interface would therefore need to be implemented to expose these fields if they are used.

The Out of Office status check box in K2 Workspace will reflect the user's status, regardless of the OOF Start or End dates. Therefore if the Start and End dates have been programmatically set and the user's status has been set to OOF, the K2 Workspace check box will show a check mark before, during, and after the Start and End dates. The workflowManagementServer.SetUserStatus(@"K2:K2WORKFLOWMe", UserStatusses.OOF); will need to be reset to workflowManagementServer.SetUserStatus(@"K2:K2WORKFLOWMe", UserStatusses.Active); in order for the K2 Workspace OOF check box to become unchecked. Alternatively, uncheck the OOF check box in K2 Workspace once the End date has been reached.  This will be synchronized in a future release of K2 blackpearl.


See Also



 


"


Reply