0 Replies Latest reply on May 9, 2012 5:09 AM by kh4m

    Unable to Autowire in AssignmentHandler

    kh4m

      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