This discussion is archived
5 Replies Latest reply: Jan 14, 2013 10:39 AM by 936586 RSS

OPA summary screen with link to dynamic pages

936586 Newbie
Currently Being Moderated
Hi,

I am trying to create an OPA rule using OPA 10.4.1 where the summary screen at the end of rule execution includes a link to different website.
Is there a way i can configure this website in a config/properties file instead of hard coding it in the rule itself? or is there a function that i can use to get the web URL from set of predefined values?

Regards
  • 1. Re: OPA summary screen with link to dynamic pages
    ChaseVoid Newbie
    Currently Being Moderated
    In OPM screen authoring window, create a new label in Summary Screen. Check the isHTML flag, and put in your URL.

    eg: < \a href = " www.google.com" target = "_blank" > Google < / a >

    Add a rule to control the visibility of this label.

    Edited by: ChaseVoid on Jan 9, 2013 12:59 AM

    to display the anchor tag in the reply (remove the initial \ from the a tag)
  • 2. Re: OPA summary screen with link to dynamic pages
    936586 Newbie
    Currently Being Moderated
    Thanks for the response.

    What you suggested is same as adding a static link to the summary screen(or any other screen where i want this link to be visible).
    The question i have is , is there a way we can specify "www.google.com" anywhere outside the rule as a variable/property and use it here?

    I am sure we can use java script to change the behavior of the page dynamically, but not sure if JS can access any properties defined outside the rule.

    regards,
  • 3. Re: OPA summary screen with link to dynamic pages
    ChaseVoid Newbie
    Currently Being Moderated
    Well, you could make the link configurable, but it' would be a bit of customization.

    Create a rule like (add a public name to it (eg:MY_URL)
    the key for the URL = "MyURL"

    and then, access this key value in via VTL in the VM files:
    #set($entityInstance = $screen.interviewSession.ruleSession.globalEntityInstance)
    #set($entity = $entityInstance.entity)

    #set($urlAttribute = $entity.getAttribute("MY_URL"))
    #set($url = $urlAttribute.getValue($entityInstance))

    and use *${$url}* to access the value of the KEY "*MyURL*", which you can define in messages.properties file
  • 4. Re: OPA summary screen with link to dynamic pages
    Ben Rogers Journeyer
    Currently Being Moderated
    What you could also do is create a text attribute somewhere in your system rules.
    Let's say you call it "the summary screen URL". give it a public name like summary_URL.

    Then you can just set this using rules:
    the summary screen URL = "http://www......"

    Then add a label on your summary screen, make sure you tick isHTML as Chase mentions:

    a href="%summary_URL%" ...> link to %summary_URL% .. /a

    the %% characters will substitute in the literal value of the summary screen URL, including in HTML.
    That can all be done out-of-the-box.

    As one more option in addition to this one and Chase's suggestion is that you could define a custom property at screen level, call it screenURL, and then put it in the appropriate place in the summary.vm template, then output it in the HTML using ${screen.getProperty("screenURL", "")}.

    If you don't need to do anything more, then you can go for the out of the box one as the simplest and easiest to maintain, as long as you don't have to do any translations etc.

    Hope this helps.
    Ben
  • 5. Re: OPA summary screen with link to dynamic pages
    936586 Newbie
    Currently Being Moderated
    Great, Thank you Ben and Chase.
    That is just the perfect answer i am looking for.

    Regards

Legend

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