How to automatically complete a task based on a variable in the database?

cancel
Showing results for 
Search instead for 
Did you mean: 
activiti_
Member II

How to automatically complete a task based on a variable in the database?

Hi, I'm trying to automatically complete a task depending on a variable in the database. Right now I have thought of this but it doesn't work. Please help me out

Example: Let's say my variable is autoComplete.

import org.activiti.engine.delegate.DelegateTask;
import org.activiti.engine.delegate.TaskListener;
import org.springframework.stereotype.Component;

@Component
public class AutoApproveListener implements TaskListener{

@Autowired

TaskService taskService

private static final long serialVersionUID = 882367583162545844L;

@override
public void notify(DelegateTask delegateTask) {
// TODO Auto-generated method stub
String autoComplete = delegateTask.getVariable("autoComplete");

if(autoComplete==true)

  taskService.complete(delegateTask.getId());




}

}