Good night @Harikrishna_06 and @haideralishaik
Finally work’s, I really appreaciate your support and the suggestion´s in wich to updated the rule. the rule is forwarding to the TEST_BA workgroup, just I have another doubt why in the next line I couldn’t pass an Identityobject? and just only java datatype such as String, int, boolean, etc.
duenoActual = context.getObjectByName(Identity.class,currentIdentity);
this is the current version
Logger customLog = Logger.getLogger("com.Santander.CustomLog");
customLog.info("predelegation manager rule : Start");
String executiveWorkGroup = "Santander Workgroup Executive Members";
String baWorkGroup = "TEST_BA";
Map resultado = new HashMap();
Identity duenoActual = null;
boolean bandera = false;
CertificationEntity ce = (CertificationEntity)entity;
if(ce != null) {
String currentIdentity = ce.getIdentity();
duenoActual = context.getObjectByName(Identity.class,currentIdentity);
customLog.warn("current owner for certification is: "+ce.getName());
}else if(ce == null) {
customLog.warn("the ce variable is null");
}
if(duenoActual != null) {
List<Identity> userGroup = duenoActual.getWorkgroups();
if(userGroup !=null) {
for(Identity wg : userGroup) {
if(executiveWorkGroup.equals(wg.getName())) {
bandera = true;
break;
}
}
}
if(bandera) {
customLog.warn("El certificador "+duenoActual.getName()+
"es miembro de "+executiveWorkGroup+"delegado a: "+baWorkGroup);
resultado.put("recipientName",baWorkGroup);
resultado.put("reassign",Boolean.TRUE);
} else {
customLog.warn("El cerificador "+duenoActual.getName()+
" no pertenece al workgroup: "+executiveWorkGroup);
}
}else {
customLog.warn("Owner is not a identity "+ duenoActual.getClass().getName());
}
return resultado;