AnsweredAssumed Answered

Importing javascript into a workflow

Question asked by buje85 on Sep 19, 2014
Latest reply on Sep 22, 2014 by buje85

I am trying to launch a workflow when one ends so i have written the code to launch the next workflow in a js file. I cant get the task listener to run the function in my script file.

I have looked around for ages but cant see any examples to check if I have done something stupid. I have run the import line and then called the function in the javascript console add it and everything runs fine so it is just a syntax error. This is using activiti.

<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="" xmlns:xsi="" xmlns:xsd="" xmlns:activiti="" xmlns:bpmndi="" xmlns:omgdc="" xmlns:omgdi="" typeLanguage="" expressionLanguage="" targetNamespace="">
  <process id="testScriptWorkflow" name="test scripting process" isExecutable="true">
    <startEvent id="alfrescoStartevent1" name="Alfresco start" activiti:formKey="wf:submitAdhocTask"></startEvent>
    <endEvent id="endevent1" name="End"></endEvent>
    <userTask id="alfrescoUsertask1" name="Alfresco User Task" activiti:formKey="wf:adhocTask">
        <activiti:taskListener event="create" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
          <activiti:field name="script">
            <activiti:string><![CDATA[<import resource="/Company Home/Data Dictionary/Scripts/testingwfl.js">;testLaunch();]]></activiti:string>
          <activiti:field name="runAs">
    <sequenceFlow id="flow3" sourceRef="alfrescoStartevent1" targetRef="alfrescoUsertask1"></sequenceFlow>
    <sequenceFlow id="flow4" sourceRef="alfrescoUsertask1" targetRef="endevent1"></sequenceFlow>

can anyone help? Am I using the incorrect class?