我从 Activiti 开始,我正在尝试创建一个服务任务。我创建了一个 netbeans java 库项目并编写了以下类:
package com.processos.reuniao;
import org.activiti.engine.delegate.DelegateExecution;
import org.activiti.engine.delegate.JavaDelegate;
public class ListUsers implements JavaDelegate {
@Override
public void execute(DelegateExecution execution) throws Exception {
String group = (String) execution.getVariable("group");
System.out.println(group);
}
}
然后我构建了库并将 jar 复制到 /lib 的 tomcat lib 文件夹中,我也有 activiti 库。
在我的 BPMN 中,我有这个服务任务:
<serviceTask id="servicetask1" name="List Users" activiti:class="com.processos.reuniao.ListUsers"></serviceTask>
当 Activiti 尝试运行此服务任务时,它返回给我这个异常:
Fev 27, 2013 5:31:32 PM com.vaadin.Application terminalError
SEVERE: Terminal error:
com.vaadin.event.ListenerMethod$MethodException
Cause: com.vaadin.event.ListenerMethod$MethodException
Cause: org.activiti.engine.ActivitiException: com.processos.reuniao.ListUsers doesn't implement org.activiti.engine.delegate.JavaDelegate nor org.activiti.engine.impl.pvm.delegate.ActivityBehavior
如该类所示,它实现了 JavaDelegate。我做错了什么?