JBoss Community

Re: Persist Entity from within ScriptTask - best practice?

created by William Timpany in jBPM - View the full discussion

Thanks for theadvice,    using the Service Task was easier than I expected.    

 

Following the instructions in the example worked.  Just a little bit of extra config was required to get the "Service Task" added to the "KnowledgeSession" in "Spring".

 

 

e.g.  Spring Config

 

<

bean id="jboss.jbpm.serviceTaskHandler" class="org.jbpm.bpmn2.handler.ServiceTaskHandler" />

 

 

<

bean id="jboss.jbpm.knowledgeSession1.workItemManager" factory-bean="jboss.jbpm.knowledgeSession1" factory-method="getWorkItemManager"/>

 

 

 

 

 

 

 

 

 

 

 

<

bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean"

>

 

   <property name="targetObject" ref="jboss.jbpm.knowledgeSession1.workItemManager"/>

 

   <property name="targetMethod" value="registerWorkItemHandler"/>

 

   <property name="arguments">

 

      <list>

 

         <value>Service Task</value>

 

         <ref bean="jboss.jbpm.serviceTaskHandler"/>

 

      </list>

 

   </property>

 

</bean>



Reply to this message by going to Community

Start a new discussion in jBPM at Community