[midPoint] groovy , mulitple intents

Jason Everling jeverling at bshp.edu
Tue Jan 22 17:53:10 CET 2019


Within the scriptedsql groovy scripts, can intent be used? It's the first
of this for me, something like

if (intent == 'manager') {
switch (objectClass) {
    case "__ACCOUNT__":
    sql.eachRow("SELECT * FROM table ORDER BY id",
    {result.add([__UID__:it.id,
__NAME__:it.id,id:it.id,firstname:it.firstname,lastname:it.lastname,memberOf:it.memberOf.split(";")
as List])}
    );
    break
    default:
    result;
}
return result;
} else {
switch (objectClass) {
    case "__ACCOUNT__":
    sql.eachRow("SELECT * FROM table2 ORDER BY id",
    {result.add([__UID__:it.id, __NAME__:it.id,__ENABLE__:!(it.disabled as
Boolean),id:it.id,firstname:it.firstname,initials:it.initials,lastname:it.lastname,memberOf:it.memberOf.split(";")
as List])}
    );
    break
case "Organization":
    sql.eachRow("SELECT * FROM orgs ORDER BY guid",
    {result.add([__UID__:it.orgs, __NAME__:it.org,orgs:it.org
,identifier:it.identifier,description:it.description])}
    );
    break
    default:
    result;
}
return result;
}

JASON
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20190122/4799a8b0/attachment.htm>


More information about the midPoint mailing list