How to implement and add an extended service to EasyVIPER?
As EasyVIPER is an extensible engine, it is possible to add specific services, thanks to the com.ebmwebsourcing.easyviper.core.api.engine.thread.service.Service interface.
To create a new extended service, the basic thing is to develop a class implementing this interface, and then to add the service to a core instance of EasyVIPER.
A good way to perform this task follows these steps:
- Create an interface that extends Service with specific operations
- Create the class implementing MyExtendedService and extending the utility abstract class AbstractServiceImpl:
The method run() can be filled as in the example for a by default behaviour.
Once done the new MyExtendedServiceImpl service can be added to EasyVIPER core with the following code:
In order to call methods of the extended service you can use the following code:
Finally a good way to conceive an extended service is to start from a formal description of its interface, with a WSDL definition for example.
Then, the corresponding Java interface can be generated thanks to CXF wsdl2java facilities. The interface of MyExtendedService is then extending the EasyVIPER service and the description interface:
The implementation class development is then led by the formal description.
How to implement an extended behaviour in EasyVIPER?
As EasyVIPER is an extensible engine, it provides a way to implement new behaviours, in addition of the existing ones.
To create a new behaviour, you have to extend the com.ebmwebsourcing.easyviper.core.service.extended.behaviour.api.ExtendedBehaviour interface.
A good way to process is to perform the following steps:
- Create an interface that extends the ExtendedBehaviour interface:
- Create an implementation that implements this interface and extends the utility abstract class AbstractExtendedBehaviourImpl:
The main method to fill is executeOnInactive(). It is the one that will be executed when the execution token crosses over the behaviour.
How to add Frascati Explorer into your EasyVIPER application?
You have to add these dependencies:
Version 1.4.1 is compliant with 1.4.X versions of EasyVIPER.
Then the following code allows to add any SCA component (EasyVIPER core for instance) into the Frascati Explorer GUI:
This will launch Frascati Explorer at runtime.