Policy Automation for B2C Service

Get Involved. Join the Conversation.

Topic

    Eric S
    Pass Login ID to OPA interview from External Application
    Topic posted January 17, 2019 by Eric SSilver Medal: 2,000+ Points 
    113 Views, 1 Comment
    Title:
    Pass Login ID to OPA interview from External Application
    Summary:
    Add Login ID to embedded interview in internal application
    Content:

    We are looking at creating an interview that we can embed on our website that is not hosted on the Oracle Service Cloud. 

    In reading through the documentation on embeding an interview in another application using a div, I am seeing an option to include Seed Data. 

    Looking at the example script, can I add a query that would pull the Login ID from my system and add it as a seeddata element in this script that I could pass to the OPA interview to identify the Contact. Would that then allow me to connect the interview to the Contact in the Oracle Service Cloud so that I can create an Incident tied to that Contact? 

    I'm still pretty new to OPA, and am wanting to figure out this solution as our web team would rather embed the interview rather than taking the user to the OSvC Customer Portal.

    http://documentation.custhelp.com/euf/assets/devdocs/unversioned/PolicyAutomation/en/Default.htm#Guides/Developer_Guide/Web_Interviews/Integration/Embed_an_interview_in_another_application.htm#div
    
    Version:
    18C
    Code Snippet:

    Comment

     

    • Niamh NicClamha

      Hi Eric,

      The following should work:

      <script>
          var el = document.getElementById("interviewDiv");
          var webDeterminationsUrl = "https://xxxx.custhelp.com/web-determinations";
          var deploymentName = "LoanAdvisor";
          var locale = "en-GB";
          var seedData = {"my_id" : "12345"};
          OraclePolicyAutomationEmbedded.StartInterview(el, webDeterminationsUrl, deploymentName, locale, null, null, seedData );

      </script>

      Where my_id is the attribute name and "12345" is replaced with the value you wish to set it to. I believe the two null parameters are required as placeholders for opaUser and params as per OraclePolicyAutomationInterview.StartInterview(el, webDeterminationsUrl, deploymentName, locale, opaUser, params, seedData, onLoad, onNavigate) but I haven't tried without them.