Dear all,
Â
i have problem with K2 out of office
i want to share some people worklist to other people at some period of time
then i watch about out office system with code like this
Â
Normal
0
false
false
false
IN
X-NONE
X-NONE
MicrosoftInternetExplorer4
Connection connection = new
Connection();
Â
          Â
ConnectionSetup connectionsetup = new ConnectionSetup();
Â
          Â
connectionsetup.ConnectionParameterss"Authenticate"]
= "true";
Â
          Â
connectionsetup.ConnectionParameters/"Host"]
= Environment.MachineName;
Â
          Â
connectionsetup.ConnectionParametersÂ"Integrated"]
= "true";
Â
          Â
connectionsetup.ConnectionParametersÂ"IsPrimaryLogin"]
= "true";
Â
          Â
connectionsetup.ConnectionParameters>"Password"]
= "{YourPassword}";
Â
          Â
connectionsetup.ConnectionParametersa"Port"]
= "5252";
Â
          Â
connectionsetup.ConnectionParametersn"SecurityLabelName"]
= "K2";
Â
          Â
connectionsetup.ConnectionParameterss"UserID"]
= "{YourUser}";
Â
          Â
connectionsetup.ConnectionParametersp"WindowsDomain"]
= "{YourDomain}";
Â
          Â
connection.Open(connectionsetup);
Â
Â
          Â
// ALL Work that remains which does not form part of
any 'WorkTypeException' Filter
          Â
WorklistCriteria worklistcriteria = new WorklistCriteria();
          Â
worklistcriteria.Platform = "ASP";
Â
          Â
// Send ALL Work based on the above Filter to the
following User
          Â
Destinations worktypedestinations = new Destinations();
          Â
worktypedestinations.Add(new Destination(@"K2:DOMAINUser",
DestinationType.User));
Â
          Â
// Link the filters and destinations to the Work
          Â
WorkType worktype = new
WorkType("MyWork",
worklistcriteria, worktypedestinations);
Â
          Â
// ALL Work that remains which does not form part of
any 'WorkType' Filter
          Â
WorklistCriteria worklistexceptioncriteria =
new WorklistCriteria();
          Â
worklistexceptioncriteria.Platform = "ASP";
          Â
worklistexceptioncriteria.AddFilterField(WCField.ProcessName,
WCCompare.Equal, "MyExceptionProcess");
Â
          Â
// Send ALL Work based on the above Filter to the
following User
      Â
    Destinations
worktypeexceptiondestinations = new Destinations();
          Â
worktypedestinations.Add(new Destination(@"K2:DOMAINExceptionUser",
DestinationType.User));
Â
          Â
// Link the filters and destinations to the Exception
Work
          Â
WorkTypeException worktypeexception = new WorkTypeException("MyWorkException",
worklistexceptioncriteria, worktypeexceptiondestinations);
Â
          Â
worktype.WorkTypeExceptions.Add(worktypeexception);
Â
          Â
WorklistShare worklistshare = new WorklistShare();
Â
          Â
worklistshare.ShareType = ShareType.OOF;
Â
          Â
// Sharing dates as per the sample indicates that
work will always be shared as long as the correct status is set
          Â
// These dates may also be used to only share work
for a specific period
          Â
worklistshare.StartDate = DateTime.MinValue;
          Â
worklistshare.EndDate = DateTime.MinValue;
Â
          Â
worklistshare.WorkTypes.Add(worktype);
Â
          Â
// K2Server will create the user's Worklist Sharing,
but no sharing will take place unless the Status of the Share is updated
          Â
connection.ShareWorkList(@"K2:DOMAINSharer",
worklistshare);
Â
          Â
// Once this status is updated, each time a user,
which the sharing user is sharing any work with opens their Worklist, K2Server
will combine the Worklist(s) based on the opening user(s) Worklist Filters
          Â
connection.SetUserStatus(@"K2:DOMAINSharer",
UserStatuses.OOF);
Â
Â
          Â
connection.Close();
Â
Â
but then i got an error message like this
"the user does not appear to be managed by the connection user"
when call this method
connection.ShareWorkList(@"K2:DOMAINSharer",
worklistshare);
Â
is there someone can help me?
btw i'm using K2 BP 4.5 kb 1370