Report Values for the user 'K2:DomainDomainUser'

  • 5 April 2011
  • 3 replies
  • 0 views

Badge +11

Dears


I am asked to produce a report that shows the following values for a certain user.


1. Number of Recieved Tasks


2. Number of Approved Tasks


3.Number of Rejected Tasks


4.Number of  Tasks In progress


5.Average Time Required to process Tasks.


I searched the K2ServerLog database for these values and come up with these SQL statements ...  i want to make sure that all of them is correct, if not the can you supply the correct ones.


1.  select count(*) from dbo._Worklist  INNER JOIN K2ServerLog.dbo._ProcInst ON (_Worklist.ProcInstID = _ProcInst.IDwhere dbo._Worklist.[Destination]='K2:DomainDomainUser' and _Worklist.Status=0 and (_ProcInst.[Status] between 1 and 3) order by ProcInstID


2.  Select count(distinct(K2ServerLog.dbo._ActInstSlot.ProcInstID)) FROM  K2ServerLog.dbo._ActInstSlot   INNER JOIN K2ServerLog.dbo._ProcInst ON (_ActInstSlot.ProcInstID = _ProcInst.IDwhere _ActInstSlot.[User]='K2:DomainDomainUser' and _ActInstSlot.FinalAction='Approve' and K2ServerLog.dbo._ProcInst.[Status]=3


3.   Select count(distinct(K2ServerLog.dbo._ActInstSlot.ProcInstID)) FROM  K2ServerLog.dbo._ActInstSlot    INNER JOIN K2ServerLog.dbo._ProcInst ON (_ActInstSlot.ProcInstID = _ProcInst.IDwhere _ActInstSlot.[User]='K2:DomainDomainUser' and _ActInstSlot.FinalAction='Reject' and K2ServerLog.dbo._ProcInst.[Status]=3 


4.  Select count(distinct(K2ServerLog.dbo._ActInstSlot.ProcInstID)) FROM  K2ServerLog.dbo._ActInstSlot   INNER JOIN K2ServerLog.dbo._ProcInst ON (_ActInstSlot.ProcInstID = _ProcInst.ID) where _ActInstSlot.[User]='K2:domaindomainUser' and (K2ServerLog.dbo._ProcInst.[Status]=2 or  K2ServerLog.dbo._ProcInst.[Status]=1)


5. I couldnt find a good sql query for that




If you think any of these is correct then please supply a correct one



 


3 replies

Badge +11

I hope that a k2 expert answers this question because i have many doubts in these queries

Badge +10

I think a lot of the queries that you're doing could be done using the out of the box "Activity Instance Destination" SmartObject. 


For #5 I didn't see a out of the box SmartObject that would calculate the average activity duration.  You would think that the Activity Statistics SmartObject would provide that information and it even has an Avg Time property but its not displaying activity data as I would expect it to going by its name.


In any case for 1-4 test the "Activity Instance Destination" SmartObject using the SmartObject tester to see if it meets your requirements.


Note that there was a bug in the early bp 4.5 releases that prevented filtering on this SmartObject (probably others as well).  However, that was fixed and is now workiing in the 1230 update.


Hope this helps,


Tim

Badge +11

Thanks for Your answer Mr. Tim


I need to make an independent report file -crystal or reporting services- and  i am not sure if the smartObject fits in these reports. in addition to that the information i am requesting is part of a report that collects data from other applications. and i need to query the information based on many criteria that the smart object may not provide.


The safest case is go to the source -SQL server Tables-  and build on that.

Reply