This discussion is archived
2 Replies Latest reply: Jul 12, 2012 3:59 PM by Andrew Higginbottom RSS

Rulebase data inside implementation of BeforeSubmitDataEventHandler Plugin?

943802 Newbie
Currently Being Moderated
Inside an implementation of the BeforeSubmitDataEventHandler interface I wish to retrieve the rulebase data that is determined within the interview but never displayed on the screen.

The current method of getscreen data will not work within the EventHandler code as it only pulls the last screen data.

Any ideas on how to do this?

~Chandra
  • 1. Re: Rulebase data inside implementation of BeforeSubmitDataEventHandler Plugin?
    887112 Newbie
    Currently Being Moderated
    Which API can be used to view all global attributes? Can anyone give example code code on how to do this?

    When a session is created we are using a java plugin to create or seed an entity, this entity cannot be inferred because questions are asked directly about it. With our current implementation of the plugin we are using the OnSessionCreatedEvent handler to know when to create the entity, the problem is that the event handler is triggered when a session is loaded as well which causes the session to crash since the same entity already exists.

    We also tried using the OnInvestigationStarted event handler and this is triggered on a load session as well.

    Our idea was to determine within the rulebase whether the session is a new or load session by counting the entity instances and if they are greater than 0 then the session is a load session.

    The problem is we have not been able to see this global attribute that is inferred, we have just been able to view screen data from the current screen.
  • 2. Re: Rulebase data inside implementation of BeforeSubmitDataEventHandler Plugin?
    Andrew Higginbottom Explorer
    Currently Being Moderated
    The key to getting the values is getting a reference to the InterviewSession object. Once you have this reference you can access all the current session data.

    Many event handlers provide this object, one way or another. The OnSessionCreatedEvent provides it directly, via its getCreatedSession() method.
    InterviewSession myInterviewSession = OnSessionCreatedEvent.getCreatedSession();
    A much better explanation than I could give on this is contained in the OPA Developer Help. Specifically on the page at:

    http://docs.oracle.com/html/E29403_01/Content/Technical%20Reference/Exrtensions_Undstnd_IntSess.htm

    An extensive code sample is provided on that page under the section "Sample code - Using Instance Data".

    Regards
    Andrew

Legend

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