Tuesday, 19 July 2011

Solution for calling web-service or webmethod from drools-guvnor GUI


Create new package











Upload pojo model jar (client stub which is generated for your websevice. This you can generate  using jaxWS-client from myeclipse or eclipse inbuilt plun-in)

Specify the jar name

Click browse button and navigate to client stub jar location

Upload the client stub jar

Save your changes from file menu

Navigate to package folder and click on Edit menu
Click on advaced view to expand all imported types belongs to the client stub jar
 Make sure that Delete all imports coming from client stub jar(Note: These imports are cause to prevent for successfull build package)

 Switch to normal view by clicking on Basic view
Commit the changes from File menu
Bulid Package to vaidate and compile all the assests in package
 Create catogory from administarion tab.
Categories aid in Managing large number of rules / asserts. A Shallow hierarchy is recommended
Create new rule
Select intial category and type of rule DRL Rule (Technical rule - text ediot)
This is the way of calling webmethod. Specify the package name before the class or interface rather importing them as a global. Once you have done with implemenation save the changes from file menu and bulid the package.


 
This example shows calling webservice from rule using client stub generated by jaxWS-client.
You can also use any other tools or hand-written to generate  client  stub and upload them as a pojo model jar.

Used - Guvnor5.2.0-final  (Latest version of guvnor )