kh4m khurram [https://community.jboss.org/people/kh4m] created the discussion

"Unable to Autowire in AssignmentHandler"

To view the discussion, visit: https://community.jboss.org/message/734450#734450

--------------------------------------------------------------
Hi good noon,

I am facing problem in my CustomAssignmentHandler class that implements 
AssignmentHandler

> package com.tabs.bcrs.bpm.handler;
> 
> import org.jbpm.api.model.OpenExecution;
> import org.jbpm.api.task.Assignable;
> import org.jbpm.api.task.AssignmentHandler;
> import org.springframework.beans.factory.annotation.Autowired;
> import org.springframework.stereotype.Component;
> 
> import com.tabs.bcrs.custombpm.service.BPMCustomService;
> 
> @Component
> public class CustomAssignmentHandler implements AssignmentHandler {
> 
> 
>     @Autowired
>     BPMCustomService bpmCustomService;
> 
> 
>     String assignee;
> 
>     /**
>      * 
>      */
>     private static final long serialVersionUID = 7980992364382900445L;
> 
>     public void assign(Assignable assignable, OpenExecution openExecution)
>             throws Exception {
>         System.out.println("Assignee: " + assignee);
>         //assignable.addCandidateUser("userId");
>         assignable.addCandidateGroup(assignee);
>         openExecution.createVariable("node", 
> openExecution.getProcessInstance().getActivity().getName());
> 
> 
> 
>         bpmCustomService.getTaskListOfSpecificGrp("ChecklistWindowGroup");
> 
> 
>     }
> 
> 
The problem is my object bpmCustomService generates NullPointer Exception as it 
seems it is not properly autowired using @Autowired. Can anybody help me out 
please??
Your help is appreciated.
Khurram
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/734450#734450]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to