3 Replies Latest reply: Jan 29, 2013 4:53 PM by Linda P RSS

    Corrupt Session Exception: while executing siebel data adaptor save

    Ravindra D-Oracle

      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) {
      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) {
                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 != "") {
           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