ys_chang
Novice

about 0807 Out of Office feature

Hi,


    I try to use the api to implement  deputy feature by OOF.


    deputy how to get the worklist ? and the owner has Notification Mail will deupty can receive it ?


    Is OOF feature is use Delegate ?


   tkx

0 Kudos
Reply
8 Replies
johnny
Apprentice

Re: about 0807 Out of Office feature

Hi Chang, 


You can check out the new articles in the K2 SDK on the API access with the OOF feature.


 It's under the heading:


Processes > Accessing > How to Open a Worklist when Out of Office is Activated


As for the other questions.


The delegate will see the delegated workitems in his default worklist (e.g. Workspace).


Notification Emails will not be forwarded unless the person delegating creates a forward rule in Outlook.


And yes, OOF is using the delegate feature.

0 Kudos
Reply
ys_chang
Novice

Re: about 0807 Out of Office feature

Hi Johnny,


Setup OOF use api. And in the workspace the Deputy man can see the shared worklist.


But we custom the workspace. Use API to get the worklist, i can't find it to show the worklist about shared worklist.


Can you expalin it ?


And we must custom code or setup to notify the deputy man like mail event  to tell them has new worklist?


tkx

0 Kudos
Reply
johnny
Apprentice

Re: about 0807 Out of Office feature

The worklist code to handle OOF is slightly different when opening the worklist as you need to add criteria to check if the owner is yourself or other.  Here is a short sample.


.... 


            WorklistCriteria criteria = new WorklistCriteria();
            criteria.Platform = "ASP";
            criteria.AddFilterField(WCLogical.Or, WCField.WorklistItemOwner, "Me", WCCompare.Equal, WCWorklistItemOwner.Me); //This will return all the user’s items
            criteria.AddFilterField(WCLogical.Or, WCField.WorklistItemOwner, "Other", WCCompare.Equal, WCWorklistItemOwner.Other); //This will return all the user’s shared items
            Worklist wl = k2con.OpenWorklist(criteria);


            foreach (WorklistItem wi in wl)
            {
                ... // list of workitems
            }
        } 


...

0 Kudos
Reply
ys_chang
Novice

Re: about 0807 Out of Office feature

Johnny,


Thank you very much.


I try SourceCode.Workflow.Management api can't show the worklistshare. But use the SourceCode.Workflow.Client can show the worklistshare.


But I still have a question is how can the Deputys to approve new process when the activity is on ?


When the Activity choiced the notificaiton mail or Mail Event to notify the destination user ? Is the Shared Worklist will do the same Event to deputy users?


And find another error is :


            Dim wlc As SourceCode.Workflow.Client.WorklistCriteria = New SourceCode.Workflow.Client.WorklistCriteria()
            wlc.NoData = True
            wlc.Platform = "ASP"
            wlc.AddFilterField(SourceCode.Workflow.Client.WCLogical.Or, SourceCode.Workflow.Client.WCField.WorklistItemOwner, "Me", SourceCode.Workflow.Client.WCCompare.Equal, SourceCode.Workflow.Client.WCWorklistItemOwner.Me)
            wlc.AddFilterField(SourceCode.Workflow.Client.WCLogical.Or, SourceCode.Workflow.Client.WCField.WorklistItemOwner, "Other", SourceCode.Workflow.Client.WCCompare.Equal, SourceCode.Workflow.Client.WCWorklistItemOwner.Other)
            Dim wkList As SourceCode.Workflow.Client.Worklist = conn.OpenWorklist(wlc)


          item.ProcessInstance.DataFields("FormNo").Value()  ' The New way can't Find DataField.


            'Dim wkList As SourceCode.Workflow.Client.Worklist = conn.OpenWorklist("ASP") : The old way is work correct. 


Tkx.

0 Kudos
Reply
johnny
Apprentice

Re: about 0807 Out of Office feature

Ok this is a bit to reply too but I'll give it a go.



  1. You can't see the shared worklist from the management APIs because the feature is not available.  The behaviour is the same as the workspace management console.

  2. Code to access the workitem is in the K2 SDK as I mentioned earlier.  See K2 SDK documentation Processes > Accessing > How to Open a Worklist when Out of Office is Activated.  See function code WorklistItem RetrieveItem(Connection conn).  I am not too sure what you are trying to do with the code above as the syntax is wrong.  You are accessing a workitem object without referencing the object collection in the worklist object.

  3. Notifications only affect the destination user and not the delegate.  You might want to submit a feature request if you think this is important enough.

If you are still facing a lot of difficulties in getting this to work, I would suggest you contact your local K2 rep and see if you can perhaps engage a K2 consultant for maybe a day or so to resolve all these issues quickly.

0 Kudos
Reply
ys_chang
Novice

Re: about 0807 Out of Office feature

Hi Johnny,


     Use the api to get the worklistitem.


     To get the Approve URL by wi.Data , the url are not add the &SharedUser=xxx ? or use another method


     3 Q ...


 


           WorklistCriteria criteria = new WorklistCriteria();
            criteria.Platform = "ASP";
            criteria.AddFilterField(WCLogical.Or, WCField.WorklistItemOwner, "Me", WCCompare.Equal, WCWorklistItemOwner.Me); //This will return all the user’s items
            criteria.AddFilterField(WCLogical.Or, WCField.WorklistItemOwner, "Other", WCCompare.Equal, WCWorklistItemOwner.Other); //This will return all the user’s shared items
            Worklist wl = k2con.OpenWorklist(criteria);


            foreach (WorklistItem wi in wl)
            {
                ... // list of workitems
            }

0 Kudos
Reply
paddy
Novice

Re: about 0807 Out of Office feature

You can modify it into like this  


Ex. ApproveURL = String.Format("{0}&SharedUser={1}", item.Data, item.AllocatedUser)

0 Kudos
Reply
johnny
Apprentice

Re: about 0807 Out of Office feature

Just an additional note here.  You need to include a check to only append the SharedUser field during the condition that the AllocatedUser value is different from the logged on user name.  i.e. item.AllocatedUser != "K2:<My Domain>\" + Page.User.Name.
0 Kudos
Reply