Error with core.retrievexpathquery

1
I am trying to improve the audittrial for the user. Using the MXModelReflection module I have been adding user-friendly readable names for attributes and assosications and introduced a new field (boolean) in the MxObjectMember entity which allows me to define whether a member should be included in the audittrial log or not. This is because currently the log displays all fields in the domain model however some are just used internally and should remain hidden for the user. I have created a retrievexpathquery however it returns the following error. I personally think it has something to do with the context that I am passing through. Was thinking whether I should just use an xpath constraint on the datagrid itself to hide certain logline however I am sending out emails based on the log entries and it would be weired to receive one that there have been 7 changes but the user can only see 5 of them. An error has occurred while handling the request. [User 'lbika01' with roles 'SystemDeveloper'] -------- com.mendix.core.CoreException: Exception occurred in action 'EventExtendedAction :: - action: [CommitAction:: Context:Context::[Session [70c23eb4-a213-4296-b0d1-1cf0fc62ddb0]]] - before: [fc, SubmissionTracker.BC_ValidationCheck, AuditTrail.BCo_AudittrailSuperClass] - replace: null - after: [SubmissionTracker.IV_InformUserOfSubmissionCreation] ', all database changes executed by this action were rolled back at com.mendix.core.actionmanagement.CoreAction.d(SourceFile:553) Caused by: com.mendix.core.CoreException: Exception occurred in microflow 'AuditTrail.BCo_AudittrailSuperClass' for activity 'Create log', all database changes executed by this microflow were rolled back at kP.b(SourceFile:251) Caused by: com.mendix.core.CoreException: Exception occurred in microflow 'AuditTrail.CreateLogForAudittrailSuperClass' for activity 'Log changes', all database changes executed by this microflow were rolled back at kP.b(SourceFile:251) Caused by: com.mendix.core.CoreException: kO: An exception has occurred for the following request(s): jE (depth = 0): //MxModelReflection.MxObjectMember[AttributeName=Planned_Submission_Date] at it.b(SourceFile:167) Caused by: kO: An exception has occurred for the following request(s): jE (depth = 0): //MxModelReflection.MxObjectMember[AttributeName=Planned_Submission_Date] Caused by: kO: Object 'MxModelReflection.MxObjectMember' doesn't contain member 'Planned_Submission_Date', exception occurred on mapping the following query: SELECT MxModelReflection.MxObjectMember.* FROM MxModelReflection.MxObjectMember WHERE MxModelReflection.MxObjectMember.AttributeName = MxModelReflection.MxObjectMember.Planned_Submission_Date at hC.v(SourceFile:280) Caused by: kO: Object 'MxModelReflection.MxObjectMember' doesn't contain member 'Planned_Submission_Date' at lT.a(SourceFile:186) at R.a(SourceFile:937) at R.a(SourceFile:886) at R.a(SourceFile:592) at R.a(SourceFile:168) at R.a(SourceFile:141) at hC.G(SourceFile:1420) at hC.v(SourceFile:246) at hC.a(SourceFile:145) at gl.b(SourceFile:117) at gl.a(SourceFile:87) at lx.a(SourceFile:69) at jC.a(SourceFile:47) at jm.a(SourceFile:222) at fG.b(SourceFile:121) at fG.a(SourceFile:63) at iu.a(SourceFile:58) at iu.executeAction(SourceFile:20) at com.mendix.systemwideinterfaces.core.UserAction.execute(SourceFile:49) at com.mendix.core.actionmanagement.CoreAction.call(SourceFile:473) at it.b(SourceFile:155) at com.mendix.core.Core.retrieveXPathQuery(SourceFile:819) at com.mendix.core.Core.retrieveXPathQuery(SourceFile:973) at audittrail.log.CreateLog.createSingleLogLine(CreateLog.java:110) at audittrail.log.CreateLog.createLogLines(CreateLog.java:99) at audittrail.actions.CreateAudittrailSuperClassLog.executeAction(CreateAudittrailSuperClassLog.java:42) at audittrail.actions.CreateAudittrailSuperClassLog.executeAction(CreateAudittrailSuperClassLog.java:21) at com.mendix.systemwideinterfaces.core.UserAction.execute(SourceFile:49) at com.mendix.core.actionmanagement.CoreAction.call(SourceFile:473) at it.b(SourceFile:155) at com.mendix.core.Core.execute(SourceFile:191) at hi.a(SourceFile:70) at kP.a(SourceFile:66) at eO.executeAction(SourceFile:96) at com.mendix.systemwideinterfaces.core.UserAction.execute(SourceFile:49) at com.mendix.core.actionmanagement.CoreAction.call(SourceFile:473) at it.b(SourceFile:155) at com.mendix.core.Core.executeSync(SourceFile:167) at is.a(SourceFile:71) at kP.a(SourceFile:66) at eO.executeAction(SourceFile:96) at com.mendix.systemwideinterfaces.core.UserAction.execute(SourceFile:49) at com.mendix.core.actionmanagement.CoreAction.call(SourceFile:473) at it.b(SourceFile:155) at com.mendix.core.Core.executeSync(SourceFile:167) at eo.f(SourceFile:74) at eo.a(SourceFile:35) at dd.execute(SourceFile:106) at com.mendix.core.actionmanagement.CoreAction.call(SourceFile:473) at it.b(SourceFile:159) at hS.execute(SourceFile:41) at ju.a(SourceFile:299) at ju.a(SourceFile:230) at ju.processRequest(SourceFile:174) at fC.a(SourceFile:71) at com.mendix.core.MxRuntime.processRequest(SourceFile:916) at com.mendix.m2ee.server.handler.RuntimeHandler.handle(RuntimeHandler.java:42) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:113) at org.eclipse.jetty.server.Server.handle(Server.java:334) at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:559) at org.eclipse.jetty.server.HttpConnection$RequestHandler.content(HttpConnection.java:1007) at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:747) at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:203) at org.eclipse.jetty.server.HttpConnection.handle(HttpConnection.java:406) at org.eclipse.jetty.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:462) at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:436) at java.lang.Thread.run(Unknown Source)
asked
1 answers
4

The stacktrace indicates that the following XPath retrieve is executed:

//MxModelReflection.MxObjectMember[AttributeName=Planned_Submission_Date]

This query cannot be executed because of this error:

Object 'MxModelReflection.MxObjectMember' doesn't contain member 'PlannedSubmissionDate'

I think that the XPath you intended to execute should be this (notice the quotes):

//MxModelReflection.MxObjectMember[AttributeName='Planned_Submission_Date']
answered