JBoss Community

How the java task is instantaited and also how about its associated java classes.

created by Felix Jose in jBPM - View the full discussion

Hi All,

 

I am using JBPM with Spring.

 

My process definition contains Java tasks as follows:

 

process name="ddrRequest" xmlns="http://jbpm.org/4.3/jpdl">
<start g="612,-10,48,48">
  <transition g="-68,-6" name="analystResearch"
   to="analystResearch" />
</start>
<java  class="com.collabera.poc.jbpm.custom.ReviewerResearchImpl" method="printHelloWorld" var="request"
  name="analystResearch" g="198,171,80,40">
<arg><object expr="#{request}"/></arg>
      <transition g="-68,-18" name="startDecisionHandler" to="startDecisionHandler"/>
    </java> <decision g="431,94,48,48" name="startDecisionHandler">
  <handler />
  <transition g="991,122:-112,-18" name="to Waiting Assignment"
   to="Waiting Assignment" />  
  <transition g="-104,-18" name="to Being Researched" to="Being Researched" />
</decision>

 

And the java task class(com.collabera.poc.jbpm.custom.ReviewerResearchImpl) is as follows:

 

public class ReviewerResearchImpl {
/**
  *
  */
private static final long serialVersionUID = 1L;

private RequestService requestService;

public RequestService getRequestService() {
  return requestService;
}

public void setRequestService(RequestService requestService) {
  this.requestService = requestService;
}


public ReviewerResearchImpl() {

}

public DdrRequest printHelloWorld(Request request) {
  System.out.println("Region=========="+request.getRegion());
  request.setRegion("CHINA");
  //Database update
  requestService.saveRequest(ddrRequest)
 
  return request;

}


}

 

My doubt is I am using spring also So when instantiating the  com.collabera.poc.jbpm.custom.ReviewerResearchImpl class from the jbpm  whether its property RequestService requestService also gets instatiated because in spring config file I have the following snippet:

 

<bean id="reviewerResearch" class="com.collabera.poc.jbpm.custom.ReviewerResearchImpl">
 
  <property name="requestService">
   <ref bean="requestService" />
  </property>
</bean>
<bean id="requestService"/>

 

If not how can i make use of Spring to instantiate the jbpm java task class (for Eg: com.collabera.poc.jbpm.custom.ReviewerResearchImpl) and its associated classes (for eg:RequestService requestService).?

 

Please let me know about this as soon as possible. I have stucked in this point. PLease help......

 

 

Thank You and Regards,

Felix K Jose

Reply to this message by going to Community

Start a new discussion in jBPM at Community