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.
Issues
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.
-------------------------------------------------------------------------------
try
{
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");
//System.out.println("mxobj1list1---"+mxobj1list12);
//System.out.println("mxobj1list1---"+mxobj1list1);
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);
obj1.getAttributeName(sudoContext);
for (IMendixObjectMember<?> member : members)
{
if (obj1.getAttributeName(sudoContext).toString()==member.getName().toString())
{
members2.add(member);//giving error over here
}
}
}