Page 1 of 1

Issue with Custom Activity in Extended Workflow

Posted: Sat Apr 04, 2015 10:14 am
by gvsrini
I have implemented an extension to Order Workflow by adding a new Activity. I need this Activity to use a new Service (ExtInterfaceService) that I implemented in core.

The issue is I am able to Inject ExtInterfaceService into several other Controllers and other Services, but as soon as I add it to my new Activity, the server fails to start with the Exception:
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'extInterfaceService' is defined.


I don't see how it is able to auto-wire other controllers/services and not Workflow activity. This is how I have defined my class.

Code: Select all

@Service("extInterfaceService")
public class ExtInterfaceServiceImpl implements ExtInterfaceService


I even went to the extent of wiring it by hand by doing the following in both one controller as well as my extended activity to see the difference:

Code: Select all

context.getBean("extInterfaceService",ExtInterfaceService.class);


I have noted that the context object is different in Controller and Activity. The bean is found in the context retrieved in Controller, but the context in Activity does not have this bean! How can that be possible? It appears I have to learn web application programming from the ground up now!

If I create a new instance of the object manually, the application works fine. So, it's not a showstopper for now, but I do want to understand what's going on behind the scenes.