This discussion is archived
6 Replies Latest reply: Sep 11, 2013 3:40 PM by ross_c RSS

Multiple Conclusion based on input values

ross_c Newbie
Currently Being Moderated

Hello,

I think I have a similar request to this one: https://forums.oracle.com/message/9208952#9208952

 

Basically I have a requirement to return a list of required documents someone must upload based on their application. The plan is to invoke the Determinations Server via the web service interface to get a list of the Documents (these would be URLs)  required based on some fields. I'm not quite sure how to approach the rules and web service call so that I would get a list of documents back. I want to complete it in Excel and would like the URL as the conclusion with the attributes as the entry fields.

 

e.g. write rules like:

 

the value of field1the value of field2document requiring upload
XYhttp://mysite.com/mydocument1.pdf
XZ
XYhttp://mysite.com/mydocument2.pdf

 

and when I invoke the determinations service with values X and Y the response would be something like:

 

<typ:attribute id="document_to_upload" type="string" inferred="true">

     <typ:boolean-val>http://mysite.com/mydocument1.pdf</typ:boolean-val>

</typ:attribute>

<typ:attribute id="document_to_upload" type="string" inferred="true">

     <typ:boolean-val>http://mysite.com/mydocument2.pdf</typ:boolean-val>

</typ:attribute>

 

Can I do like above and how do I structure the rules and webservice calls to get a list of documents back? Or do I have to write a table of rules for each type of document and request an outcome/conclusion for each one to get the URL as the conclusion? Does one of the example projects that comes with the installation cover (or go close) a scenario like this?

 

Thanks,

Ross

  • 1. Re: Multiple Conclusion based on input values
    ChaseVoid Newbie
    Currently Being Moderated

    What you want does not make a logical sence. How can a single attribute hold two seperate values? You'll be better off using additional attributes or a child entity to represent multiple values.

  • 2. Re: Multiple Conclusion based on input values
    Paul Fowler Explorer
    Currently Being Moderated

    I will start with standard disclaimers that I don't work for Oracle, and simply writing rules that are not human readable and not based on policy can lead to less than optimal rulesets.  My answer is confined to the question at hand.

     

    Here is one of several answers to your question as hinted by the reply above.  See the OPM help topic "write rules that infer relationships and entities."

     

    Assuming that "the documents requiring upload" is relationship text to a child entity such as "the documents", then you could use a rule table in Word with inferred entities such as this example:

     

    the documents requiring upload

    "http://mysite.com/mydocument1.pdf"

    both

    the value of field 1 = "X" and

    the value of field 2 = "Y"

    or

    both

    the value of field 1 = "X" and

    the value of field 2 = "Z"

    "http://mysite.com/mydocument2.pdf"

    the value of field 1 = "X" and

    the value of field 2 = "Y"

  • 3. Re: Multiple Conclusion based on input values
    ross_c Newbie
    Currently Being Moderated

    Thanks @ChaseVoid and @PaulFowler

     

    I have written up my rules and I have tested them in the debugger, all working as expected. Now I'm trying to get them via the web service and I can't seem to get the value back, only the instance. My request is as below:

     

    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:typ="http://oracle.com/determinations/server/11.0/rulebase/assess/types">
       <soapenv:Header/>
       <soapenv:Body>
          <typ:assess-request>
             <typ:config>
             <typ:show-properties>true</typ:show-properties>
             </typ:config>
             <typ:global-instance>
                <typ:attribute id="bin_code">
                <typ:text-val>CHNY</typ:text-val>
       </typ:attribute>
       <typ:entity id="the_supplementary_documents" inferred="true">
                   <typ:instance id="x">
                    <typ:attribute id="supplementary_documents" outcome-style="value-only" />
                   </typ:instance>
                </typ:entity>
              </typ:global-instance>
          </typ:assess-request>
       </soapenv:Body>
    </soapenv:Envelope>

     

    The code given as an attribute input should return two supplementary documents and one informational document, which it looks like it finds but I'm not getting the value out of the instance. The response is below:

     

    <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/11.0/rulebase/assess/types">
       <SOAP-ENV:Header>
          <i18n:international>
             <i18n:locale>en_GB</i18n:locale>
             <i18n:tz>GMT-0500</i18n:tz>
          </i18n:international>
       </SOAP-ENV:Header>
       <SOAP-ENV:Body>
          <typ:assess-response>
             <typ:global-instance>
                <typ:attribute id="bin_code" type="text">
                   <typ:text-val>CHNY</typ:text-val>
                </typ:attribute>
                <typ:entity id="the_supplementary_documents" inferred="true">
                   <typ:instance id="0x74d5b205a0612b60"></typ:instance>
                   <typ:instance id="0x9163835e55979771"></typ:instance>
                </typ:entity>
                <typ:entity id="the_informational_documents" inferred="true">
                   <typ:instance id="0xc8730b5ed088cbce"></typ:instance>
                </typ:entity>
             </typ:global-instance>
          </typ:assess-response>
       </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>

     

    I'm sure it's a matter of passing a new element or adding an attribute to an element there but I can't work out which one. Any ideas?

     

    Thanks

  • 4. Re: Multiple Conclusion based on input values
    ChaseVoid Newbie
    Currently Being Moderated

    The reason you don't see it is because the document URL is being used as a relationship text. This is something from OPA perspective not integration. You may want to add new entity instance with an attribute say "the document URL" which will hold the necessary value (in your case the relationship text).

     

    Hope it makes sense.

  • 5. Re: Multiple Conclusion based on input values
    ross_c Newbie
    Currently Being Moderated

    Hey @ChaseVoid, thanks for the reply. I think I understand what you mean but I don't know how to mark it up in the rules. I will provide some more info on what I have an perhaps you could advise on where to add the changes? I'm not sure how to set an attribute for this inferred entity in the data tab or rules and then retrieve via web service. Based on the example below, through the web service I get the inferred instance for "http://domain.com/mydocument.pdf" but I can't figure out how to get the value of it.

     

    Rules example:

     

    the A314 document requires upload if

         the course code = "HBPA"

     

    the supplementary documents requiring upload

    "http://domain.com/mydocument.pdf"

    the A314 document requires upload

     

    Data tab:

     

    Global

              Enitity: the supplementary documents (the_supplementary _documents)

                         Attribute Text: the supplementary documents

                         Role: Goal

                         Name: supplementary _documents

              Relationship:

                         Text: the supplementary documents requiring upload

                         Target: Global

                         Type: Containment (Many To One)

     

    Debug example:

     

    course_code = 'HBPA'

     

    Data:

    Global

               | - the supplementary documents requiring upload

                   |

                   |- http://domain.com/mydocument.pdf

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points