cancel
Showing results for 
Search instead for 
Did you mean: 

How can i get attached documents in start task

wajdi_ghribi
Champ in-the-making
Champ in-the-making
Hi,
Iwant to know how to get the list of attached documents in the start task only, when i execute this code , i get all attached documents in the workflow!!
      WorkflowTask startTask=workflowService.getStartTask(ACTIVITI_PREFIX+execution.getId());      
      List<NodeRef> startTaskDocs=workflowService.getPackageContents(startTask.getId());
1 REPLY 1

mlagneaux
Champ on-the-rise
Champ on-the-rise
Hello,

The getPackageContents method returns the children of the bpm_package. The bpm_package is a folder where the documents of the workflow are put. This folder is located in workspace://SpacesStore store under the following primary path:
/{http://www.alfresco.org/model/system/1.0}system/{http://www.alfresco.org/model/system/1.0}workflow/{...

The bpm_package is used all along the life of your workflow. As a matter of fact, you can't get the list of attached documents in the start task getting the children of this folder : you will get all documents attached to the workflow.

To solve your problem, I think that you have to store (perhaps within the properties of the workflow) the list of attached documents in the start task.

Hope this help.