Hello [edited to re-word problem],
I am using the new java PSDK 8.5, specifically the ConfObject and the ConfObjectDelta classes.
So I have 2 ConfObject instances and I need to work out if the 2 objects are different.
There is a ConfDeltaUtility.createDelta(ConfObject originalObject, ConfObject changedObject)
which returns a ConfObjectDelta. This is really handy.
My problem is that when the 2 objects have identical values, it still returns a ConfObjectDelta
and I cannot work out if there was a difference at all in the result.
This resulting ConfObjectDelta when both objects are the same looks like the following,
with only the DBID (which has to be present)
I want to know how one would work out if the objects are the the same.
There is no way I can see to ‘examine/access’ this object to see that there are
no attributes apart from the DBID.
Doing an .equals() wont work for me cos the it’s not the same instance, just an instance with same values.
I am not using this comparing of two configuration object, but from my point of view the way through the toString methods is not good. ToString method in general is not good to use Or it is necessary to use it properly.
Anyways, for future reference, in case Genesys not add anymore functions to the ConfObjectDelta class,
this is another way it can be done.
Apologies but am using python syntax (cos that is what I use for this).
Given we have a ConfObjectDelta instance called confObjectDelta and it is a result of comparing 2 CFGDns.
Get the conf object inside the ConfObjectDelta
confObject = confObjectDelta.getOrCreatePropertyValue(“deltaDN”)
Iterate through all the attributes, can use either getIndex() or getMappingName()
isDifferent = False
for attributes in confObject.getClassInfo().getAttributes():
if confObject.getPropertyValue(attributes.getMappingName()) == "DBID":
continue
if confObject.getPropertyValue(attributes.getIndex()) is not None:
isDifferent = True
break
There
It would have been much easier if the ConfDeltaUtility.createDelta() returned a null or something
to indicate that there are no changes. Or so I think.