Domanda

I need to mark a user task as "deferred" to hide it in the default tasklist view until a given date is reached. There seems to be no standard functionality to achieve this, or is there? If not, we would have to implement a workaround on process variable level (taskDeferredUntil=Date) but how to implement the tasklist query? I would need to filter tasks from taskservice that:

1.) have a non null process variable (local?) "taskDeferredUntil" 2.) the value of "taskDeferredUntil" is less then "now"

The first filter is simple, any hints on the second criteria?

È stato utile?

Soluzione

I see three basic possibilities:

  1. The task is assigned and filtered as you write. Unfortunately e do not have "variableGreaterThan" in the TaskQuery. So you could either write an own customer query (see here) or do a proper ExecutionQuery (which has variableValueGreaterThan) and afterwards the task query. The latter might not be optimal depending on the query. It might be worth to file an issue to add taskVariableValueGreaterThan/LowerThan to the TaskQuery.

  2. You do a normal task query and filter them in memory. Might be sufficient - depends on the performance requirements.

  3. You could unassign the task until the deferred date is reached. Then you could either try to leverage the Timer/JobExecutor infrastructure to automatically re-assign the task when the deferred date is due (this is a bit like) . Unfortunately I do not have the time at the moment to code an example - but it is an interessting option though). Or you have some external Job checking that once in a while (doing an execution query for overdue deferred date - reassign and remove the deferred date - keeps efficient I think).

Hope that helps a bit to sort out options? Maybe I forgot something?

Cheers Bernd

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top