cancel
Showing results for 
Search instead for 
Did you mean: 

move a document using activiti

ghmus
Champ in-the-making
Champ in-the-making
hi!
how can i move a doc after finishing my workflow using activiti ?!

i used this script but it doesn't work

<activiti:taskListener event="complete" class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
      <activiti:field name="script">
        <activiti:string>
          if(task.getVariableLocal('scwf_approveRejectOutcome') == 'Approve') {

          var dest = bpm_context.childByNamePath("nv");
          for (var i = 0; i &lt; bpm_package.children.length; i++)
          {
            bpm_package.children.move(dest);
          }
        </activiti:string>
      </activiti:field>
</activiti:taskListener>

i get this error :

Exception while invoking TaskListener: Incompatible type set on field declaration 'script' for class org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript. Declared value has type org.activiti.engine.impl.el.FixedValue, while expecting org.dom4j.Element


1 REPLY 1

tonyrivet
Champ in-the-making
Champ in-the-making
Hi,

For Activiti, I think you should use the org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener class for the taskListener, but I don't know if it supports JavaScript. Maybe you will have to use a groovy script.

Another way could be to add a scriptTask at the end of your workflow :

<scriptTask id="theScriptTask" name="Execute script" scriptFormat="JavaScript">
  <script>

  </script>
</scriptTask>