cancel
Showing results for 
Search instead for 
Did you mean: 

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

activiti_
Champ in-the-making
Champ in-the-making

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




}

}

0 REPLIES 0