cancel
Showing results for 
Search instead for 
Did you mean: 

[SOLVED]Modifying file description/tags

ldziedzic
Champ in-the-making
Champ in-the-making
Hi,

I'm new to Alfresco, and trying to implement an Advanced Workflowfor for past month. Currently I'm struggling to find a way to update the description and tags of a file by executing a script inside a process definition. Is there a way to this through:

bpm_package.children[0]


i can add aspects and modify them, but can't find something to update the decription or a tag.

Thanks in advance.
2 REPLIES 2

afaust
Legendary Innovator
Legendary Innovator
Hello,

if you can update and add aspects I don't understand why you can't find something to update the description or tag. Any child of the bpm_package is a script node and has the API documented in the <a href="https://wiki.alfresco.com/wiki/4.0_JavaScript_API#ScriptNode_API">wiki</a>. So to update a description you would use
var child = bpm_package.children[0];
child.properties["cm:description"] = "New Description";
child.save();

and for updateing tags
var child = bpm_package.childre[0];
child.setTags(["Tag 1", "Tag 2"]);


Regards
Axel

ldziedzic
Champ in-the-making
Champ in-the-making
Hi,

Guess i wasn't looking in the right place. Thanks for clearing this out, works just fine !

cheers
Leszek