cancel
Showing results for 
Search instead for 
Did you mean: 

associate a state to a document from javascript file

alessioa_
Champ in-the-making
Champ in-the-making
Hi to all,
actually i'm working  to create my custom behaviour when i add a file in a particular space.
For doing this i create my javascript file and associated its execution to a rule created for the this space.
One task of the javascript file is to create a document, so i have these code:
var newFile = newFolder.childByNamePath("Offerta.doc");
if (newFile == null)
   newFile=newFolder.createFile("Offerta.doc");

Now i need to associate a state to this file … i.e. when the file is created the state is for example "just created", after when the file is modified the state change to "in progress" and a last state when document is ready the state change in "done".
Is it possible to do this? How? (creating a jbmp workflow? adding aspect to file?)
Someone have had same necessity and can help me?
Thanks
Best regards
Alessio A.
1 REPLY 1

ajshaw
Champ in-the-making
Champ in-the-making
Morning.

I don't know exactly what your reasons are, but the way i read your post makes it sound like you want this behaviour to apply to particular space/s only. If this is the case then an aspect may be the best way to apply the extra property required to store the document state, as it can be added at the same time as your script is executing.

I guess you could also use categories, but only you could decide if that is appropriate.