cancel
Showing results for 
Search instead for 
Did you mean: 

Exception: ScriptTaskListener doesn't implement interface

ungawunga
Champ in-the-making
Champ in-the-making
Alfresco 4.2c Community, Activiti workflow…

This is the exception I'm getting:


Apr 11, 2013 11:15:45 AM org.activiti.engine.impl.interceptor.CommandContext close
SEVERE: Error while closing command context
org.activiti.engine.ActivitiException: org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener doesn't implement interface org.activiti.engine.delegate.ExecutionListener nor interface org.activiti.engine.delegate.JavaDelegate
   at org.activiti.engine.impl.bpmn.helper.ClassDelegate.getExecutionListenerInstance(ClassDelegate.java:82)
   at org.activiti.engine.impl.bpmn.helper.ClassDelegate.notify(ClassDelegate.java:68)
   at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:42)



I'll post the whole stacktrace if anyone is interested…

Here's the Activiti workflow:
[img]http://i.imgur.com/qCxmI1J.jpg[/img]

We start off with a task in the 'Receive Task 1'. We call a Javascript webscript to move task to the next state, which calls 'signal' on the WorkFlowPath of the task. The task passes through the first ExclusiveGateway fine.
There is a Java listener on the SequenceFlow between the two ExclusiveGateways. It triggers, and sets a flow variable using DelegateExecution.setVariable(). The Listener ends, and then we see the above exception thrown.

The exception is caught by the javascript webscript's exception handler. I'm guessing that the 'signal' being called on the task when it's in the 'Receive Task 1' is contained within a transaction all the way through the two ExclusiveGateways. But why the heck is it throwing the above exception? Makes no sense to me. None of my code is in the stack trace. My listener on the SequenceFlow between the two ExclusiveGateways executes without error and sets the variable used in the next ExclusiveGateway's decision.

Any clues as to what the problem is here?

I'm getting this error after rewriting my workflow because of this error:
https://forums.alfresco.com/forum/developer-discussions/workflow/trigger-activiti-workflow-task-sitt...

Hopefully this thread gets a few more responses. Thanks
2 REPLIES 2

ungawunga
Champ in-the-making
Champ in-the-making
Update: On 'Script Task 1' and 'Receive Task 3', there are javascript listeners. They call javascript functions that move our models (subclasses of cm:folder) to a different folder. 'Receive Task 1' and 'Receive Task 2' also have the same javascript listeners, and don't exhibit this problem.

If I remove the javascript listeners from 'Script Task 1' and 'Receive Task 3', I don't get the exception anymore.

Is this a bug in Activit and Alfresco? Seems like it to me. I'm going to see if I can get around this by throwing some bogus pass-through Script Tasks in between them, as I do need my listeners to be called.

I've run into this sort of problems before, where if you have a Receive Task followed by a Script Task, the workflow tasks won't be held in the Receive Task like they should be. They just pass right through, as if they were Script Tasks.

ungawunga
Champ in-the-making
Champ in-the-making
Ok then…

What is the appropriate method for a listener, in the context of one task, to signal other tasks to move to the next step in their workflow? They're all in separate instances of the same Activiti workflow, but I'm having a hard time getting past the above exception when calling workflowService.Signal( otherTaskPath, null ).