Skip to Content
Author's profile photo Arti Gopalan

Invoking Business Rules – Part 2

This blog is a continuation to the Invoking Business Rules – Part 1 – “Invoking Business Rules – Part 1”- on how business rules can be evaluated.

The scenario considered is the same as before – i.e., you have already created a rules project.  And that the rules project created here makes use of a XSD as its business object.

In the previous blog I have already mentioned one way of invoking rules i.e., look-up the rule engine EJB in your application. The second way in which rules can be used is by exposing the ruleset as a webservice and then using this webservice when required in the application.

To help you in generating a webservice for a ruleset easily, a web service generator tool has been provided in the SAP NetWeaver Business Rules Management Resources Center of the SDN. The link to this tool is – http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/10c6b0c3-0c50-2b10-97ac-e98ad72aaf8f. The tool is available in as a zip.

[One needs to note that this is an unsupported tool and is not a product feature as of yet. This is provided as an aid to developers to quickly create an XML service for Rules. This is equivalent to creating a Web service using a code based approach.]

The Rules Tutorial Center also has link to an article which will help you in generating the web service manually i.e., by using a code based approach. (http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/c082390a-035f-2b10-dc9d-befec4aff998)

Once this tool is downloaded from the given location, you need to make sure that the tool is configured correctly.  The tool has to be configured in the run.bat file available in the zip. Here, you need to mention information regarding  –

  1. JAVA_HOME (we need to set the path to the jdk to this variable)

  2.  JDI_WORKSPACE(we need to set the path to the workspace to this variable)

Once these changes have been made, there are few prerequisites specified which needs to be satisfied. The workspace –

  • needs to have at least one Web Module or J2EE DC (any dummy DC will also do)

  • atleast one DC in the workspace needs to reference BRMS FAÇADE

  • atleast one DC in the workspace needs to reference ENGFACADE/tc/bl/logging/api

  • atleast one DC in the workspace needs to reference JEE Engine Façade 

 

The next step is to use this tool to generate the web service. Mr. Velu has mentioned the steps to be performed to do this, very clearly in one of his blogs. The link to this in-detail blog, written by Mr.Velu is – Generate and Test your SAP Netweaver BRM Rules Web Service – Part 1

Assigned Tags

      4 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Matthias Heiler
      Matthias Heiler
      Hallo Arti,
      I was in the rules tutorial center. A well done job what you delivered here. Congratulations.
      But I couldn't start the application "BuyerRule" in the tutorial "how to use Assign Action". Every thing works fine. The build of the era file and webmodule have some warnings but where successful. Finally if I call the application as in the AVI file on my localhost:50000/BuerRule/invoke.jsp or with index.jsp the server says: Error: the requested resource/BuyerRule/indexjsp is not available.
      Details: File [BuyerRule/index.jsp] not found in application root of alias [/] of java EE application [sap.co./com.sap.engine.docs.example].
      Do you understand this error message?
      Cheers
      Matthias Heiler
      Author's profile photo Arti Gopalan
      Arti Gopalan
      Blog Post Author
      Hello Mattias,

      Thank you for you comments. 🙂

      Regarding the error you are getting - from the error message it seems that the ear has not been deployed correctly. It must be either some error at runtime or error in the jsp files itself. Can you please mail me the DCs so that i can check it out at my end?

      Regards,
      Arti

      Author's profile photo Former Member
      Former Member
      Hi Arti,
             I am using the Webservice generation tool for webservice of my rule. I configured the tool as per written in the "ReadMefirst.pdf", but it is throwing error that webservice could not be generated. I checked for the SDA name of the DC, it is correct. What all could be the possible reasons for that. Also, in the doc "ReadMeFirst.pdf", it is written "You can undo all the steps later on.". What does this signify, why do we have to create a dummy DC at all.
        My second problem is you have provided a link for manually creating webservice. That link navigates u to a blank page in SDN. Even a link in the doc provided for manually creating webservice navigates to the blank page.
          Please clarify all this.
      Author's profile photo Arti Gopalan
      Arti Gopalan
      Blog Post Author
      Hi Gaurav,

      I am assuming that your first question is related to - why a dummy DC needs to be created in the Development Configuration in the first instance? This needs to be done only if you are making use of a fresh workspace, where the required SCs have not been sync'd. This reason as you would have deciphered from before is just to ensure that all the SCs required by the tool are available at the workspace level.

      With regards to the second problem - I am not facing similar trouble but, i can send it across to you by mail. Can you pls contact me on my SAP mail id?

      Also, could you please send me a screenshot of the error you recieve?

      Thanks,
      Arti