4 Replies Latest reply: Aug 7, 2013 8:24 PM by Frank.Hampshire-Oracle RSS

    Create a Custom Screen




      I am trying to work through the Custom Screen Example from the OPA Developers Guide located here http://docs.oracle.com/html/E41094_01/toc.htm


      I am stuck at Step 3 as below :


      Step 3. Create the external web application

      The last step is to create a simple servlet application where the user will be redirected by the custom screen. The servlet code can be found in <runtime_zip_dir>examples\web-determinations\custom-screen\ExampleCustomScreenWebApp. The servlet has two classes:

      • ExternalProcessingSystem.java
        the servlet that will be displayed. This screen contains two buttons: one will cause the user to return to Web-Determinations, and the other button keeps the user on the current screen while simulating passing of data to Web-Determinations.
      • web.xml
        the servlet configuration.

      To create the external web application:

      1. Create and test the servlet.
      2. Package the application as a WAR file then deploy it to the same server where Web-Determinations is running.
      3. Restart the server; your customscreen should now be working.
      4. Start the interview. Notice that when you click on the goal, you are now redirected to the external web application.


      I am struggling with how to create and test the Servlet and how to appropriately package it. Any advice would be much appreciated....



        • 1. Re: Create a Custom Screen

          Further info......

          Problem 1 : I cannot get the WAR file for Step 3 included in the example source code to work locally


          I am deploying it to:


          C:\Program Files (x86)\Oracle\Policy Modeling\EmbeddedTomcat\work\WebRunner\localhost\web-determinations9000


          Is this the correct location? Are there any additional steps I have to do with the WAR file? Or have I done something wrong earlier in the example?


          The TestCustomScreen rule-base doesn't seem to be able to locate it.


          Problem 2 : I cannot get the Example Web App packaged in the WAR file  to Integrate with the TestCustomScreen Rule-base on Weblogic


          Because I was having trouble with the Embedded Tomcat Server I attempted to deploy onto our weblogic server.
          I have tried deploying both the TestCustomScreen rule-base and Web App to our web-logic server.
          I can get the example web app to deploy ok from the WAR file provided and it works fine in isolation but it doesn't integrate with the TestCustomScreen rule-base.


          Does the example web app needs to be deployed with a specific name? This isn't clear in the documentation, I have used ExampleCustomScreenWebApp.
          Or would the problem be in the rule-base itself?


          Any help or tips you could provide on this matter would be much appreciated.

          • 2. Re: Create a Custom Screen

            To solve problem 1, i would recommend getting your own tomcat, making sure it is running and then deploying the web application to that tomcat rather than trying to use the OPM embedded tomcat as a first try/


            For problem 2, your description is a little vague, can you give details on where it is failing? It might be worth looking at the tomcat log files and posting any stack traces or error messages there.




            • 3. Re: Create a Custom Screen

              Hi Frank,


              Managed to fix problem 2.  I just deployed the custom web application as a WAR file called TestCustomScreen onto the weblogic server and renamed the deployment of the OPA rule-base WAR file as TestCustomScreenExample.  I wouldn't have been able to name them both the same which was what caused the confusion for me as the documentation and example source code seem to imply this.


              For problem 1 If I deployed my own version of Tomcat locally could I call the custom web application from the embedded tomcat server or would I also have to deploy the OPA rule-base to my own version of Tomcat as well? I think that I would have to deploy the OPA rule-base as well??


              Many Thanks


              Rob North

              • 4. Re: Create a Custom Screen



                You can deploy a rulebase by copying the <rulebasename>.zip from the <project>/output directory after its built, to the WEB-INF/classes/rulebases directory of your expanded customized web determinations.


                If you do want to use the embedded tomcat in OPM, then you can customise anything in <project>\Release\web-determinations and it will be built and run when you build the project.


                Using your own tomcat is often better as with custom development you will often need to check the web application error logs, and they are easier to find in your own tomcat