Bug 1201245

Summary: Activation time of tasks is set to time when task is created, not when it is started
Product: [Retired] JBoss BPMS Platform 6 Reporter: Karel Suta <ksuta>
Component: jBPM CoreAssignee: Maciej Swiderski <mswiders>
Status: CLOSED NOTABUG QA Contact: Karel Suta <ksuta>
Severity: low Docs Contact:
Priority: low    
Version: 6.1.0CC: ksuta, kverlaen, mbaluch, rrajasek
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-12-07 13:26:05 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Karel Suta 2015-03-12 12:04:50 UTC
Description of problem:
When I try to get list of active tasks which were activated since some specific date by calling method getActiveTasks(Date since) in SynchronizedTaskService, I get list of tasks which were created since that specific date and are now active.

It is caused by setting activation time to same time as is creation time. [1] 


Version-Release number of selected component (if applicable):
6.1.0.ER6

How reproducible:
Start process with human task and start task. Call getActiveTasks(date) with date which is between time when task is created and when it is started.

Steps to Reproduce:
1.
2.
3.

Actual results:
getActiveTasks returns empty list

Expected results:
getActiveTasks should return list with task which was started after specified date

Additional info:

[1] https://github.com/droolsjbpm/jbpm/blob/master/jbpm-human-task/jbpm-human-task-jpa/src/main/java/org/jbpm/services/task/impl/model/TaskDataImpl.java#L388

Comment 3 Karel Suta 2015-03-13 09:45:14 UTC
Same issue with method getCompletedTasks(Date since).

Comment 4 Maciej Swiderski 2015-03-16 14:58:24 UTC
this is actually as expected - as WS-HT splits creation and activation into two steps in jBPM we have that as part of task creation and thus it is set to the same data. Activation means task has been assigned to either single actor (ends in status Reserved) or to multiple actors/groups (ends in status Ready)

Task can only be activated (WS-HT operation) when is in state created meaning there are no actors assigned at all on given task.

So I believe this works as designed, though not sure about complete comment....

Comment 5 Karel Suta 2015-03-16 17:23:16 UTC
Ok, it is more clear to me now. 

I am still partly unsure about functionality of getActiveTasks and getCompletedTasks from InternalTaskService - implemented in TaskAdminServiceImpl.
When there is put date as parameter then this date is compared to activationTime, is it how it should be done?
See:

getActiveTasks() - should return tasks which are in progress - ok
getActiveTasks(Date since) - should return tasks which are in progress and which were created/activated after specified date?
getCompletedTasks() - should return tasks which are completed - ok
getCompletedTasks(Date since) - should return tasks which are completed and which were created/activated after specified date?

For me it would be more logical if that date parameter will be related to time when task status was changed. So getActiveTasks(Date since) would return tasks which were started after that date and getCompletedTasks(Date since) would return tasks which were finished after that date.

Comment 6 Maciej Swiderski 2015-03-16 18:17:22 UTC
(In reply to ksuta from comment #5)
> Ok, it is more clear to me now. 
> 
> I am still partly unsure about functionality of getActiveTasks and
> getCompletedTasks from InternalTaskService - implemented in
> TaskAdminServiceImpl.
> When there is put date as parameter then this date is compared to
> activationTime, is it how it should be done?
> See:
> 
> getActiveTasks() - should return tasks which are in progress - ok
> getActiveTasks(Date since) - should return tasks which are in progress and
> which were created/activated after specified date?
> getCompletedTasks() - should return tasks which are completed - ok
> getCompletedTasks(Date since) - should return tasks which are completed and
> which were created/activated after specified date?

these are exact description on how it does work at the moment. 

> 
> For me it would be more logical if that date parameter will be related to
> time when task status was changed. So getActiveTasks(Date since) would
> return tasks which were started after that date and getCompletedTasks(Date
> since) would return tasks which were finished after that date.
agree that this would be ultimate goal for these methods though we need to extend the schema to include time information about when task has been started and completed so they can be used for queries. These are not defined in WS-HT and that's most likely main reason they are not yet in there.

Comment 7 Karel Suta 2015-12-07 13:26:05 UTC
Currently works as it should.
Closed as part of BZ cleanup, if somebody would miss functionality described in ultimate goal then there can be opened new Jira.