0
votes

Lets say that you have a bunch of individual tasks moving through your workflow. These tasks have a high level grouping through their properties. When the tasks get to a specific ReceiveTask in the workflow, a listener checks to see if all the tasks in their group are at the ReceiveTask. If not, the listener does nothing. If yes, all the tasks in that group are signaled to move on to the next step in the workflow.

Example: each task represents a page in a book. When the page task gets to the ReceiveTask, a check is made to see if all the pages in the book are there. If yes, they can all move on. If not, they sit there.

What is the correct way for a Java listener on the ReceiveTask to signal the other pages in the book to continue in the workflow? Code samples would be very helpful.

It seems that each page is in its own instance of the workflow, and that the WorkflowService.signal( pathID, transitionID ) is probably the method to make the other page tasks move, but I'm getting all kinds of workflow exceptions when I do this.

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

Doesn't make much sense to me. Am I running into some sort of Activit transaction problem?

Using Alfresco Community edition 4.2c

1

1 Answers

2
votes

I haven't got an answer for that directly, but I've been getting that exact same exception on Alfresco Enterprise 4.1.2 and pretty much the only references I've found were your questions on the Alfresco forums and now on here.

It looks to me like there's a bug in Activiti designer which is putting a task listener in places where an execution listener should go. I went to the XML directly and changed org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener to org.alfresco.repo.workflow.activiti.listener.ScriptExecutionListener and that particular error went away.