[midPoint] objectClass not recognized in groovy sync

Jason Everling jeverling at bshp.edu
Tue Feb 5 21:48:04 CET 2019


I setup a resource with different classes to sync and ran into a bug maybe?
Anyone using sync with multiple classes?

When using if objectClass == "Organization" or even case "Organization" it
doesn't work. Looking at the logs the Organization objectClass is not
passed but is actually passed as __ALL__ , Account is passed correctly as
__ACOUNT__

Error:
objectClass __ALL__ is not implemented in this script

Example:
case "SYNC":
def result = []
def tstamp = null
if (token != null){
tstamp = token
} else {
def today= new Date()
tstamp = today.getTime();
}
switch (objectClass) {
case "__ACCOUNT__":
sql.eachRow("SELECT * FROM userTable1 WHERE lastChanged > ${tstamp} ORDER
BY uuid",
{result.add([operation:"CREATE_OR_UPDATE", uid:it.uuid,
token:it.lastChanged,
attributes:[firstname:it.firstname,initials:it.initials,lastname:it.lastname,__ENABLE__:!(it.disabled
as Boolean)]])}
)
break;
case "Organization":
sql.eachRow("SELECT * FROM orgTable1 WHERE lastChanged > ${tstamp} ORDER BY
org",
{result.add([operation:"CREATE_OR_UPDATE", uid:it.org,
token:it.lastChanged,
attributes:[identifier:it.identifier,description:it.description,dept_code:it.dept_code]])}
)
break;
default:
log.warn("Sync script: objectClass '" + objectClass + "' is not implemented
in this script")
}
log.warn("Sync script: found " + result.size() + " events to sync from " +
objectClass)
return result;

JASON
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20190205/02d1bce2/attachment.htm>


More information about the midPoint mailing list