09-24-2019 02:59 AM
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());
}
}
Explore our Alfresco products with the links below. Use labels to filter content by product module.