Expand my Community achievements bar.

How to delete a task from the workspace after the deadline?

Avatar

Level 9

Hello All,

I have a task assigned to one user. Where the deadline is say "1 Min". If the user does not do anything then after 1 Min the task should be removed from the workspace. How to do that?

I have used the setVisibility method to make the task invisible but it's not working.

Any help would be greatly appreciated.

Thanks,

Bibhu.

7 Replies

Avatar

Level 8

Are you trying to remove it when the user has it open?  If not then the task will be replaced with a deadline message automatically

Avatar

Level 9

Hi TundraSteve,

I will try to explain it further.

The user logs into the Workspace. Clicks the to do list and see the task assigned to him in the process cord. He does not do anything till the task is deadlined. I mean he does not click on the task. Instead of showing the deadlined task in the process cord I am trying to remove it. I have tried the terminateTask(), setVisibility task() method. Still It's showing the deadlined task in the process cord after the deadline has occured but not removing it.

Thanks,

Bibhu.

Avatar

Employee

Hi Bibhu,

Calling setVisibility() method will not remove the task from your queue on client side. It will make sure that when you fetch tasks again, you will not get this task in the result.

To remove it from the client you can either delete it explicitly on the client or you can fetch tasks again.

Thanks

Avatar

Level 9

Hi Uphar,

Thanks for the reply. But the end user should not see the task in the process chord once it is deadlined. So the manual process of deleting the task is not the choice here. Is there anything that we can do so that the end user will not see the task after the deadline?

Thanks,

Bibhu.

Avatar

Employee

Hi Bibhu,

In order to achieve what you think should happen, you have to first call setVisibility() and once this call succeeds remove the task from the client.

Thanks

Avatar

Level 9

Hi Uphar,

I have written the following code snippets after setting the deadline.

//Create a ServiceClientFactory object

            ServiceClientFactory myFactory = ServiceClientFactory.createInstance(connectionProps);

               long task_id = patExecContext.getProcessDataLongValue("/process_data/@test")

            //Create a TaskManagerQueryService object   

TaskManagerQueryService queryManager = TaskManagerClientFactory.getQueryManager(myFactory);

           

            //Create a TaskManager object

            TaskManager myTaskManager = TaskManagerClientFactory.getTaskManager(myFactory);

            myTaskManager.setVisibility(task_id,true);    

Could you please guide me what needs to be modified??

Thanks,

Bibhu.

Avatar

Employee

Hi Bibhu,

Please modify the setVisibility call and pass 'false' instead of 'true' in the second argument.

Thanks