JBoss Community

Re: ProcessMgmtFacade.java - Custom REST Call

created by Chris Melas in jBPM - View the full discussion

Hello,

In order to add your own REST API all you have to do, more or less, is to add classes with jax-rs annotations specifying the urls of your services (take a look at the existing ProcessMgmtFacade as well as the modifications done  by priyakpandey to get the idea), in addition take a look in web.xml entries related to jax-rs and resteasy you might need to add something related to your additional url paths. Maybe also add your classes in

jax-rs Application class org.jboss.bpm.console.server.ConsoleServerApplication as singleton (check the code of ConsoleServerApplication regarding the other jax-rs classes).

 

Since you use the gwt-console-server API you'll need the objects created inside ProcessMgmtFacade so if you want to change existing functionality the simplest approach is to modify that (by adding new methods or changing existing ones as described in http://community.jboss.org/message/612597).

 

If you want to use your own class to override functionality you could extend ProcessMgmtFacade with your own class and add all your new logic there. However in order to overide the urls you would have to define the same jax-rs paths in your file and maybe remove the same ones from ProcessMgmtFacade and probably have to modify the jax-rs Application class org.jboss.bpm.console.server.ConsoleServerApplication to add your class as singleton....haven't tried it to be honest and it gets a little messy.

 

The fact is that on each update of jbpm, since you use the gwt-console-server, whether you make the changes in the existing code or on your own file, you will either have to make those changes or add your file each time. Not a good practice for large scale changes etc indeed but  unfortunately no other extension points, to the existing REST API system i think.

Reply to this message by going to Community

Start a new discussion in jBPM at Community