When a user opens a work item for some time then close it, is that logged in the k2serverlog database

  • 11 January 2011
  • 9 replies
  • 0 views

Badge +11

Hi


I have the following situation where a task is found in the task list of more than one user. one of them opens it for some while - during this period if another user opens his worklist, the opened task will not appear there because it's status is "open" not "available"- then close it and not do any action on it.


does the k2serverlog database record this issue in it's tables?


if the answer is no how can we retrieve the user who openned the task list item and the period of time he openned it?


to recap : i want to know who prevented others from openning a certain task list item by openning it for himself and not taking any action on it.


9 replies

Badge +11

Can you help please.

Badge +11

if it is not "loggable"...how can we log it

Badge +11

This is an important issue for me

Badge +3

Hi Bashar,


If you just want to check without building a report you can use the Management worklist, if you need to build a report you will have to use the reporting SmartObjects


Hope this will help.


Kind regards,


Brink

Badge +11

Mr Brink


Regarding the Management Worklist can you explain more or share an example.


thanks for your help.


 

Badge +5

Here is some sample code which may give you an idea on the management API. I would caution over using the Management API, it is for management tasks and not high volume execution work like the client API's


using System;
using System.Collections.Generic;
using System.Text;
using SourceCode.Workflow.Management;



namespace K2Sample.WorkList
{
    public class ManagementWorklist
    {
        private static string conString = "Integrated=True;IsPrimaryLogin=True;Authenticate=True;EncryptedPassword=False;Host=localhost;Port=5555";


        public static string ConString
        {
            set
            {
                conString = value;
            }
            get
            {
                return conString;
            }
        }


        public static void ForceReleaseWorkListItem(string sn)
        {
            WorkflowManagementServer workflowServer = new WorkflowManagementServer();


            try
            {
                string[] snSplit = sn.Split('_');
                workflowServer.CreateConnection();
                workflowServer.Connection.Open(ConString);
               
                WorklistItems wl = workflowServer.GetWorklistItems("", "", "", "", "", "", "");
                foreach (WorklistItem wi in wl)
                {
                    Console.WriteLine(wi.ProcInstID.ToString() + "_" + wi.ActInstDestID.ToString());
                    if ((wi.ProcInstID.ToString() == snSplit[0]) && (wi.ActInstDestID.ToString()==snSplit[1]))
                    {
                        Console.WriteLine(wi.Status);
                        if (wi.Status == WorklistItem.WorklistStatus.Open)
                        {
                            workflowServer.ReleaseWorklistItem(wi.ID);
                        }
                    }
                   
                }


                Console.WriteLine(wl.Count);


            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            finally
            {
                if (workflowServer.Connection != null)
                {
                    workflowServer.Connection.Close();
                }
            }
        }
    }
}

Badge +11

Many thanks for your reply ...but this is not what i meant..i dont want an example about releasing openned item


i just to know the time spent by a worklist item while it is open


Can i know that By any means..


can any api help me in that


 is there any table in k2server or k2serverlog that holds this info


 

Badge +5

Hi Bashir,


This was an example of the use of the management API, I was leaving the rest of the digging around to you :-)

Badge +11

:-)


thanks for your help


I have digged around it in all the APIs..also gone through all the Database tables but nothing gave the healing answer to me


 


 



select 



 



* from dbo._ProcInst where ID= 3114 -- order by ProcInstid,id

--select * from dbo._Act




select



 



* from dbo._ActInstslot where ProcInstid=3114  --order by ProcInstid


select  * from dbo._ActInst where ProcInstid=3114 order by  id




Tables _ActInstslot and _ActInst showed a glimpse of hope. _ActInst showed me the current status "2" which means open ; but it is gone and sustituted to "4" upon taking an action on the activity. which means there is no history saved for the statuses.

Reply