This discussion is archived
3 Replies Latest reply: Jan 29, 2013 2:53 PM by LindaP RSS

Corrupt Session Exception: while executing siebel data adaptor save

Ravindra D Newbie
Currently Being Moderated
Hello,

I wrote a custom handler which saves case to siebel and then raise a portlet event.

I implemented a custom event handler to first save the case to siebel and then raise portlet event

it gives me following error:

ERROR com.oracle.determinations.portlet.InterviewPortlet - com.oracle.determinations.interview.engine.exceptions.CorruptSessionException: A unauthorised change to the Rule Session has been detected.

code template:

public void handleEvent(Object sender, OnAfterProcessActionEvent event) {
log.info("handleEvent");
InterviewSession session=event.getSessionContext().getInterviewSession();
SecurityToken token =event.getSessionContext().getSecurityToken();
// Illustrate accessing the SessionContext to check whether goals are known
if (session != null) {
     log.info("Interview Session exists");
     Rulebase rb=session.getRulebase().getRulebase();
     Entity globalEntity=rb.getGlobalEntity();
     EntityInstance eInst=event.getSessionContext().getInterviewSession().getRuleSession().getGlobalEntityInstance();
     Attribute attr=globalEntity.getAttribute("o_interview_complete");
     //log.info("o_interview_complete attribute value is"+attr.getValue(eInst));
InterviewGoal[] goals = event.getSessionContext().getInterviewSession().getGoalService().listTopLevelGoals();

for (InterviewGoal goal : goals) {
     if(goal.getId().equals("Attribute~o_interview_complete~global~global"))
     {
          log.info("checking is the intervie complete");
if (goal.isKnown()) {
log.info("=======Save the application first======" + goal.getId() + "~~~~~~goal text~~~~~~~"+goal.getText()+" is known");
Attribute submitGoalAttr = globalEntity.getAttribute("o_interview_complete");
     Attribute idAttr = globalEntity.getAttribute("io_case-id");
     Attribute submitFlagAttr = globalEntity.getAttribute("io_submit_event");
     Boolean autosave = (Boolean)submitGoalAttr.getValue(eInst);
     
          if (autosave!=null && autosave) {
     SessionContext currentContext = event.getSessionContext();
     
     
     //String caseID = currentContext.getCaseID();
     String caseID = "test"; // manual caseID for debug
     String newCaseID = "";
     
     //This calls the DataAdaptor save() when the investigation finishes to save the user's application to Siebel
     if(caseID != null) {
     newCaseID = session.getDataAdaptor().save(token, caseID, session);
     if(newCaseID != "") {
          
     currentContext.setCaseID(newCaseID);
     }
     submitFlagAttr.setValue(eInst, true);
     }
     
          idAttr.setValue(eInst, newCaseID);

          }
// SecurityToken token = session.getRuleSession().get

log.info("Sending GoalKnown event for Goal ID " + goal.getId());

QName qname = new QName("http://oracle.com/opa/interview/portlet/10.0" , "GoalKnown");
event.getActionResponse().setEvent(qname, goal.getId());
} else {
log.info("goal " + goal.getText() + " is unknown");
}


is there anything wrong i am doing here.
I am just trying to excute a data adaptor save and then raise portlet event.

Edited by: 920877 on Jan 28, 2013 7:20 PM

Legend

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