cancel
Showing results for 
Search instead for 
Did you mean: 

Missing dependency using ScriptTaskListener

rogerofyan
Champ in-the-making
Champ in-the-making
Hi,

I try to use ScriptTaskListener within a user task, as example
<activiti:taskListener event="complete"  class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
   <activiti:field name="script">
      <activiti:string>
         if(task.getVariableLocal('outcome') == 'N') {
   execution.setVariable('allApproved', false);
}
      </activiti:string>
   </activiti:field>
</activiti:taskListener>

it throws exception while running
Caused by: java.lang.ClassNotFoundException: org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener

It's no luck after I tried to all the jars packaged with activity-5.9 to the classpath. I'd like to know which jar file could provide the dependency?

Thanks.
7 REPLIES 7

trademak
Star Contributor
Star Contributor
Hi,

The ScriptTaskListener is a class that's part of the Activiti integration in Alfresco.
So this class is only available when you use Activiti in Alfresco.

Best regards,

sunitanayak83
Champ in-the-making
Champ in-the-making
Hi ,

I am using Activiti in Alfresco and I am getting the java.lang.ClassNotFoundException: org.alfresco.repo.workflow.activiti.script.AlfrescoScriptDelegate. How do I resolve this ? Is there any jar file that needs to added to the classpath ?? If yes, how do I add jar files for alfresco activiti in my classpath ??

jbarrez
Star Contributor
Star Contributor
This is an Alfresco problem: the class you mention should be on the classpath of Alfresco. Activiti does not have this class.

sunitanayak83
Champ in-the-making
Champ in-the-making
How do I check whether this class is in the classpath of Alfresco or not ? I am very sure that the class isn't there on the classpath, cause had it been there the class not found error wouldn't have occurred on the first place. If that's the case how do I add the class to the classpath of Alfresco ?? I am using Alfresco Activiti Enterprise BPM Suite v1.3.3

jbarrez
Star Contributor
Star Contributor
You could have said that from the beginning that you were using the BPM Suite … that's a whole different story and would have resolved this immediately.

org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener is an Alfresco class, NOT an Activiti BPM Suite class. It is not available there. It's an Alfresco ECM specific class.

What you probably want is org.activiti.engine.impl.bpmn.listener.ScriptTaskListener class from Activiti.

sunitanayak83
Champ in-the-making
Champ in-the-making
Thank you so much and sorry for not providing accurate information with my query. Will try out your solution. Another quick question does the mail task in Alfresco Activiti Enterprise BPM Suite work as desired or  Should I use service task and make it work as a mail task ?

jbarrez
Star Contributor
Star Contributor
Depends on your use case with the mail task 🙂

The mail task does do the sending of email (text or email) through various ways …. but if it's not sufficient for your use case, you can indeed always use a service task.