How can I show list of activities started by me in WorkList

  • 7 November 2007
  • 6 replies
  • 1 view

Badge +7

How can I show list of activities started by me in WorkList?


 


6 replies

Badge +11

I assume you mean 'processes' started by yourself.


I do not think it is possible in the Worklist unless you store the Originator Name in a process datafield and filter the worklist on this specific datafield.  To get a list of processes you've started, you'll have to draw up a report.


Regards,


Ockert

Badge +7

Yes, Processes started by me.


Well, in K2.net 2003, there is a Web Part called, "K2.net 2003 Report", it allows you to get and display all processes started by you or involved b you. However come.......this is disappear in blackPearl?

Badge +11

Granted - but the reporting webpart was well... for reporting - No direct worklist involved.


We've added a whole bunch of out-of-the-box reports for the next release - can't say with 100% certainty but I'm sure there'll be something in there that you can use.


You should also be able to write your own custom report in blackpearl which does exactly this.


Regards,


Ockert

Badge +6

There are two ways that I have found to create a list of process instances for which you are the originator.


1) Among the reporting SmartObjects is one called Process Instance.  You can pass in Originator as a parameter and receive a list of processes that you've started.


2) Via the workflow.management api you can load up processes instances also although this method does require admin level rights.  Again you can pass in the originator and receive the data you want.


The 2nd method takes approximately 10% of the time as the 1st, so would be the way to go if you can stomach putting authentication information into your code.

Badge +2

I was able to build a custom worklist using the SourceCode.Workflow.Client class and the code snippet below. On the ASPX page, I used an ObjectDataSource and fed it into a GridView. Hope this helps.


 


public

DataSet getWorklist()


{


DataSet ds = new DataSet();


DataTable dt = new DataTable();


DataRow dr;


System.

Type typeDateTime = System.Type.GetType("System.DateTime");


Worklist worklist;


Connection connection =

new Connection();


ConnectionSetup cs =

new ConnectionSetup();


cs.ConnectionString =

"username, password";


 


// defining host server info


cs.ConnectionParameters.Add(ConnectionSetup.ParamKeys.Host,

"K2HostServer");


 


// defining columns in DataTable


dt.Columns.Add(

new DataColumn("TaskType"));


dt.Columns.Add(

new DataColumn("TaskSubject"));


 


// without defining date type, sorting will not work properly in GridView


dt.Columns.Add(

new DataColumn("TaskAssignedDate", typeDateTime));


dt.Columns.Add(

new DataColumn("TaskDueDate", typeDateTime));


dt.Columns.Add(

new DataColumn("TaskStatus"));


dt.Columns.Add(

new DataColumn("TaskSerialNumber"));


 


connection.Open(cs);


 


// passing current user identity to retrieve personalized worklist items


connection.ImpersonateUser(

HttpContext.Current.User.Identity.Name);


 


worklist = connection.OpenWorklist();


foreach (WorklistItem wi in worklist)


{


wi.Open(

false);


dr = dt.NewRow();


// retrieving process instance data


dr[

"TaskAssignedDate"] = wi.ProcessInstance.StartDate;


dr[

"TaskStatus"] = wi.ProcessInstance.Status1;


dr[

"TaskSerialNumber"] = wi.SerialNumber;


// retrieving XML process data


XmlDocument xdoc =

new XmlDocument();


xdoc.LoadXml(wi.ProcessInstance.XmlFields[

"XMLData"].Value);


XmlNode xnode = xdoc.SelectSingleNode(

"/Record");


dr[

"TaskType"] = xnode.Attributes.GetNamedItem("LOB").Value;


dr[

"TaskSubject"] = xnode.Attributes.GetNamedItem("Title").Value;


// retrieving XML process data


xdoc.LoadXml(wi.ProcessInstance.XmlFields[

"XMLData2"].Value);


xnode = xdoc.SelectSingleNode(

"/User");


dr[

"TaskDueDate"] = xnode.Attributes.GetNamedItem("DueDate").Value;


dr[

"TaskAssignedBy"] = xnode.Attributes.GetNamedItem("UserName").Value;


dt.Rows.Add(dr);


}


ds.Tables.Add(dt);


connection.Close();


return ds;


}

Badge +1

Hi,


I tried to find out a way to list the Originator of each process and it seems there is no way to get it from the API.


Please share some code if you have, that will help to fetch the originator details from the process instance object.


Thx

Reply