History by User Task Claim time
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-05-2011 05:06 PM
Hi,
The project that we are working on requires that the system track how long a user spends on a task. This has to be starting from when a user claimed the task (not when the task started). Currently I do not see this in the DB or any mechanism to handle this. The reason for this is that the company wishes to monitor the performance of the users (how long they spend from claiming a task and completing it). Is there a way to handle this and store the information in the history DB tables? Any examples would be great.
thanks,
Rue
The project that we are working on requires that the system track how long a user spends on a task. This has to be starting from when a user claimed the task (not when the task started). Currently I do not see this in the DB or any mechanism to handle this. The reason for this is that the company wishes to monitor the performance of the users (how long they spend from claiming a task and completing it). Is there a way to handle this and store the information in the history DB tables? Any examples would be great.
thanks,
Rue
Labels:
- Labels:
-
Archive
8 REPLIES 8
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-09-2011 05:10 AM
Hi,
You could use an task-listener for this. You define the handler to the tasks that need to be monitored, triggering on the event "assignement". In the assignement-handler code, you can (for example) add a local variable to the task (delegateTask.setVariableLocal("claimTime", Calendar.getInstance().getTime()). If you set the histroy-level high enough, task-variables are stored in the history and can be queried for. With some code (or custom query), I guess you can calculate the duration.
see http://activiti.org/userguide/index.html#taskListeners
You could use an task-listener for this. You define the handler to the tasks that need to be monitored, triggering on the event "assignement". In the assignement-handler code, you can (for example) add a local variable to the task (delegateTask.setVariableLocal("claimTime", Calendar.getInstance().getTime()). If you set the histroy-level high enough, task-variables are stored in the history and can be queried for. With some code (or custom query), I guess you can calculate the duration.
see http://activiti.org/userguide/index.html#taskListeners
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-09-2011 05:20 AM
No, that information is not availble in the database at this point, you'll need to add your own variable to track this time.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-09-2011 11:15 AM
Thanks for the information. I thought the Assignment event happens prior to the 'create' event so that the setting the variable in an task listner would not have the correct time? i.e Does the assignment event happen again when a user claims a task or a manager delegates the task to a user? Or is it just a one time reference when the task gets created?
thanks,
Rue
thanks,
Rue
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-10-2011 03:08 AM
If the activiti:assignee (or BPMN 2.0 humanperformer counterpart) is used, the assignement-event is fired RIGHT before the create event. In this case, it's the same as the create time, so you can just use that time, no? If assignee is null at that time, you know that the task is created unclaimed.
When assignement is set later (using service call for example), you can check if your task-variables already contain a "claim" date from prior assignements (or assignement when task was created). So yes, each assignment causes an event to be thrown.
When assignement is set later (using service call for example), you can check if your task-variables already contain a "claim" date from prior assignements (or assignement when task was created). So yes, each assignment causes an event to be thrown.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-13-2015 02:45 PM
claim_time_ is now a column in the act_hi_taskinst table. Is there a way (in 5.16.3) to access this value through a query OR do I still have to track my own instance of date claimed in a local variable instance?
Thanks,
Bruce.
Thanks,
Bruce.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-18-2015 10:50 AM
No, it seems that the query doesn't support claim time at the moment.
Cheesy answer: always welcoming pull requests 😉
Cheesy answer: always welcoming pull requests 😉
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-19-2015 01:06 AM
Could you create your own createNativeTaskQuery() to access the claim time?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-21-2015 02:40 PM
Sure that's possible. You can use the NativeHistoricTaskInstanceQuery. But we should add it to the default API as well.
Best regards,
Best regards,