Hi everybody,
I have created a custom WorkItemHandler for Email, and added that in CustomWorkItemHandlers.conf like below:
"Email" : new org.jbpm.spring.boot.EmailWorkItemHandler(ldapService)
EmailWorkItemHandler has a reference to ldapService, which is there in my beans.xml file. But I am getting below exception when running the application, if I remove ldapService from handler and constructor then everything works fine. I am using jbpm in a spring based application.
org.mvel2.CompileException: [Error: no such method or function: ldapService]
[Near : {... "Email" : new org.jbpm.spring.boot.EmailW ....}]
EmailWorkItemHandler class looks like below:
public class EmailWorkItemHandler implements WorkItemHandler {
private LdapService ldapService;
public EmailWorkItemHandler() {
}
public EmailWorkItemHandler(LdapService ldapService) {
this.ldapService = ldapService;
}
public void executeWorkItem( WorkItem workItem, WorkItemManager manager ) {
System.out.println("Executing email work item " + workItem);
...............................................................
...............................................................
manager.completeWorkItem(workItem.getId(), null);
}
public void abortWorkItem( WorkItem workItem, WorkItemManager manager ) {
System.out.println("Aborting email work item " + workItem);
manager.abortWorkItem(workItem.getId());
}
}
Thanks
Yasir