mmm… I too have your book, and was happy to see the concept of process scoped beans mentioned, and get the above also.
When our app, starts up @PostConstruct gets called on our RunChecksServiceTask bean defined in activiti.cfg.xml,
i've implemented an empty @PostConstruct method, just so I can debug.
Later, when an instance of our process is created, and this task gets kicked off, I see that it's a different java instance then that which was constructed by Spring?
I'm totally confused, the scope of the RunChecksServiceTask is not specified in the activiti.cfg.xml( so it is a singleton). I would have thought that Activiti give back the same instance that was initalised when Spring started up?
<code>
<bean id="runChecksServiceTaskBean" class="path to our process package.RunChecksServiceTask">
<property name="executor" ref="executor" />
<property name="sessionFactory" ref="workFlowSessionFactory" />
</bean>
</code>
in the process xml we have…..
<code>
<serviceTask id="runChecksServiceTask" name="Run Checks" activiti:delegateExpression="${runChecksServiceTaskBean}"> </serviceTask>
</code>
I think I'm missing something fundamental here.. I'm looking for a Eureka moment. Using Spring 4.11, Activiti 5.14.
In your book you say use the process scoped concept used by sprinf-activity… but here you say 'No' to that. Can you advise what to do instead of scope="process" ? Thanks so much