4 Replies Latest reply on Aug 28, 2012 11:47 PM by Davin Fifield-Oracle

    Question search with Java application and stateless determinations server

      We want to use a stateless (because of high-availability reqruirements) OPA determinations server with a java-based application, where we want to put our complex business logic decisions in OPA. How can we mimic the web-derterminations functionality of question search? During an evaluation of a rulebase, it is possible that not all attributes that are needed to reach a conclusion are available. If that situation occurs, we want to provide these attributes to the java appliation, which can search its database or ask extra questions. The decision report seems to contain this information, but if so, how should we interpret it? Is it possible to retrieve one or more following question(s) from it is are there any (sample) code available to do this?

        • 1. Re: Question search with Java application and stateless determinations server
          Ben Rogers
          Hi Phillip,
          You can mimic web-determinations almost exactly using the ODS interview service. You create a session, and then run investigations in the same way as you do on screens, and the interview service will return the questions required until the goal is complete. This can interact with actual screens in the rulebase (even though you are not using OWD), so you can customise the order of data input (and the groups of data which need to be input) in the same way that you can with OWD.

          These are useful references:


          This is normally suitable for an interview with custom UI layer instead of OWD.

          It may be much simpler in your case to stick with the ODS assess service and request a decision report but use the outcome-style as "base-attributes" on the first pass. This will list all the base attributes required to make that decision. Any base attribute which it needs, but are missing, will be listed as unknown-val. You could use this response to then search the database for the missing fields, and fire the request again with the additional fields.

          Those are a couple of options to explore!

          • 2. Re: Question search with Java application and stateless determinations server
            Davin Fifield-Oracle
            Great answer Ben.

            It's also worth briefly pointing out that the OPA Determinations Server Interview web service is stateful (it keeps the interview session in memory between calls), whereas the Assess web service is completely stateless.

            • 3. Re: Question search with Java application and stateless determinations server
              Hi Ben,

              Thanks for the quick response. Given our requiremenst concerning high-availability, I have investigated the stateless solution some more. I built a sample rulebase to look into the behaviour of the "base-attributes" parameter.

              In the example below, I try to reach the top-level goal: "the opa implementation is succesful", first without adding any base attributes. All the relevant base attributes are shown, but how can I read the report to select the next question to ask: is it always the first unknown value under the topgoal?

              The following rulebase:

              the opa implementation is successful if
              the functionality is implemented according to specs
              the organization is enthusiastic about business rules
              the business-rules are well-formed

              the business-rules are well-formed if
              the business-rules are divided into more rule sets
              the business rules can be compiled

              the non-relevant goal is reached if
              the non-relevant question is asked

              Leads to the following webservice, in which I use the base-attributes parameter:

              <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:typ="http://oracle.com/determinations/server/10.4/Inferencetest/assess/types">
              <typ:opa-impl-succesful unknown-outcome-style="base-attributes" known-outcome-style= "value-only">

              leads to:

              <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:i18n="http://www.w3.org/2005/09/ws-i18n" xmlns:typ="http://oracle.com/determinations/server/10.4/Inferencetest/assess/types">
              <typ:opa-impl-succesful type="boolean" inferred="false">
              <typ:decision-report report-style="base-attributes">
              <typ:attribute-node id="dn:0" entity-id="global" instance-id="global" hypothetical-instance="false" attribute-id="opa-impl-succesful" type="boolean" text="Is the opa implementation successful?" inferred="false">
              <typ:attribute-node id="dn:1" entity-id="global" instance-id="global" hypothetical-instance="false" attribute-id="func-impl-according-to-specs" type="boolean" text="Is the functionality implemented according to specs?" inferred="false">
              <typ:attribute-node id="dn:2" entity-id="global" instance-id="global" hypothetical-instance="false" attribute-id="organisation-enthusiastic" type="boolean" text="Is the organization enthusiastic about business rules?" inferred="false">
              <typ:attribute-node id="dn:4" entity-id="global" instance-id="global" hypothetical-instance="false" attribute-id="business-rules-divided-rule-sets" type="boolean" text="Are the business-rules divided into more rule sets?" inferred="false">
              <typ:attribute-node id="dn:5" entity-id="global" instance-id="global" hypothetical-instance="false" attribute-id="rules-compilable" type="boolean" text="Can the business rules be compiled?" inferred="false">

              Edited by: Philip Jan de Lang on 28-aug-2012 16:34
              • 4. Re: Question search with Java application and stateless determinations server
                Davin Fifield-Oracle
                Hi Philip, it would be a good idea to post this question on a separate thread, since this one is already marked as answered.