cancel
Showing results for 
Search instead for 
Did you mean: 

How to get documents attached to the workflow

nth
Champ in-the-making
Champ in-the-making
To get the companyHome I use this method:

public NodeRef getCompanyHome()

    {
        return nodeLocatorService.getNode("companyhome", null, null);
    }
the spring confuguration is the following:

bean id="TransformationHandler" class="org.alfresco.transformation.TransformationHandler"          parent="baseJavaDelegate" lazy-init="default" autowire="default" dependency-check="default"
      property name="nodeService" ref="NodeService"
      property name="nodeLocatorService" ref="nodeLocatorService"

when I loop throug the children of a NodeRef I see the root folder structure(I'm not shure I name them right in english): data dictionary, guest catalog, users home space, published and so on. But as I run my code in the workflow I need to get the parent of the files I attached to the workflow. So how to access files attached to the workflow
1 REPLY 1

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

The documents attached to a workflow are located in a node (a folder) called workflow package. When you're working on a workflow instance, the nodeRef of this folder can be retrieved thanks to getWorkflowPackage method of your WorkflowInstance object.
From this nodeRef, you can get your documents. They are the children of this folder.