Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Completing Task from other process

Avatar

Former Community Member

Hi,

   I need to complete a Task assigned to User queue from other process. For example,

    I have a Workflow A which creates task and assigns it to user "xyz", this task can be completed in two ways,

       1) User xyz logs on to workspace and completes the task, normal straight forward way.

       2) A scanned document (.pdf) is copied to Watched Folder which kicks of another Workflow B, now this workflow B needs to complete the

        task which is currently assigned to user "xyz".  Any idea how?

   I need your help/advice on option 2.

Thanks,

Vik

8 Replies

Avatar

Level 10

This article may help you to understand the Task Manager API functions.

http://help.adobe.com/en_US/livecycle/9.0/programLC/javadoc/com/adobe/idp/taskmanager/dsc/client/tas...

the CompleteTask method will solve your issue.

Now, The matter is how you are going to correlate your TaskId from the WatchedFolder initiated process.

Nith

Avatar

Former Community Member

Thanks Nith.

I had look at the API's but as you said my man problem is how do I get the TaskId of waiting process.

Vikram

Avatar

Level 10

As Nith is pointing out you need to know how to link the document with the task id.  Once you the link, you might be able to use the TaskManagerQueryService api to search for a task id.

http://help.adobe.com/en_US/livecycle/9.0/programLC/javadoc/com/adobe/idp/taskmanager/dsc/client/Tas...

Jasmin

Avatar

Former Community Member

Hi Vik,

I think when the scanned document is dropped in the watched folder you will need the metadata put there as well. May be you can ask the file name to have blahblahblah_taskid.pdf as the naming convention or the xxxx.pdf and xxxx.txt files are dropped there and the .txt file has the task id and your watch folder is looking for .txt files as the trigger.

The other way I've solved similar problem is through email endpoint. Just before the task creation you can send an email with process id and other info in subject line. The user either completes the task via option a or he replies to the email with attachment. Then the email endpoint will pick up the email and you'll get the process id from subject which will allow you to find running task. Then after use the links that these guys posted to create the complete task call.

hope that helps.

cheers,

Parth Pandya

blog - http://blog.pandyaparth.com

Avatar

Former Community Member

Hi Parth,

Thanks for your advise. In my case I can't ask them for a prefixing task id to scanned document as the scanning will happen remotely and they will not know what task id / process id is and second option is also not possible.But we do name the scanned files to have specific identifier ( Order no) which is understood by our system and based on this I can get process Instance Id. I am not sure how do I retrieve Task Id based on process Id and I also struggling to understand how can I make use Live cycle API in this scenario.

1) Get the Task Id Based on Process Instance Id, as this task could be sitting with any user ( how can I filter all tasks in system? As when i use any Task Filters it returns me task assigned to that user)

2) How to complete the task assigned to other user using a standard system user using Java API?

Thanks,

Vikram

Avatar

Former Community Member

Hi Vikram,

I think you are looking at creating either a custom DSC or writting the logic in script component.

The LiveCycle api references given in this thread will help you to write this logic.

When the task is assigned to a user you should only complete it with the custom dsc or script. LiveCycle SDK help has examples that will give you a good start point.

When you'll complete the task the process will move to next step in process. You will not need to worry about which user has that taks as the API call will complete the task as System user and the task will get removed from user's queue and next process logic will get executed.

regards,

Parth

blog: http://blog.pandyaparth.com

Avatar

Former Community Member

Hi Nith,

I have managed to get the Task Id but I am still not able to use the completeTask method as this task is assigned to different user and when I am trying to complete it using user credentials which have admin roles assigned it throws following error,

com.adobe.idp.taskmanager.dsc.client.task.TaskPermissionException: User: CA9F4E72-82FA-9048-C526-E2E45B0BE61C is not assigned task: 12203. The task cannot be completed

does the admin user needs to have specific permissions to complete task on behalf of other user?

Regards,

Vikram

Avatar

Level 10

There are many Administrator roles available ; e.g Process Administrator/Forms Administrator etc.

But did you try with Super Administrator account?

If still not working, as a quick solution you can claim the task to your account and complete the Task.

Please note that this will be recorded and your account name will appear on tracking.

Nith