cancel
Showing results for 
Search instead for 
Did you mean: 

Creating custom Workflow

marco_ollivier_
Champ in-the-making
Champ in-the-making

Hello to all.

I'm building a document approval workflow and my main goal is to copy the file that is attached to the workflow to another folder.

It would be something similar to "Simple Workflow" that already exists within the "Manage Content Rules", but I need to make this rule within my workflow.

could someone help me with this problem?
2 REPLIES 2

lementree
Champ on-the-rise
Champ on-the-rise
Hi,

You can do it using javascript in "complete" event of review task. In that task write javascript as follows

<activiti:taskListener event="complete" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
          <activiti:field name="script">
            <activiti:string>
         //here get destination node using search
          var dest = search
   for(var j=0; j&lt;bpm_package.children.length; j++){
      bpm_package.children[j].copy(dest);
   }

   </activiti:string>
          </activiti:field>
          <activiti:field name="runAs">
            <activiti:string>admin</activiti:string>
          </activiti:field>
        </activiti:taskListener>

dzdarek
Champ in-the-making
Champ in-the-making
How can one add Folder Picker to the form in the workflow to get destination folder from the user?