activiti

How to correct "doesn't implement org.activiti.engine.delegate.JavaDelegate" error in Activiti


I am starting with Activiti and I am trying to create a service task. I created a netbeans java library project and coded the following class:

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);
    }

}

Then I builded the library and copied the jar into tomcat lib folder at /lib, where I have activiti libraries also.

In my BPMN I have this service task:

<serviceTask id="servicetask1" name="List Users" activiti:class="com.processos.reuniao.ListUsers"></serviceTask>

When Activiti try to run this service task, It returns me this exeception:

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

As shown in the class, It implements JavaDelegate. What I am doing wrong?


Solution

  • Try to add jar to the webapps/your-appplication/WEB-INF/lib directory or to webapps/activiti-explorer/WEB-INF/lib if you test workflow using activiti-explorer The best way to test process definitions is to use activiti-explorer. You can find activiti-explorer.war file in activiti distribution.
    Activiti user guide - deployment with Activiti explorer