Use model reflection module Audit trail create log java

I have a requirement to show different/readable member names in Audit Trail overview instead of technical attribute name. For this I can maintain names for all fields in Model reflection.  But am unable to retrieve the entity from Model reflection in Audit trail create log java(added model reflection packages import). I have current audit log object with me and i want to retrieve same entity from model reflection module so that i can use the readable name set for technical attribute and put this in log member name field.  Any idea how to do this?
2 answers

Hi Sowmya,

Do a cast activity on the AuditTrailSuperClass object. This will give you the entity, hence you can deduce the entity name (module + entity). Retrieve the MxObjectType from database by completename attribute.


Hi Team ,

By using below code we able to retrieve  ModelObjectMember on the basis of Input Object.


1. When I try to cast IMendixObject into MxObjectMember it gives us error.

2. we  are creating a New list of members of the basis of log value(True) but we are not able to add by using Add method.

Please find Code snapshot I am using for same.

Request you all  to give me some way out from this issue. 


            String a =inputObject.getType().toString();
            List<IMendixObject> mxobj1list1=  Core.retrieveXPathQueryEscaped(sudoContext,"//%s[%s='%s']","MxModelReflection.MxObjectType","CompleteName",a);
            IMendixObject mxobj = mxobj1list1.get(0);
            //List<IMendixObject> mxobj1list12= Core.retrieveXPathQueryEscaped(sudoContext,"//%s[%s=%s]","MxModelReflection.MxObjectMember","MxModelReflection.MxObjectMember_MxObjectType",String.valueOf(mxobj.getId().toLong()));
            List<IMendixObject> mxobj1list12= Core.retrieveXPathQueryEscaped(sudoContext,"//%s[%s=%s][%s='%s']","MxModelReflection.MxObjectMember","MxModelReflection.MxObjectMember_MxObjectType",String.valueOf(mxobj.getId().toLong()),"Log","True");
            Collection<? extends IMendixObjectMember<?>> members2 = inputObject.getMembers(sudoContext).values()  ;
            Collection<? extends IMendixObjectMember<?>> members = inputObject.getMembers(sudoContext).values()  ;
            for (int i = 0; i <=mxobj1list12.size(); i++) 
                    MxObjectMember obj1 = (MxObjectMember) mxobj1list12.get(i);
                    for (IMendixObjectMember<?> member : members) 
                    if (obj1.getAttributeName(sudoContext).toString()==member.getName().toString())
                    members2.add(member);//giving error over here