如何更正Activiti中的“未实现org.activiti.engine.delegate.JavaDelegate”错误

时间:2013-02-27 20:40:57

标签: activiti

我从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。我做错了什么?

1 个答案:

答案 0 :(得分:4)

如果使用webapps/your-appplication/WEB-INF/lib测试工作流程,请尝试将jar添加到webapps/activiti-explorer/WEB-INF/lib目录或activiti-explorer 测试流程定义的最佳方法是使用activiti-explorer。您可以在activiti发行版中找到activiti-explorer.war文件 Activiti user guide - deployment with Activiti explorer