cancel
Showing results for 
Search instead for 
Did you mean: 

Assign task to document owner in 3.4b

ph73nt
Champ in-the-making
Champ in-the-making
Hi listers,

I would like to assign a task to the owner of a document. I have used the code suggested here (http://forums.alfresco.com/en/viewtopic.php?f=34&t=27391) to assign a user to a swimlane:


    <swimlane name="reviewer">
        <assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
            <actor>#{people.getPerson(bpm_package.children[0].assocs["someco:DocumentOwner"][0].properties.userName)}</actor>
<!–            <actor>nthomson</actor>–>
        </assignment>   
    </swimlane>

But when I attempt to enter the task on this swimlane I get the dreaded "transition null" error. If I switch the actor to be my username, the task executes with no errors (and I'm definately the owner of the document). I'm using version 3.4b, is this method compatible?

Thanks in advance, Neil
2 REPLIES 2

_sax
Champ in-the-making
Champ in-the-making
As your code suggests, there has to be a someco aspect with the property DocumentOwner.
And the user noted in that property has to be the one that works on the workflow. Only then will it work, I guess.
Since in a testing environment you probably are the one that uploaded the document for the workflow, you are the owner of that document. Hence, the workflow works for you, if you specify yourself as the user in the workflow. If the someco:aspect does not exist, the workflow cannot read it out. Therefore, it does not know, who is supposed to work on the workflow. Therefore, the null error is somewhat specific, in this case.

ph73nt
Champ in-the-making
Champ in-the-making
Thanks - useful input yet again, _sax!

So "someco" is an aspect that's not "out-of-the-box" (at least not in 3.4b). Armed with this knowledge, simple inspection shows that "Owner" is not actually a term associated with documents in Alfresco. One has access to Creator, Modifier and Author. So my whole problem stems form mixing jargon from one platform (my current QMS software) with that of Alfresco. Now trivial Googling shows me a simple solution for the case of document creator:

   <swimlane name="assignee">
      <assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
         <actor>
            #{people.getPerson(bpm_package.children[0].properties.creator)}
         </actor>
      </assignment>
   </swimlane>
This will fulfil my short-term needs,

Thanks again, Neil