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

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 - A unauthorised change to the Rule Session has been detected.

code template:

public void handleEvent(Object sender, OnAfterProcessActionEvent event) {"handleEvent");
InterviewSession session=event.getSessionContext().getInterviewSession();
SecurityToken token =event.getSessionContext().getSecurityToken();
// Illustrate accessing the SessionContext to check whether goals are known
if (session != null) {"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");
     //"o_interview_complete attribute value is"+attr.getValue(eInst));
InterviewGoal[] goals = event.getSessionContext().getInterviewSession().getGoalService().listTopLevelGoals();

for (InterviewGoal goal : goals) {
"checking is the intervie complete");
if (goal.isKnown()) {"=======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"Sending GoalKnown event for Goal ID " + goal.getId());

QName qname = new QName("" , "GoalKnown");
event.getActionResponse().setEvent(qname, goal.getId());
} else {"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


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