Which IIQ version are you inquiring about?
8.3
Share all details about your problem, including any error messages you may have received.
Hello everyone.
In our project, we have several Certifications which are in the Staging phase. For each of these, we have a few hundred identities for which the certifier is not correct.
I was tasked with creating a Rule that can read a pair identity - certifier from a csv file, and reassign the certification items to the correct, certifier.
Currently i have been experimenting with the method: bulkReassign but with no sucess. The task runs with no errors, but there are no differences in the Certification itself.
Is it possible to achieve this?
for(Certification cert: certs){
List entities = cert.getEntities();
List currentCertifiers = cert.getCertifiers(); //Current certifiers
//Check the Entities being targeted by this Certification
for(CertificationEntity entity: entities){
List reassignItems = new ArrayList();
String currentTarget = entity.getIdentity().toLowerCase();
//See if the map of entity-certifier contains a new Certifier
if(pairsEntityCertifier.containsKey(currentTarget)){
String certifier = pairsEntityCertifier.get(currentTarget);
//Check if certifier is equal to the current one
if(!currentCertifiers.contains(certifier)){
System.out.println("Rule-ReadFile-Test Need to update the certifier: " + certifier + " -> " + currentTarget);
Identity requester = context.getObjectByName(Identity.class, "spadmin");
Identity recipient = context.getObjectByName(Identity.class, certifier);
List items = entity.getItems();
for(CertificationItem item: items){
reassignItems.add(item);
}
//System.out.println("Rule-ReadFile-Test - " + requester + " - " + reassignItems + " - " + recipient);
cert.bulkReassign(requester, reassignItems, recipient, "description", "comments", context.getConfiguration());
context.saveObject(entity);
context.saveObject(cert);
context.commitTransaction();
}
}
}
}