cancel
Showing results for 
Search instead for 
Did you mean: 

creating documents via workflow

ramimoncer
Champ on-the-rise
Champ on-the-rise
I developed a workflow using activiti engine and succeeded to integrate it in alfresco .I want to modify  one task in my workflow then it generates the creation of  documents (word,pdf…) and modifying them.
How can I proceed to do it?
Which tutorials can help me?
Thanks
3 REPLIES 3

jpotts
World-Class Innovator
World-Class Innovator
If you are asking how to create a word doc or a PDF document in their native formats, you're going to have to find and use a Java API to help you do that. You might see if Apache POI will do the trick for your Office document needs.

An alternative would be to write a web service and have your activiti task invoke that service and get called back when the document is done being created. You could then place that document in the repository and add it to the workflow package if that is what you need to do.

If you are asking how to create a new document object in the repository from an Activiti task refer to the Alfresco JavaScript API. You'll want either the createFile or createNode functions that are in ScriptNode.

Jeff

ramimoncer
Champ on-the-rise
Champ on-the-rise
Thanks Jeff,
I used JavaScript to create the document:

var doc1 =createdFolder.createFile(scwf_nomclient);
doc1.mimetype = "text/plain";
doc1.content ="nom du projet  "+ scwf_nomprojet+"\n nom client  "+scwf_nomclient;

jpotts
World-Class Innovator
World-Class Innovator
Cool, glad you got it working.

Jeff